gotcontext + rtk: stack two compression layers, kill 90%+ of your token bill
rtk-ai/rtk handles structured command output (git, test, lint). gotcontext handles unstructured text (docs, plans, KB). They sit at different layers of the agent stack and stack to ~90% joint reduction. Here is the math, the 90-second setup for both, and why we are recommending a "competitor".
Two compression layers that don't compete ¶
If you run an agentic coding loop (Claude Code, Cursor, Codex, Gemini CLI) your tokens come from two distinct sources, and the same compression strategy doesn't fix both.
Source 1: structured command output. Every git status, pytest, tsc, ls, grep your agent runs returns text the LLM has to read. A single 30-minute coding session typically routes ~118K tokens through the Bash tool, and most of it is whitespace, repeated headers, and noise.
Source 2: unstructured documentation. Specs, plans, READMEs, conversation history, ingested files. This is what gets piped into the agent's context window every time you ask "what does this codebase do?"
Compressing each source needs a different mechanism. rtk (rtk-ai/rtk, 44k stars, Apache 2.0) handles source 1. gotcontext handles source 2. Together they kill 90%+ of total token volume.
Where each one operates ¶
| rtk | gotcontext | |
|---|---|---|
| Domain | Structured command output | Arbitrary text |
| Method | Deterministic per-command filters | Semantic chunking + PageRank importance scoring |
| Architecture | Local CLI hook | Remote API + MCP gateway |
| Where it sits | Between agent's Bash tool and the shell | Between agent and your KB / docs / specs |
| License | Apache 2.0 | Proprietary (free + paid plans) |
| Setup | brew install rtk && rtk init -g | MCP config + API key |
git status, the hook intercepts and runs rtk git status instead. The agent never sees the rewrite, it just gets compressed output.gotcontext exposes MCP tools (ingest_context, compress_codebase, gc_kb_query, gc_blast_radius, etc.) that your agent calls explicitly when it needs to compress arbitrary content.
The two systems literally cannot conflict: they intercept different points in the agent's data flow.
The math, joint impact ¶
rtk's published numbers per 30-min Claude Code session (rtk-ai/rtk README):
| Operation | Standard | rtk | Savings |
|---|---|---|---|
git family | 17,100 | 3,720 | -78% |
| Test runners | 39,000 | 3,900 | -90% |
| Lint / build | 6,000 | 1,200 | -80% |
| File reads / search | 56,000 | 15,200 | -73% |
| Total dev commands | ~118K | ~24K | -80% |
| Document Type | Original | Compressed | Savings |
|---|---|---|---|
| API docs | 7,200 | 1,440 | -80% |
| Source code (500 lines) | 4,200 | 1,260 | -70% |
| Large codebase (50 files) | 48,000 | 7,200 | -85% |
Setup: 90 seconds for both ¶
rtk
``bash
brew install rtk # or curl install: see rtk-ai.app
rtk init -g # installs Claude Code hook
# restart Claude Code
`
That's it. Your next git status will route through rtk transparently. The hook only fires on Bash tool calls. Read, Grep, Glob builtins don't pass through, so call rtk read / rtk grep directly when you want them compressed.
gotcontext
Add to your Claude Code MCP config (~/.claude/claude_desktop_config.json):
`json
{
"mcpServers": {
"gotcontext": {
"url": "https://api.gotcontext.ai/mcp",
"headers": { "Authorization": "Bearer gc_live_YOUR_KEY" }
}
}
}
`
Get a key at gotcontext.ai/sign-up. Free tier covers 1,000 compressions/month, no card required.
Why we're recommending a "competitor" ¶
rtk and gotcontext sit at different layers of the agent's stack. rtk's hook intercepts the Bash tool; gotcontext serves MCP tools. We can't compress your git status from the API side because we never see it. rtk can't compress your 200KB design doc because it doesn't have a semantic graph engine.
The token-savings space is big enough that two products can serve it without bumping. The thing that hurts users is choosing one and missing the other half. So: install both.
Operational notes ¶
writes hooks to your Claude Code config. Inspect ~/.claude/settings.json` after install if you want to see exactly what changed.TL;DR ¶
Cite this¶
Researchers, analysts, or journalists referencing this post can use either format below — both are copyable.
@misc{rtk-companion-token-savings-2026,
title = {gotcontext + rtk: stack two compression layers, kill 90%+ of your token bill},
author = {James Hollingsworth},
year = {2026},
month = {May},
url = {https://www.gotcontext.ai/blog/rtk-companion-token-savings},
note = {gotcontext.ai engineering blog.},
}James Hollingsworth. (2026, May 8). gotcontext + rtk: stack two compression layers, kill 90%+ of your token bill. gotcontext.ai. Retrieved from https://www.gotcontext.ai/blog/rtk-companion-token-savings.