yubinkim444

Context Diff — Git skill for Claude Code

Git community

git diff for the Claude Code context window.

How to install Context Diff

This entry records only its repository, not the path inside it, so there is no exact command to give. Open yubinkim444/context-diff and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Context Diff does

git diff for the Claude Code context window. See which tool call ate 40k tokens and why your session auto-compacted.

Alternatives in Git

  • Get Commit Details — git show --name-status [COMMIT_ID] git diff [COMMIT_ID]^ [COMMIT_ID] 1.3k ★
  • Agent Flow — Real-time visualization of Claude Code agent orchestration — see your agents think, branch, and coordinate as 668 ★
  • GitCommit — You are a commit message generator 250 ★

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.

[![PyPI](https://img.shields.io/pypi/v/context-diff)](https://pypi.org/project/context-diff/) [![Python](https://img.shields.io/badge/python-3.10%2B-blue)]() [![License: MIT](https://img.shields.io/badge/license-MIT-green)]()


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