Skip to content

Add SessionStart continuation-digest hook#7

Merged
VoidAxiom merged 2 commits into
mainfrom
sk/session-context-hook
May 17, 2026
Merged

Add SessionStart continuation-digest hook#7
VoidAxiom merged 2 commits into
mainfrom
sk/session-context-hook

Conversation

@VoidAxiom
Copy link
Copy Markdown
Owner

Lets a future session resume this work without re-deriving state (this session got long).

Change

  • .claude/hooks/session-context.sh — prints a digest: live git state, Linear-ledger + issue-first flow, known next actions (Linear MCP /mcp re-auth + restart; open backlog VOI-29/32/33), and guardrails/determinism reminders.
  • .claude/settings.jsonhooks.SessionStart runs it. Permissions block untouched (36 allow / 15 deny preserved).

Evidence

  • settings.json valid JSON; jq -e confirms the hook command and preserved permissions counts
  • Pipe-test: echo '{}' | bash .claude/hooks/session-context.sh prints the digest, exit 0
  • SessionStart fires outside this turn — it takes effect next session (its purpose); user can open /hooks to review

Tracking

No Linear issue linked — the Linear MCP is mid-reauth after the VOI-27 /sse/mcp migration (tools unavailable this session). To be backfilled as a Linear issue once re-authed (the digest itself flags this).

Future sessions get a concise 'where we are / how to continue' digest
injected at start: git state (live), the Linear-ledger + issue-first
flow, known next actions (Linear MCP re-auth, backlog), and the
guardrails/determinism reminders. Script .claude/hooks/session-context.sh
(self-updating git bits), wired via .claude/settings.json
hooks.SessionStart. Permissions block unchanged.

Evidence: settings.json valid JSON; jq confirms hook command + 36 allow
/15 deny preserved; pipe-test (echo '{}' | hook) prints digest, exit 0.
@VoidAxiom
Copy link
Copy Markdown
Owner Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4caa4d8098

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/settings.json Outdated
Addresses Codex P2 on PR #7: the relative '.claude/hooks/...' command
resolved against the session launch CWD, so a session started from a
subdir (e.g. src/) would fail to find the hook and silently skip the
digest. Now invokes via ${CLAUDE_PROJECT_DIR:-.} (absolute project
root Claude Code provides to hooks; '.' fallback). Verified: runs from
src/ with CLAUDE_PROJECT_DIR set, and from root with it unset.
@VoidAxiom
Copy link
Copy Markdown
Owner Author

@codex addressed the P2 ("Make the hook path independent of the launch directory") in 6f0b2b8: the SessionStart command now invokes bash "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/session-context.sh" — anchored on the absolute project root Claude Code provides to hooks, with a . fallback. Verified it runs when launched from a subdir (src/ with CLAUDE_PROJECT_DIR set) and from root (unset fallback). Resolving; please re-review.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@VoidAxiom VoidAxiom merged commit 781b5a4 into main May 17, 2026
1 check passed
@VoidAxiom VoidAxiom deleted the sk/session-context-hook branch May 17, 2026 02:50
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