A test run can produce hundreds of thousands of tokens. The agent may need one traceback. Keeping the complete log in the conversation makes every later decision carry the cost of an earlier command.

Straitjacket keeps the output in an artifact store and gives the agent a bounded view with addresses for retrieving the rest.

Keep the evidence available

ctx run -- pytest -q captures stdout and stderr. A deterministic profile extracts outcomes, failed test identities, locations, and relevant spans. The result declares omissions and provides a continuation.

The agent can search the captured output or retrieve a cited region. The full bytes remain available while the artifact is retained. The digest path does not call another model.

This is a sidecar for the coding harness. Claude Code, Codex, and Antigravity keep their own interfaces, model loops, logins, and permissions.

Context economics includes overhead

Containment has a cost: startup, capture, storage, extraction, and retrieval. A short command with a small result may be cheaper to run directly.

That boundary is why I used AlphaEvolve to search containment policies. The reviewed policy lets narrowly identified small commands take the fast path, keeps the output gate active, and withdraws that fast path when an unexpected flood appears.

On the measured named-test path, median latency fell 20.15% and tool-result bytes fell 46.67%. Those figures describe that path. Task success, total usage, retrieval count, and elapsed time still need to be measured together.

Read the LinkedIn post

Continue from recorded work

The optional edit workflow ties observed source to anchored edits and verification receipts. Task execution adds persisted state, recovery, and shared budget records.

The task ledger stores typed claims, handbacks, verdicts, and inbox records. Results travel as evidence addresses. A resumed investigation can inspect what was attempted and why it stopped.

Start with one noisy command

Capture a real build or test run. Retrieve the evidence behind the digest. Then compare the complete task with your native workflow. The repository publishes negative results alongside the wins; compression alone does not establish a better coding outcome.

Repository and quickstart · How it works · Evaluation evidence · Task ledger

Vamsi Ramakrishnan