[FEATURE] View SessionStart hook-injected context via command or flag

Resolved 💬 3 comments Opened Feb 7, 2026 by coygeek Closed Mar 7, 2026

1. TITLE

View SessionStart hook-injected context via command or flag

2. PREFLIGHT CHECKLIST

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

3. PROBLEM STATEMENT

SessionStart hooks can inject arbitrary context into Claude's prompt via additionalContext and stdout. This is powerful for loading dev context, project structure, documentation references, and environment info at session start. However, users have no way to see what was actually injected.

The systemMessage field is shown to users as status lines, but the additionalContext content -- which is often the bulk of what hooks inject -- goes directly into Claude's context with no user-facing visibility.

This creates a debugging and transparency gap:

  • When hooks misbehave, users can't tell if the context was injected correctly without reading the raw session transcript JSONL
  • Users with many SessionStart hooks (10+) can't audit what Claude actually received
  • There's no quick way to verify context injection after compaction (where SessionStart hooks re-run)

4. PROPOSED SOLUTION

Add a way to view all hook-injected context from the current session. Two possible approaches (either would solve the problem):

Option A: Extend /context command
/context --hooks or /context --detail would list each hook's injected additionalContext with the hook name and a truncated preview.

Option B: New /hooks subcommand
/hooks --output or /hooks --show-context would display the additionalContext and systemMessage from the most recent SessionStart hook execution, grouped by hook name.

Either way, the output should show:

  • Hook name
  • Whether it contributed additionalContext, systemMessage, or both
  • A preview of the injected text (first ~200 chars, with option to expand)
  • Total character count per hook

5. ALTERNATIVE SOLUTIONS

Current workarounds:

  1. Ask Claude -- "What context was injected at session start?" Claude can read <system-reminder> blocks, but it summarizes rather than showing raw content, and it can't distinguish which hook injected which content.
  2. Read the session transcript -- jq on the .jsonl file at transcript_path shows everything, but requires knowing the file path and manual parsing.
  3. Verbose mode (Ctrl+O) -- Shows hook stdout during execution, but doesn't show the rendered additionalContext content after processing.
  4. claude --debug -- Shows which hooks matched and exit codes, but not the injected content itself.

None of these provide a quick, in-session way to audit what hooks injected.

6. PRIORITY

  • [x] Medium - Would be very helpful

7. FEATURE CATEGORY

  • [x] CLI commands and flags
  • [x] Interactive mode (TUI)

8. USE CASE EXAMPLE

Scenario: I have 17 SessionStart hooks that inject datetime, session ID, documentation references, project structure, coverage stats, and more.

  1. I start a new Claude Code session
  2. I see 17 traffic-light status lines (systemMessage) -- good
  3. But I can't tell if the documentation reference list is correct, or if the project structure injection picked up the right directory
  4. With this feature, I'd run /hooks --output and see:

``
inject-datetime: 142 chars (additionalContext)
Preview: <DateTime>Current Date: February 06, 2026...
inject-docs-on-session: 3,847 chars (additionalContext)
Preview: <Documentation-Reference>...
inject-project-structure: 1,203 chars (additionalContext)
Preview: <Project Structure>src/ (12 files)...
``

  1. I'd immediately see that inject-docs loaded 3,847 chars of doc references and verify the content looks right -- without reading the raw transcript

9. ADDITIONAL CONTEXT

  • The documentation at hooks.md (line 420) confirms that SessionStart stdout is "added as context that Claude can see and act on" but provides no mechanism for users to view this content
  • Related but distinct from #18039 (context consumption breakdown) -- that issue is about size, this is about content
  • This would also help debug issues like #12151 (hook output not captured) by giving users a way to verify what actually reached Claude

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗