Skip to content

feat(hooks): expose for-the-record and handoff-guard knobs via userConfig - #10

Merged
claylo merged 1 commit into
mainfrom
feat/hooks-user-config
Apr 18, 2026
Merged

feat(hooks): expose for-the-record and handoff-guard knobs via userConfig#10
claylo merged 1 commit into
mainfrom
feat/hooks-user-config

Conversation

@claylo

@claylo claylo commented Apr 18, 2026

Copy link
Copy Markdown
Owner

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

…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
@claylo
claylo merged commit 58f4923 into main Apr 18, 2026
@claylo
claylo deleted the feat/hooks-user-config branch April 18, 2026 02:17
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