Skip to content

Nudge hook: re-arm per run instead of once per session, and see CLI-agent spawns - #132

Open
bluemihai wants to merge 2 commits into
NateBJones-Projects:mainfrom
bluemihai:nudge-rearm
Open

bluemihai wants to merge 2 commits into
NateBJones-Projects:mainfrom
bluemihai:nudge-rearm

Conversation

@bluemihai

Copy link
Copy Markdown

Why

Two gaps in the nudge hook, both found by it failing to fire when it mattered.

It fired once per session. The marker file is keyed on (session_id, event), so the first nudge in a long session was also the last. But a long session is exactly where routing drift happens: the tenth time you catch yourself about to do delegable work by hand is at least as worth catching as the first, and by then the hook has been silent for hours. A guard whose whole job is to interrupt a habit cannot retire after one interruption.

It didn't see CLI-agent spawns. The pre-bash matcher missed the shapes that most reliably indicate work routing around Ringer — invoking another coding agent directly from a shell. That is the single clearest tell that a task is about to be done unverified and invisibly, and it was the one case going unremarked.

What this changes

  • The marker re-arms rather than latching for the session, so the nudge is available again on a later occurrence instead of being spent on the first.
  • The pre-bash matcher widens to catch CLI-agent spawn shapes.

Tests

tests/test_nudge_hook.py gains coverage for both: that a second occurrence in the same session still nudges (the behaviour that was silently absent), and that the widened matcher fires on agent-spawn command shapes.

13 nudge-hook tests pass; full suite green on this branch: 259 passed.

🤖 Generated with Claude Code

bluemihai and others added 2 commits September 10, 2026 04:26
…-agent spawns

- pre-bash nudge re-arms on a 15-min cooldown (RINGER_NUDGE_COOLDOWN_SECONDS
  overridable) instead of a permanent once-per-session marker
- pre-bash also triggers on CLI agent spawns: claude -p/--print, codex exec,
  opencode run, aider (plain 'claude --version' stays silent)
- post-edit re-nudges every 8 edits after the 8-edit/3-file threshold instead
  of nudging exactly once; last_nudged_count tracked in session state
- tests: 4 new cases; all 13 pass

Requested by Mihai 2026-07-11 (fix b of a/b/c: main agent grinding inline).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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