r/google_antigravity • u/FantasticYoung3109 • 2d ago
Showcase / Project Keeping coding agents’ context useful: bounded tool output, exact retrieval and LSP navigation
Code execution can fill a coding agent’s context with test logs, tool results and repeated source reads. Much of that material stays in the conversation long after the agent has extracted what it needs.
I maintain Straitjacket, a context-management and code-exploration toolkit exposed through the ctx CLI and MCP.
For work routed through it, the workflow is:
- Capture locally. Keep captured material on disk and return a bounded digest to the agent.
- Retrieve precisely. Search retained artifacts and fetch exact line ranges when the digest is insufficient.
- Explore with structure. Use indexed source search and LSP-backed definitions, references and diagnostics where a language server is configured.
- Keep stable material stable. Separate fixed reference prefixes from changing questions and evidence when constructing prompts.
The goal is fewer avoidable exploration turns and more useful work between compactions, while keeping the underlying evidence available.
If you’ve used Headroom, Maki or RTK, the problem will be familiar. Headroom offers compression, original-content retrieval and cache-aware modes. Maki builds efficient exploration and tool execution into its own coding agent. Straitjacket brings capture, retrieval and source navigation together for existing agent workflows.
There is a reproducible offline example: a 302,628-token log becomes a 531-token canonical digest, measured with o200k_base, while retaining a quiet anomaly and allowing exact retrieval of omitted lines. That run made zero model calls; it measures the representation, not billing savings or coding success.
For agy, Codex, DSH and OpenCode users: what fills your context first—build logs, repeated file reads, large tool responses or exploration that goes nowhere?
I’d like small repros where a shorter digest would help, especially cases where the agent must recover omitted evidence to finish correctly.
Repository · Offline fixture and reproduction
1
u/FantasticYoung3109 2d ago
How does Straitjacket compare with Headroom, Maki, RTK and OpenCode DCP?
I maintain Straitjacket. These projects overlap, so I think the useful comparison is where they operate and what workflow you want to keep.
Project
Where it fits
Headroom
Context optimization through libraries, a proxy and agent integrations. It compresses content, retains originals for retrieval, and offers a cache-preserving mode. It is the closest reference point for compression plus recoverable evidence.
Maki
A complete coding agent that controls its own execution loop. It combines tree-sitter indexing, targeted reads, code execution that filters intermediate results, and stable session prompts.
RTK
Command-aware filtering of shell output. Its current development documentation also describes recovering failed or truncated output through rtk recall.
OpenCode DCP
Management of accumulated conversation context inside OpenCode: selective compression, deduplication and cleanup before requests reach the model. Stored session history remains intact.
Straitjacket
A CLI/MCP toolkit combining local capture, bounded digests, exact retrieval of retained evidence, indexed and LSP-backed exploration, and explicit cache-prefix construction.
My reason for building Straitjacket is to make that combination available within the coding workflows people already use.
The interesting question is whether it helps an agent finish a real change with less unnecessary context and exploration. That needs a matched evaluation: the same task, model, settings and success criteria, with retrieval calls, cache reads/writes, latency and total cost included.
A smaller digest is useful evidence about context size. Whether it improves task success, reduces total turns or lowers the bill is a separate measurement.