[FEATURE] Debug command to view the full chronological content of the context window
Problem Statement
When building and tuning harness systems on top of Claude Code (custom hooks, context injection, subagent orchestration, MCP plumbing), the single most important variable is what actually ends up in the model's context window — the exact content and the exact order it was loaded.
Context is paramount to the model's reasoning and outputs, yet today there is no way to see the real, full context as the model sees it. The existing /context command shows the composition / budget breakdown (how many tokens each category consumes), but it does not show the chronological transcript — the actual messages, tool calls, tool results, system reminders, and injected context in the sequence they were assembled.
That gap makes harness debugging guesswork: I can see that ~30k tokens are "system prompt" or "tool results," but not what those bytes are or where in the timeline a given block landed. When a harness misbehaves (a hook injects the wrong thing, context loads out of order, a reminder appears in an unexpected place), I have no ground-truth view to verify against.
Proposed Solution
A debug command that dumps the complete, ordered content of the current session's context window — the chronological reasoning/assembly history, not just the budget summary.
Ideal experience:
- A command such as
/context --full(or a dedicated/context-dump/claude --debug-context) that renders the full in-context payload in load order: system prompt, tools, memory/CLAUDE.md, each user/assistant turn, every tool_use + tool_result, and any injected<system-reminder>/ hookadditionalContextblocks. - Each entry annotated with its type/source (system, user, assistant, tool_result, hook injection, memory, reminder) and token count, so composition and chronology are visible in one view.
- An option to export to a file (e.g. JSON or markdown) so the exact context can be diffed across runs while iterating on a harness.
The key addition over /context is the timeline: the verbatim sequence loaded into the window, not an aggregate.
Alternative Solutions
/context— shows composition/budget only, no chronological content. This is the closest existing tool and what motivated the request.- Inspecting the on-disk session transcript / JSONL — partial and unreliable as a proxy: it isn't guaranteed to reflect exactly what was assembled into the window after hook injection, reminders, compaction, and ordering, which is precisely what needs verifying.
- Manually instrumenting hooks to log what they inject — only covers hook-sourced content, not the fully assembled window, and is laborious to wire up per harness.
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
- I'm designing a custom harness that uses PreToolUse hooks plus injected
additionalContextto feed task state into the model. - The model starts behaving as if it never received that state, or received it at the wrong point in the conversation.
- Today I can only see from
/contextthat "hook context" occupies some tokens — not its actual content or position in the timeline. - With this feature I run
/context --full, see the exact injected block, its content, and where in the chronological sequence it was placed (e.g. it landed after the tool_result instead of before the next user turn). - I immediately confirm the ordering bug, fix the hook, and re-dump to verify — instead of guessing.
This turns harness debugging from inference into direct observation, and would be critical for anyone building or optimizing harness/agent systems on Claude Code.
Additional Context
- This is purely a read/inspection capability over context the session already holds — no new data exposure beyond what the model already sees.
- Most valuable when paired with an export/diff option, so the assembled window can be compared run-to-run while tuning a harness.
- Related in spirit to other "make the context visible" requests (e.g. surfacing hidden content the model reasons over), but focused specifically on the full chronological context window rather than any single source.
3 Comments
A first-class
/context --fullwould be great, and I'd use it too. Until it exists, there's a ground-truth source you can dump today that covers most of what you're describing: the session transcript JSONL.Every turn is appended in assembly order to
~/.claude/projects/<encoded-project-path>/<session-id>.jsonl, one JSON object per line. The line order is the chronological order, and each object is typed. From poking at my own current session:type: "user"/type: "assistant"carry.message.roleand.message.content[], where each content block has its own.type:text,thinking,tool_use,tool_result.<system-reminder>blocks and hookadditionalContextland astextblocks insideusermessages (that's where things like hook output and reminders appear), so you can see where in the timeline they landed.tool_usein an assistant turn, the matchingtool_resultin the next user turn).A quick annotated chronological dump:
That gives you
role/blocktype+ a snippet, in load order — enough to verify "did the hook inject the wrong thing / did a reminder appear in an unexpected place / did context load out of order," which is exactly the harness-debugging case.Honest caveats so this doesn't mislead:
/context --fullthat also rendered those verbatim would still be strictly better than this workaround.tool_resultcontent can be large/truncated-on-display; the JSONL has the stored form, which may differ from what was actually sent if the client elides.So this isn't a full substitute for the feature you're asking for — the system-prompt + tools portion and a guaranteed "exactly what was sent" guarantee are the parts only a built-in command can give you. But for "what landed in the timeline and in what order," the transcript is a usable ground truth today.
Fully agree with this request. Context ordering is the part of harness development that is currently pure guesswork, and the existing /context budget view does not help because the problem is never "how many tokens am I using in category X" - it is "in what order did the model see things, and did my hook injection land before or after the task description."
A few additions that would make this even more useful:
The use case for harness builders is concrete: when a subagent returns unexpected output, the first debugging question is always "what did it actually see?" Right now the answer is "probably whatever we think we sent, plus whatever the runtime injected, in some order." That is not a sustainable debugging environment for anyone building reliable systems on Claude Code.
Update: while waiting for a first-class
/context --full, I built a tool that renders the view I was asking for here, reconstructed from the session transcripts — if you have a similar need, feel free to check it out:https://github.com/gigayaya/context-render
It's a local, read-only CLI (no API calls, no telemetry). For each session it shows:
report/deadweight) to find scaffolding that never gets usedEssentially it's @yurukusa's transcript-based approach, engineered into a full tool — so it shares the same honest ceiling: the transcript doesn't contain the static system prompt / tool definitions, and it's a post-hoc reconstruction rather than a guaranteed byte-exact record of what was sent. A built-in command would still be strictly better, and I'd still love to see this feature land. But for the harness-debugging loop ("did my hook injection land where I expected, and in what order?"), it's been a usable ground truth for me today.