Scan assistant messages for decision language at Stop time#12
Merged
Conversation
The plugin detected decision language in user messages (capture_nudge) but missed decisions stated by the assistant. At Stop time, read the session's JSONL transcript from disk and scan assistant text blocks for decision phrases with the same corroboration requirements. - Add _discover_transcript() to locate session JSONL files - Add _scan_assistant_decisions() with tail-read (last 64KB) for performance - Integrate as highest-priority secondary hint in stop_nudge - Deduplicate against phrases already detected by capture_nudge - 8 new tests covering detection, corroboration, dedup, and edge cases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
capture_nudgeonUserPromptSubmit) but missed decisions stated by the assistant — there's noAssistantMessagehook event in Claude Codestop_nudge, before impl/plan/staleness checksChanges
helpers.py: Add_discover_transcript()— locates~/.claude/projects/{key}/{session-id}.jsonlconstants.py: AddTRANSCRIPT_TAIL_BYTES(64KB) andTRANSCRIPT_MAX_BLOCKS(20)stop_nudge.py: Add_scan_assistant_decisions()(tail-read + pattern matching) and_assistant_decision_summary(), wire into_stop_nudge_condition()priority chaintests/test_stop_nudge.py: 8 new tests — detection, corroboration, dedup with capture_nudge, missing/corrupt transcript, dismissed nudges, end-to-endDesign choices
capture_nudge(phrase + tech signal OR reasoning signal OR 2+ phrases)capture_nudgefrom user inputTest plan
make check)🤖 Generated with Claude Code