Context window usage analyzer for Claude Code — MCP server + interactive dashboard
README
Context window usage analyzer for Claude Code. Tracks how context is consumed across tools, compaction, skills, and user interactions — then visualizes it so you can optimize your sessions.
~/.claude/settings.json to capture tool calls, compaction events, session lifecycle, and subagent activity/ for single-session visualization: context growth, cache churn, composition, message inspector/sessions for comparing patterns across sessions: cost/call vs context size, insights, trends# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/manavgup/context-analyzer.git
cd context-analyzer
make install-dev # create venv and install with uv
make hook-install # install Claude Code hooks (optional — dashboard works without hooks)
make dev # start dashboard on localhost:8080
Then open:
http://localhost:8080/ — single-session dashboard (picks most recent session)http://localhost:8080/sessions — cross-session analyticsAfter upgrading context-tracker, re-run the installer to refresh the Claude
Code hooks in ~/.claude/settings.json:
make hook-install # or: context-tracker install
Older versions installed a hook command that could fail to import
context_tracker (and broke on interpreter paths containing spaces).
Reinstalling rewrites context-tracker's hook entries with the correct