Skip to content

feat(hooks): session-tracker Stop hook + ADR-010 amendment (AL-24)#15

Merged
Roo4L merged 7 commits into
masterfrom
worktree-session-tracker-hook
May 3, 2026
Merged

feat(hooks): session-tracker Stop hook + ADR-010 amendment (AL-24)#15
Roo4L merged 7 commits into
masterfrom
worktree-session-tracker-hook

Conversation

@Roo4L
Copy link
Copy Markdown
Owner

@Roo4L Roo4L commented May 3, 2026

Summary

Adds .claude/hooks/session-tracker-reminder.sh — a Stop hook that nudges Claude to keep the linked Jira ticket in sync via the session-tracker skill before stopping. Mirrors the AL-23 review-reminder pattern: stop_hook_active one-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 0
  • echo '{"stop_hook_active":true}' | bash .claude/hooks/session-tracker-reminder.sh → empty stdout, exit 0
  • Both hooks (review-reminder + session-tracker-reminder) wired in .claude/settings.json; node -e 'JSON.parse(require("fs").readFileSync(".claude/settings.json","utf8"))' clean
  • shellcheck --severity=warning --shell=bash clean on the new hook
  • pre-commit clean (end-of-file-fixer, trailing-whitespace, check-json, detect-private-key, ShellCheck, shfmt)
  • Review loop: bash-engineer + security-engineer ship-it; qa-engineer surfaced two findings (missing trigger enumeration, plan-violating AL hardcoding) — both fixed inline before the docs commit
  • Manual: stop a Claude session in this repo with no Jira state change → hook fires once → request stop again → passes through

🤖 Generated with Claude Code

Roo4L added 7 commits May 3, 2026 06:38
- 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.
@Roo4L Roo4L merged commit c87eda8 into master May 3, 2026
12 checks passed
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