feat(hooks): expose for-the-record and handoff-guard knobs via userConfig - #10
Merged
Conversation
…nfig
Declare three userConfig keys in plugin.json so users pick the
opinionation level at enable time instead of accepting cnc's baked-in
defaults (or hand-editing hook scripts).
for_the_record_mode block | warn (default: block)
record_subdirs CSV subdirs (default: adrs,decisions,
plans,reviews,specs,
diagrams,superpowers)
handoff_drift_minutes integer minutes (default: 5)
for-the-record.sh now reads CLAUDE_PLUGIN_OPTION_FOR_THE_RECORD_MODE
and CLAUDE_PLUGIN_OPTION_RECORD_SUBDIRS. The subdir list is parsed
into a regex alternation at runtime, so users can replace the default
record-keeping vocabulary with their own. Warn mode allows the write
and attaches a "suggested path" note rather than denying.
handoff-filename-guard.sh replaces the tight "current minute OR
previous minute" string match with a drift window: extract the
YYYY-MM-DD-HHMM prefix, parse to epoch (macOS date -j -f, GNU date -d),
compare abs(diff) against CLAUDE_PLUGIN_OPTION_HANDOFF_DRIFT_MINUTES.
Default 5 min absorbs clock skew and the minute-cusp case while still
catching the "agent hallucinated the hour or day" failures that
motivated the hook in the first place. The separate 30-minute mtime
window for historical edits is untouched.
Defaults match prior behavior, so upgrading changes nothing until a
user sets an option. The spec's date mock was rebuilt around an epoch
anchor so the drift math has a stable "now" to compare against; 46/46
ShellSpec examples remain green.
Release-Note: Configurable for-the-record mode and handoff drift window
Release-Impact: medium
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.
Declare three userConfig keys in plugin.json so users pick the
opinionation level at enable time instead of accepting cnc's baked-in
defaults (or hand-editing hook scripts).
for_the_record_mode block | warn (default: block)
record_subdirs CSV subdirs (default: adrs,decisions,
plans,reviews,specs,
diagrams,superpowers)
handoff_drift_minutes integer minutes (default: 5)
for-the-record.sh now reads CLAUDE_PLUGIN_OPTION_FOR_THE_RECORD_MODE
and CLAUDE_PLUGIN_OPTION_RECORD_SUBDIRS. The subdir list is parsed
into a regex alternation at runtime, so users can replace the default
record-keeping vocabulary with their own. Warn mode allows the write
and attaches a "suggested path" note rather than denying.
handoff-filename-guard.sh replaces the tight "current minute OR
previous minute" string match with a drift window: extract the
YYYY-MM-DD-HHMM prefix, parse to epoch (macOS date -j -f, GNU date -d),
compare abs(diff) against CLAUDE_PLUGIN_OPTION_HANDOFF_DRIFT_MINUTES.
Default 5 min absorbs clock skew and the minute-cusp case while still
catching the "agent hallucinated the hour or day" failures that
motivated the hook in the first place. The separate 30-minute mtime
window for historical edits is untouched.
Defaults match prior behavior, so upgrading changes nothing until a
user sets an option. The spec's date mock was rebuilt around an epoch
anchor so the drift math has a stable "now" to compare against; 46/46
ShellSpec examples remain green.
Release-Note: Configurable for-the-record mode and handoff drift window
Release-Impact: medium