Context Diff
Description
git diff for the Claude Code context window. See which tool call ate 40k tokens and why your session auto-compacted.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
context-diff
**`git diff` for your Claude Code context window.** See exactly which tool call ate 40k tokens, which turn evicted the cache, and how close you are to hitting the 200k ceiling.
[](https://pypi.org/project/context-diff/) []() []()
Why
Your Claude Code session keeps hitting "auto-compact triggered." You suspect some tool result is huge — but which? Was it the 80-file `find`, the `Read` on the giant log, or the third agent you spawned in parallel?
`context-diff` reads your session JSONL (Claude Code records every turn locally) and renders a turn-by-turn token waterfall: input tokens, cache reads, deltas, which tool calls fired, and the top-N biggest jumps.
You go from "my context is full and I don't know why" to "Turn 14's `Grep` returned 38k tokens — I should have piped it through `head`" in 2 seconds.
Install
pip install context-diff
# or
uvx context-diff --auto
Zero dependencies. Pure Python ≥3.10.
Use
# Auto-pick the most recently modified session
context-diff --auto
# Or point at a specific session
context-diff ~/.claude/projects/-Users-you-proj/abc-def.jsonl
# Show top 10 biggest turns
context-diff --auto --top 10
# Machine-readable
context-diff --auto --json | jq '.[] | select(.delta_input > 10000)'
Example output
Turn Kind Δ tokens in cache_r Label
─────────────────────────────────────────────────────────────────
1 user — — — user: fix the auth bug in /login
2 assistant 1.2k 1.2k — ⬆ Read, Grep
3 tool_result — — — ↳ tool_result × 2 (8,420 chars)
4 assistant 2.1k 850 1.2k ⬆ Edit
5 tool_result — — — ↳ tool_result × 1 (320 char
Related Skills
Epic Sync
Sync epic issue bodies, labels, and local coordination snapshots from GitHub.
Git 使用 Git Worktrees
创建孤立的 Git worktrees,带有智能目录选择与安全验证。
Git Claude skills github
[Building agent skills blog](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-ag
Git #148
, [#161](https://github.com/affaan-m/everything-claude-code/pull/161))
Git GitHub MCP
| Token | Repos, issues, PRs, workflows |
Git GitHub MCP Server
Official first-party server to read repos, manage issues/PRs, and automate workflows.
Git