gitwtfhub

wtf is contextlint?

haxo98098/contextlint — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · developerComplexity · 2/5Setup · easy

TL;DR

A command line tool that analyzes AI coding agent session transcripts to measure how much stored context is stale, duplicate, or wasted.

Mindmap

mindmap
  root((contextlint))
    What it does
      Analyzes agent transcripts
      Classifies stale reads
      Measures removable context
    Tech stack
      Python
      Standard library only
    Use cases
      Audit AI agent sessions
      Compare context eviction policies
      Reduce wasted tokens
    Audience
      Developers building AI agents

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Measure how much of an AI coding agent's context window is stale or duplicate.

REASON 2

Identify file reads that became outdated after a later edit in the same session.

REASON 3

Compare different strategies for trimming old context from long agent sessions.

REASON 4

Get a JSON report of context usage for further analysis.

What's in the stack?

Python

How it stacks up

haxo98098/contextlint0xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultyeasyhardhard
Complexity2/54/54/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires Python 3.9+ and only reads Claude Code JSONL transcripts today.

License is not stated in the README shown, so terms of use are unclear.

Wtf does this do

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.

Yoink these prompts

Prompt 1
Help me install contextlint and run it against a Claude Code session transcript.
Prompt 2
Explain what stale-read and duplicate-read mean in contextlint's output.
Prompt 3
Show me how to run contextlint with a custom bulk output token threshold.
Prompt 4
Walk me through how contextlint's diff-replace eviction policy works.
Prompt 5
Help me interpret a contextlint JSON report for my own agent sessions.

Frequently asked questions

wtf is contextlint?

A command line tool that analyzes AI coding agent session transcripts to measure how much stored context is stale, duplicate, or wasted.

What language is contextlint written in?

Mainly Python. The stack also includes Python.

What license does contextlint use?

License is not stated in the README shown, so terms of use are unclear.

How hard is contextlint to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is contextlint for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.