Skip to content

About

Find out where your coding agent starts degrading. Personal context-rot analytics from your own sessions - 100% local, zero-config: uvx contextrot

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

63 stars

Watchers

2 watching

Forks

Repository files navigation

contextrot logo

contextrot

Does your coding agent get worse as its context fills?
Find out on the sessions already on your disk — and what actually moves its failure rate.

See the story → priyanshu-byte-coder.github.io/contextrot

PyPI version Downloads Python versions CI License: MIT


Everyone says coding agents get worse as their context fills — /clear often, keep it small, use subagents. That advice comes from lab benchmarks. contextrot checks it against your own real sessions. Sometimes it's true. Often it isn't, and something else is what's hurting you.

No setup, no API keys. It reads the transcripts your agent CLI already keeps, runs entirely on your machine, and makes zero network calls.

Quick start

uvx contextrot

or pip install contextrot then contextrot (Python 3.9+).

contextrot: command not found after pip install?

Your Python scripts folder isn't on PATH — common with the stock macOS python3. Use uvx contextrot, or run it as python3 -m contextrot.

contextrot's short report: a context-rot verdict, the slip rate at a fresh versus a full context, the strongest other factor, and what to do

You get one of four honest answers:

Verdict Meaning
✗ Context rot detected your failure rate climbs as context fills — and here's where
! Edge rot flat until near the limit, then it climbs
✓ No measurable rot filling the window isn't what's hurting you
? Not enough data keep using your agent, or look further back with --days 0

A tool that can say "you're fine" is a tool you can trust when it says you're not.

Then, three things worth doing

1. Find what actually moves your failure rate

contextrot factors

Context fill is one suspect. This checks the others with the same statistics — time of day, how long the agent runs without you, mistakes piling up, which model, which agent — and ranks what genuinely separates your good steps from your bad ones.

contextrot factors: a ranked table of factors with the worst and best group for each, the size of the gap, and whether the effect is clear

2. Keep it watching

contextrot install statusline --apply    # Claude Code: a live meter in your status bar
contextrot status --setup tmux           # any agent: one line for tmux, Starship, your prompt

A report you run once is forgotten. A meter you see every turn isn't — it shows how full the window is, how many turns are left, and goes red where your curve says it should, not at a generic 70%.

3. Add your curve to the dataset

contextrot share --copy

Nobody knows what context rot looks like on real work across many people, because nobody has had the data. This prints your curve as anonymized numbers — no project names, paths, prompts or code — and sends nothing. You read it, then paste it into a Share your curve issue. Clean curves count as much as rotten ones. What's in it, exactly →

Everything else

You want to… Run
See the full analysis behind the verdict contextrot --full
Know which kinds of slip cost the most contextrot waste
Compare your coding agents on your own work contextrot agents
Find which repo degrades first contextrot projects
See whether it's getting better week by week contextrot trends
Get concrete fixes, including unused MCP servers contextrot fix
Share a report as a single HTML file contextrot --html report.html
Work out why you have no verdict contextrot doctor
See how much water your agents' inference used contextrot water

Every command animates when you're watching and prints plain output when you're not. The guide covers every command, the status line segment by segment, troubleshooting and the FAQ. The showcase shows each screen.

Supported agents

Agent
Claude Code · Codex CLI · Gemini CLI · Qwen Code · OpenCode ✅
Cline · Roo Code · Kilo Code (VS Code) ✅
Google Antigravity 🔬 investigating
Cursor · Windsurf · Kiro ⚠️ their local files don't record per-message token counts

Adding an agent is one small file with a fixture and a test — the paved first contribution.

How it works

Agent CLIs log every step to local transcripts, with token counts and what happened. For each step, contextrot records how full the context window was and whether one of five failure signals fired — a failed edit, a retried call, a re-read of a file already read, a tool error, or an "I apologize, let me fix that". Then it measures how the rate of those changes as context fills.

The statistics are conservative on purpose: Wilson 95% confidence intervals, visible sample sizes, and a threshold declared only when the evidence clears the baseline — one noisy bucket can't scare you. It's observational, and it says so: deeper context also means later in the task. The full method is in methodology.md.

Privacy

Local files in; terminal, or a local HTML file, out. Zero network calls — there's no HTTP client in the codebase. share prints and copies to your clipboard; whether anything leaves your machine is entirely your decision.

Contributing

The most valuable first PR is an adapter for the agent CLI you use — see CONTRIBUTING.md. Bugs and ideas are welcome in issues and discussions. If it told you something useful about your setup, a ⭐ helps other people find it.

Contributors

License

MIT — see LICENSE. Release notes are in the changelog.

About

Find out where your coding agent starts degrading. Personal context-rot analytics from your own sessions - 100% local, zero-config: uvx contextrot

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

63 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages