Skip to content

feat: replace silence heuristic with Claude Stop hook for session idle detection#42

Merged
dakl merged 3 commits intomainfrom
better-indicators
Apr 13, 2026
Merged

feat: replace silence heuristic with Claude Stop hook for session idle detection#42
dakl merged 3 commits intomainfrom
better-indicators

Conversation

@dakl
Copy link
Copy Markdown
Owner

@dakl dakl commented Apr 13, 2026

Summary

  • Replaces the 10s PTY-silence heuristic in SidebandDetector with a semantic signal via Claude Code's Stop hook
  • New SessionStopWatcher class writes a per-session settings JSON that registers a Stop hook (touch <signal-file>), passes --settings to Claude, and uses fs.watch to detect when the hook fires
  • SidebandDetector is kept as fallback for non-claude agents
  • Fixes shell-quoting of the signal file path (shellQuote uses single quotes) to handle spaces and special characters in the app data directory

Test plan

  • All existing tests pass (npm test)
  • Verify waiting_for_input status updates immediately when Claude finishes a turn (no 10s delay)
  • Verify status flips back to running immediately on Enter key press

🤖 Generated with Claude Code

github-actions Bot and others added 2 commits April 5, 2026 15:45
…e detection

Uses Claude Code's Stop hook to emit a signal file when a turn completes,
replacing the 10s idle timer. Also fixes shell-quoting the signal file path
to handle spaces and special characters.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@dakl dakl merged commit d5e0659 into main Apr 13, 2026
2 of 3 checks passed
@dakl dakl deleted the better-indicators branch April 13, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant