Auto-surface the /issues ledger via a SessionStart hook#1052
Conversation
Add .claude/hooks/issues-surface.sh, wired into the existing SessionStart group in .claude/settings.json, so every session starts with the open outstanding-work items already in context (P1/P2 listed, P3 collapsed to a count). On a context reset (compact/resume/clear) it also nudges a /issues capture so in-flight follow-ups aren't lost. The hook is read-only: it never writes or commits the ledger, and always exits 0 so it can't break a session. Documented in the AGENTS.md /issues section.
📝 WalkthroughWalkthroughA new SessionStart hook reads and summarizes open issues, conditionally emits ChangesSession-start issues surface
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Suggested labels: Sequence Diagram(s)sequenceDiagram
participant SessionStart
participant IssuesSurface as issues-surface.sh
participant IssuesLedger as outstanding-issues.md
SessionStart->>IssuesSurface: invoke hook with session input
IssuesSurface->>IssuesLedger: read Open items table
IssuesLedger-->>IssuesSurface: open issue rows
IssuesSurface-->>SessionStart: priority summary and reminder
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/hooks/issues-surface.sh:
- Around line 59-80: Update print_group so each issue summary in sum is
normalized and truncated to a bounded length before rendering in the echo
output. Preserve the existing priority, ID, type, counting, and “more” behavior,
and append an ellipsis when the summary exceeds the cap.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 851fdc92-7925-4df3-b05d-64b52bba56c2
📒 Files selected for processing (3)
.claude/hooks/issues-surface.sh.claude/settings.jsonAGENTS.md
| print_group() { # $1=rows $2=max-to-list | ||
| local data="$1" limit="$2" shown=0 more=0 pri id typ sum | ||
| [ -z "$data" ] && return 0 | ||
| while IFS=$'\t' read -r pri id typ sum; do | ||
| [ -z "$pri" ] && continue | ||
| if [ "$shown" -lt "$limit" ]; then | ||
| echo " ${pri} ${id} ${typ} — ${sum}" | ||
| shown=$((shown + 1)) | ||
| else | ||
| more=$((more + 1)) | ||
| fi | ||
| done <<EOF | ||
| $data | ||
| EOF | ||
| [ "$more" -gt 0 ] && echo " … +${more} more at this priority (see /issues)" | ||
| return 0 | ||
| } | ||
|
|
||
| # P1 = do-next, list all. P2 = should-do, list up to 8. P3 = collapse to a count. | ||
| [ "$c1" -gt 0 ] && print_group "$p1" 999 | ||
| [ "$c2" -gt 0 ] && print_group "$p2" 8 | ||
| [ "$c3" -gt 0 ] && echo " ${c3} × P3 (nice-to-have / revisit-when) — see /issues" |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win
Bound each rendered issue summary.
At Line 65, ${sum} is injected into SessionStart output without truncation. A long ledger summary can overwhelm the “compact” context surface; normalize and cap it with an ellipsis before echoing it.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.claude/hooks/issues-surface.sh around lines 59 - 80, Update print_group so
each issue summary in sum is normalized and truncated to a bounded length before
rendering in the echo output. Preserve the existing priority, ID, type,
counting, and “more” behavior, and append an ellipsis when the summary exceeds
the cap.
Summary
/issuestracker (Add /issues skill and outstanding-work memory ledger #1018): makes the outstanding-work memory push, not just pull..claude/hooks/issues-surface.sh, wired into the existingSessionStartgroup in.claude/settings.json, so every session starts with the open items fromdocs/outstanding-issues.mdalready in context — P1/P2 listed, P3 collapsed to a count.compact/resume/clear) it additionally nudges a/issues capture, which is the moment in-flight follow-ups are most likely to be lost.SessionStartis the only hook event whose stdout reaches the model and that fires on compaction, so it's the correct mechanism (verified against the current Claude Code hook contract;SessionEndis cleanup-only,PreCompactisn't model-facing)./issuessection.Verification
npm run verify:pr-localVerification not run: change is a read-only bash SessionStart hook plus a.claude/settings.jsonwire-up and an AGENTS.md doc note — no application source, config, or test code is touched, so the app gates do not apply. Instead: (1) ran the hook against the real ledger forsource=startupandsource=compact— correct open-item summary, correct conditional reminder, exit 0 both times; (2) validated.claude/settings.jsonparses as JSON; (3)prettier --checkclean on.claude/settings.jsonandAGENTS.md.Risk and rollout
exit 0). It runs alongside — not replacing — the existing Node-install and base-freshness SessionStart hooks.issues-surface.shentry from.claude/settings.jsonand delete the script.Clinical Governance Preflight
Not applicable — no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output is touched.
Notes
## Open itemstable only, so theResolved / archivetable is never counted.docs/outstanding-issues.mditself is not modified by this PR; it is actively maintained by the/issuesskill.🤖 Generated with Claude Code
https://claude.ai/code/session_018v3T5ahDyiT8nHqdjCdfB8
Generated by Claude Code
Summary by CodeRabbit
New Features
Documentation