haxo98098/contextlint — explained in plain English
Analysis updated 2026-05-18
Measure how much of an AI coding agent's context window is stale or duplicate.
Identify file reads that became outdated after a later edit in the same session.
Compare different strategies for trimming old context from long agent sessions.
Get a JSON report of context usage for further analysis.
| haxo98098/contextlint | 0xustaz/streamgate | a-bissell/unleash-lite | |
|---|---|---|---|
| Stars | 1 | 1 | 1 |
| Language | Python | Python | Python |
| Setup difficulty | easy | hard | hard |
| Complexity | 2/5 | 4/5 | 4/5 |
| Audience | developer | developer | researcher |
Figures from each repo's GitHub metadata at analysis time.
Requires Python 3.9+ and only reads Claude Code JSONL transcripts today.
contextlint is a Python tool that analyzes the conversation history AI coding agents build up as they work, and measures how much of it is no longer useful. Coding tools that use large language models keep a running record of everything read, edited, and executed during a session, and that record fills up a limited context window. Most tools only show how full that window is, not what all those tokens are actually doing. The core idea is that a lot of that stored history becomes wrong or redundant as a session goes on. If an agent reads a file and later edits it, the earlier copy stored in context is now outdated, yet it typically stays there for the rest of the session, taking up space and potentially misleading later reasoning. contextlint reads a session transcript, currently in the Claude Code JSONL format, and classifies each piece of tool output into categories: a stale read whose file was later edited, a duplicate read of the same file, a resolved error whose retry succeeded, oversized bulk output, or ordinary live content still worth keeping. Testing this approach against 68 real coding sessions found a median of 38 percent of tool result tokens could be removed, with stale reads being the single biggest category rather than plain verbosity. The project also includes a benchmark that tries different strategies for trimming this stale content, comparing simple approaches like dropping the oldest items against a smarter approach that replaces an outdated file snapshot with a summary of what actually changed. In testing, that smarter approach preserved the most accurate answers about a file's current state while still reducing token usage. The tool installs through pip directly from its GitHub repository, is built using only Python's standard library, and requires Python 3.9 or newer. It runs from the command line against a session transcript file and can output either a readable report or JSON for further processing. This is useful for developers who build or heavily use AI coding agents and want to understand or reduce how much wasted context those agents accumulate during long sessions.
A command line tool that analyzes AI coding agent session transcripts to measure how much stored context is stale, duplicate, or wasted.
Mainly Python. The stack also includes Python.
License is not stated in the README shown, so terms of use are unclear.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.