feat(hooks): session-tracker Stop hook + ADR-010 amendment (AL-24)#15
Merged
Conversation
- Mirror .claude/hooks/review-reminder.sh byte-for-byte in shape (set -euo pipefail, stdin grep on stop_hook_active, JSON heredoc). - Reason text nudges Claude to invoke the session-tracker skill when a concrete deliverable was produced; references AL project, board 2, and copiedwonder.atlassian.net. - One-shot guard via stop_hook_active=true (ADR-010 Refinement 2026-05-02). - Mode 0755, smoke tests pass on both block path and guard path.
Add session-tracker-reminder.sh as a second Stop-hook command alongside review-reminder.sh in project-shared .claude/settings.json. Both hooks share the same Stop matcher block; both have stop_hook_active one-shot guards so worst case is two reminders per turn (one per hook), zero on turns where Claude already invoked the relevant skill. - Project-shared settings.json (not .local) so collaborators inherit it. - Relative path so Claude Code resolves it from the project root. - Settings parse as valid JSON; both hook commands are reachable.
… + ADR-010 - CLAUDE.md: new "Session Tracking" section pointing at the session-tracker skill (Jira project AL, board 2) and the second Stop-hook reminder. Skip rules mirror the review-loop hook (research-only / Q&A / .planning-only). - ADR-010: amend the Consequences bullet and the Refinement "Implementation" line to enumerate both reminder hooks. Status, Context, Decision, and rationale prose remain untouched — Refinement scope unchanged, only the Implementation pointer grows.
…s in hook reason The original reason text described session-start ritual (when to track) but omitted the state-change triggers that AL-24 actually targets — agent forgets to update ticket status after PR opens / merges / blocks. Replace with trigger enumeration matching session-tracker SKILL.md's State-change triggers table: PR opened to In Review, pushback to In Progress, blocked to On hold, new deliverable to Sub-task, merged to Done, anchor close needs user confirmation. Refs AL-24.
…ing to CLAUDE.md QA review flagged: hook hardcoded the AL board, but the upstream session-tracker SKILL.md (user-private) targets IRER. The plan said "keep the hook portable" — let CLAUDE.md > 'Session Tracking' be the single source of truth for project routing. Hook reason now points agents at CLAUDE.md instead of duplicating the project name. Refs AL-24.
Records the AL-24 quick task (session-tracker Stop hook) — second instance of the ADR-010 reminder-hook pattern established by AL-23. Refs AL-24.
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
Adds
.claude/hooks/session-tracker-reminder.sh— a Stop hook that nudges Claude to keep the linked Jira ticket in sync via thesession-trackerskill before stopping. Mirrors the AL-23 review-reminder pattern:stop_hook_activeone-shot guard,{"decision":"block","reason":"..."}JSON envelope, no orchestration in the hook itself.Reason text enumerates all five state-change triggers from
session-tracker/SKILL.md(PR opened → In Review, reviewer pushback → In Progress, blocked → On hold, new deliverable → Sub-task, merged → Done) plus four escape clauses (research-only / no state change / already updated /.planning/-only).ADR-010's 2026-05-02 Refinement section gains one bullet noting session-tracker-reminder is a second instance of the already-permitted reminder-hook pattern — no new ADR needed; the original CLAUDE.md-instruction-primary-plus-stop-hook-backstop model still holds.
CLAUDE.md gets a parallel Session Tracking section documenting the hook + the AL board routing for this repo.
Refs AL-24. Dogfooded — the new hook fired on its own implementation and triggered AL-24 → In Progress.
Test plan
echo '{"stop_hook_active":false}' | bash .claude/hooks/session-tracker-reminder.sh→ emits{"decision":"block",...}exit 0echo '{"stop_hook_active":true}' | bash .claude/hooks/session-tracker-reminder.sh→ empty stdout, exit 0.claude/settings.json;node -e 'JSON.parse(require("fs").readFileSync(".claude/settings.json","utf8"))'clean--severity=warning --shell=bashclean on the new hook🤖 Generated with Claude Code