86 lines in, 4 lines to the agent. The full traceback stays in a local archive, byte for byte.
Why fewer tokens help
One failing test can print a 60-frame traceback. A broken Rust build repeats the same error[E0308] for every crate. The model only needs the exception and two frames, but it pays for all of it, and the wall of text shifts the prompt cache so the next turn is recomputed from scratch.
ACK trims that output before it reaches the model. The pruning is structural and deterministic. There is no second LLM and nothing to pay for.
| Suite | Tokens removed | Errors kept |
|---|---|---|
| Python tracebacks | 93% | 100% |
| Rust and GCC builds | 91% | 100% |
| Log floods | 99% | 100% |
| Mixed, realistic sessions | 80% | 100% |
Every exception class, error code and file:line survives. The benchmark runs in CI on every push.
What happens to each chunk of output
Your agent runs inside a real pseudo-terminal, so colors, prompts and cursor movement behave exactly as before. Every flushed chunk goes through the same four steps.
- Short output passes through.Anything under 30 lines reaches the agent untouched.
- Prompts are never pruned.If the output ends in
[Y/n]orContinue?, the agent is waiting on you, so you always see it. - Long output is summarized.Tracebacks keep the exception and the deepest user frames. Build errors are grouped by code. Floods become a frequency table.
- The original is stored.Every byte goes to a local SQLite archive with full-text search. The summary is a view, never a deletion.
Anything pruned can be read back
Each summary carries a handle like ack #42. Recall is a plain shell command, so when the summary isn't enough, you or the agent itself can pull the exact original back, by handle or by content.
ack recall 42 # the full log behind that banner
ack recall "card_token" # or find it by what it contained
ack search "ImportError OR ModuleNotFoundError" # every session, ranked
Get started
ACK needs Python 3.10 or newer on macOS or Linux (on Windows, use WSL). Put ack run -- in front of the agent you already use.
pip install git+https://github.com/Vaibhavtripathi7/context_kernel
ack run -- claude
ack run -- aider --model gpt-4o
ack run -- python examples/crashing_agent.py # try it without an agent
Where it's going
ACK treats the context window as a scarce resource to be managed. Pruning is the first of three layers.
- L1Output reduction. Collapse tracebacks, build walls and floods before they reach the model. Shipped.
- L2Memory paging. Stable handles and recall, so compression is never a one-way loss. In progress.
- L3Execution offload. Run well-specified deterministic tasks outside the model and hand back only the result. Exploring.