Coding Agent Cost Controls
A forkable setup for reducing coding-agent cost by shaping environment output, repo maps, model routing, cache stability, and task-level budgets.
- Buildability
- B2 engineer-repeatable
- Status
- candidate
- Time
- Half day for a narrow repo
- Cost
- Low setup cost; savings depend on workflow volume
- Human approval
- Local config and scripts only until explicitly deployed
- Last verified
- Aug 15, 2026
Can I build this?
- Code level
- Developer or technical operator
- Data touched
- Repository metadata, command output, logs
- Write actions
- Local config and scripts only until explicitly deployed
- Sources
- 2 public receipts
System map
- Human
- Defines scope, approves write actions, reviews output.
- Agent
- Plans, edits, verifies, and reports with evidence.
- Data
- Repository metadata, command output, logs
- Actions
- Local config and scripts only until explicitly deployed
What has to reproduce
The route contains proof, handoff, permissions, source URLs, and agent-readable routes for this project.
- Verification
- locally reproduced
- Outputs
- 6 fixtures
- Replay
- 2 receipts
- Axes
- 7 assessed
Fixture outputs
- Built project JSON
dist/projects/coding-agent-cost-controls.jsonThe route contains proof, handoff, permissions, source URLs, and agent-readable routes for this project.
Open route - Agent acceptance checklist
dist/projects/coding-agent-cost-controls/acceptance.mdThe checklist repeats required checks, provider scopes, reproduction commands, and failure conditions.
Open route - Build brief handoff
dist/projects/coding-agent-cost-controls/build-brief.mdThe build brief can be handed to another agent without private context or hidden source dependencies.
Open route - Clean-room replay fixture
scripts/project-proof-depth-v2-fixture-test.mjsThe fixture replays the bounded log-trimming task in a temporary directory, proves that the initial implementation hides the failure and warning lines, proves the final pass, and verifies that an unrelated file is unchanged.
- Independent replay kit
scripts/project-proof-independent-replay-kit.mjsThe kit starts with a trim function that hides failures, exposes no ready solution, protects every out-of-scope file by checksum, and refuses to emit a receipt without a non-author attestation and a passing final check.
- Independent agent replay receipt
src/data/project-proof-receipts/coding-agent-cost-controls-independent-agent-v1.jsonA separately spawned agent received only the isolated kit, observed the hidden-failure regression, changed only src/trim-log.mjs, passed the final check, and produced an attestation that the primary verifier accepted.
Open route
Replay commands
npm run project-proof:replay:testnpm run project-proof:replay:prepare -- --project=coding-agent-cost-controlsnpm run validate:contentnpm run buildnpm run validate:agent-indexes
Provider scopes
- Local repositorywrite
Selected repo-map, wrapper-script, or agent-config files only.
The cost boundary is enforced by local configuration and deterministic command output shaping.
Human names the repository and approves the exact files before edits.
- Git remotenone
No remote write access is required for the first proof pass.
The project proves local cost controls before any commit, push, or deploy.
Commit, push, or deploy require a separate explicit owner command.
Seven-axis Buildability
non author replayed · 2026-08-15
- timehigh
- The clean-room log-trimming task reaches a checked result in one bounded local run, while the public blueprint targets a half day for one narrow repository.
- BottleneckReal before/after cost measurement still needs repeated agent runs on the chosen repository.
- code burdenmedium
- The replay needs one focused filter edit plus the existing test, and the public blueprint needs only repo maps, wrapper scripts, and config rather than a bespoke application.
- BottleneckA nontechnical owner still needs an agent or engineer to identify which output paths are noisy but safe to trim.
- integration burdenmedium
- The replay uses only Node, a test runner, and one deterministic filter function with no external service.
- BottleneckEach target repository needs its own noisy-output inventory and repo-specific hooks before the controls transfer.
- operational burdenhigh
- The first proof is local and temporary, requires no server, and deletes no shared or production state.
- BottleneckContinuous cost monitoring across many repositories would need scheduled measurement and log-retention rules.
- permission clarityhigh
- Read and local-write scopes are named separately, the Git remote scope is explicitly none for the first pass, and commit, push, and deploy stay behind a separate owner command.
- BottleneckDeploying trimmed-output wrappers into shared CI would reopen the approval question.
- reproducibilityhigh
- A separately spawned agent received only the isolated public kit, reproduced the initial check where the trim function hid the failure and warning lines, changed the one allowed filter file, and passed the same acceptance check without inspecting the author solution.
- BottleneckA replay on a real noisy repository with token measurements would strengthen the savings claim beyond this bounded fixture.
- failure recoveryhigh
- The replay records the initial failing check, preserves an unrelated file byte-for-byte, performs no remote action, and leaves explicit residual-risk and approval sections.
- BottleneckRestoring hidden diagnostics inside a production agent pipeline is outside this local proof.
Replay evidence
Bounded receipts, with limitations kept visible.
automated clean room · 2026-08-15
npm run project-proof:replay:test- This replay proves the deterministic diagnostic-preserving output contract, not a real external repository integration or measured token savings.
- No human or separately operated agent independently interpreted the brief in this clean-room replay.
independent agent · 2026-08-15
node --test test/trim-log.test.mjs- This proves a bounded non-author replay of the public workflow contract, not integration into a production repository.
- Reviewer identity is a local agent attestation and is not cryptographically verified.
- This proof does not claim universal token savings; it requires a selected repository and repeated task type.
- A lower output volume is not success unless the same correctness checks still fail or pass with useful diagnostics.
- Provider-side billing dashboards are outside the public proof route and must remain private.
- The bounded replay proves the diagnostic-preserving output contract, not measured token savings on a real repository; savings claims still need a per-repository before/after measurement.
- The independent replay proves the bounded public workflow contract, not integration into a real external or production repository.
- The independent reviewer identity is a local agent attestation and is not cryptographically verified.
Fork with an agent
Use the build brief for execution context, the acceptance checklist for verification, and the JSON route for structured constraints.
Minimal build
Start with one repo and three controls: trimmed test output, a cheap repo map before full file reads, and stable agent instructions that do not change on each run.
Failure mode
Cost controls can become harmful if they hide compiler warnings, failing tests, or relevant files. Measure completed task cost, not only token count.