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

Outcome demo

Reduce cost per completed coding task without relying on every prompt to say 'read less'. Wow moment: The agent sees smaller logs, targeted repo context, and stable rules before the expensive model call happens. Current bottleneck: Needs repo-specific hooks and enough measurement to avoid hiding useful diagnostics. This New Runtime record is an evidence-linked retrieval unit.

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
Proof / reproducibility

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 JSONdist/projects/coding-agent-cost-controls.json

    The route contains proof, handoff, permissions, source URLs, and agent-readable routes for this project.

    Open route
  • Agent acceptance checklistdist/projects/coding-agent-cost-controls/acceptance.md

    The checklist repeats required checks, provider scopes, reproduction commands, and failure conditions.

    Open route
  • Build brief handoffdist/projects/coding-agent-cost-controls/build-brief.md

    The build brief can be handed to another agent without private context or hidden source dependencies.

    Open route
  • Clean-room replay fixturescripts/project-proof-depth-v2-fixture-test.mjs

    The 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 kitscripts/project-proof-independent-replay-kit.mjs

    The 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 receiptsrc/data/project-proof-receipts/coding-agent-cost-controls-independent-agent-v1.json

    A 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

  1. npm run project-proof:replay:test
  2. npm run project-proof:replay:prepare -- --project=coding-agent-cost-controls
  3. npm run validate:content
  4. npm run build
  5. npm 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.

clean-room-bounded-edit-v1passed

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-claude-replay-v1passed

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.
Known limits
  • 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.

Discovery graph / next reads

Continue through New Runtime

Open the graph
  1. 01related materialModel API -> compute-backed product contractShift this project is designed to test.
  2. 02related materialCoding Agent Cost Is Cut in Environment Config, Not PromptsField Note supplying context for this project.
  3. 03related materialAnthropic Cuts Limits and Rents Compute from MetaField Note supplying context for this project.
  4. 04topicCoding agents - New RuntimeExplore the coding agents topic hub.
  5. 05related materialVerifiable AI Coding WorkflowShares coding agents.

These links are also published in this page’s JSON twin and as typed edges in DiscoveryGraph v1.

Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate…

Open the JSON contract