AI Coding Agents: Capability Limits and Cost Governance from a 10-Million-Token Practice
Drawing on a usage record exceeding 10 million tokens, this article examines how AI coding agents move from generating code to delivering verifiable engineering tasks. It covers requirements planning, long-running execution, reasoning failures, context caching, and evaluation methods, with practical guidance on permission boundaries and measuring cost per successfully delivered task.
1. From Generating Code to Delivering Tasks
A common mistake when evaluating AI coding is to treat the completeness of a single response as evidence of engineering delivery capability. Generating a plausible program does not necessarily mean a model can understand an existing codebase, handle environment failures, maintain data consistency, or preserve the original requirements through multiple rounds of changes.
The source account describes usage totaling more than 10 million tokens, including a coding task that ran for nearly an hour with little human intervention. These observations offer useful insights, but they are not standardized performance results. Token consumption is not equivalent to effective test coverage, and uninterrupted execution time is not equivalent to delivery quality.
The more useful question is therefore not how powerful a particular model is, but under what conditions an AI coding system can keep making progress—and how a team should verify its results.
From an engineering perspective, the experience points to three encouraging signals and one important warning:
- Autonomous planning is moving beyond written proposals toward executable engineering steps.
- Long-running execution can connect coding, running, checking, and fixing, rather than merely producing code continuously.
- Reusing repeated context creates opportunities for cost optimization, although the actual savings depend on billing rules and cache hits.
- Strong performance on complex tasks does not guarantee reliability on simple ones. Misunderstood premises, unproductive reasoning loops, and inadequate verification can still cause obvious mistakes.
2. First Positive Signal: Planning Is Becoming More Like an Engineering Workflow
Consider a bookkeeping application. A user might provide only one sentence: “Build a system that supports income and expense records and reporting.”
That is not enough to guide reliable delivery. The system must at least define record ownership, amount validation, category management, time conventions, and how data changes should behave. If an agent immediately starts building pages, poor data structures can lead to repeated rework later.
Establish Requirements Boundaries Before Adding Features
A useful plan separates requirements into three layers:
- Core functionality: Create, retrieve, update, and delete income and expense records.
- Consistency constraints: Valid amounts and categories, clear record ownership, and consistent reporting rules.
- Operational requirements: Persistent storage, traceable errors, and verifiable critical operations.
When information is missing, the agent can ask clarifying questions or, for low-risk decisions, adopt explicitly stated assumptions. A single-user prototype, for example, may omit a complex permissions system. That simplification must not be treated as suitable for a multi-user production environment by default.
The value of planning is not the length of the proposal. It is the ability to identify decisions that will shape the implementation.
Make the Data Model Enforce Business Constraints
In a bookkeeping system, binary floating-point numbers should not be used directly for exact monetary calculations. Common approaches include fixed-point decimal values or storing amounts in the smallest currency unit. If multiple currencies are supported, the currency must be recorded separately; amounts in different currencies cannot simply be added together.
Deleting a category is also more than deleting a database row. For categories already referenced by transactions, the system needs a policy such as blocking deletion, soft deletion, or reassignment. The appropriate choice depends on business requirements, but it must avoid leaving historical records that can no longer be meaningfully interpreted.
Reporting requires similarly explicit decisions: should totals use the transaction date or the record creation date, and which time zone determines daily boundaries? Without these rules, the interface may appear correct while monthly totals or cross-time-zone usage produce inconsistent results.
Turn Development Plans into Acceptance Criteria
“Implement the reporting page” is not a sufficient acceptance criterion. A better description is:
After an expense is added for a specified date, the expense total for that month must increase according to the defined reporting rules. Updating the amount or deleting the record must update the total accordingly.
This statement connects data writes, query logic, and displayed results. It also provides a basis for automated tests.
The source account mentions module decomposition, database table design, and verification checklists. The transferable lesson is to make planning, implementation, and acceptance share the same business rules—not to treat a particular number of modules or tables as a best practice.
3. Second Positive Signal: Long-Running Execution Can Form a Closed Loop
The challenge in sustained coding is not simply running for a long time. It is managing a task whose state keeps changing. Modifying one file may break dependent components. A failed test may indicate a logic error or an environment problem.
Effective agent execution typically follows this loop:
Understand the current state → choose the next step → invoke a tool → read the result → update the assessment → verify or repair.
Tool Calls Must Produce Observable Evidence
An agent can use controlled tools to read files, edit code, run builds, and execute tests. But a successful tool call is not the same as a successful task.
Starting a test process proves only that the tool can run. Passing all tests shows that the behaviors covered by the current test suite meet its expectations. Whether the application satisfies the business requirements still depends on whether those tests are sufficient.
Execution records should therefore retain:
- The purpose of each operation.
- The files or configuration actually changed.
- Tool exit status and relevant output.
- Identified problems and supporting evidence.
- Assumptions that remain unverified.
These records help the agent continue working and allow developers to review the process afterward.
Long Tasks Need External State Management
Relying only on an ever-growing conversation history can lead to forgotten requirements, repeated work, and excessive context size. A more reliable approach is to maintain a concise task document that records:
What is complete, what is currently blocked, which constraints must remain unchanged, and how the next step will be accepted.
A summary such as “backend development complete” is too vague. “Amounts are stored in the smallest currency unit, and deleting a category does not delete historical transactions” preserves decisions that matter.
These records reduce recovery costs when a task is paused, transferred to another execution instance, or resumed with reloaded context. Summaries can still omit important information, so they should remain traceable to requirements, code changes, and test results.
Autonomous Execution Does Not Mean Unlimited Authority
Reducing frequent human intervention does not justify unrestricted permissions.
Long-running coding tasks should execute in isolated environments with limits on file access, network connections, and credential use. High-risk actions—such as deleting data, changing production configuration, or deploying a release—need explicit approval checkpoints.
Execution should also have tool-call budgets, time limits, and stopping conditions. If repeated changes fail to improve the same failing result, the agent should stop and provide a diagnosis rather than retry indefinitely.
4. An Unexpected Risk: More Reasoning Does Not Always Produce Better Answers
Failures on simple tasks often reflect a misunderstood objective or repeated reasoning based on unnecessary assumptions, rather than a lack of knowledge.
For example, if a user asks whether to drive to a nearby car wash, the essential constraint is that the vehicle must be there. A model that focuses only on walking distance, parking convenience, or environmental considerations may miss the condition required to complete the task. Longer reasoning cannot substitute for checking the premise.
Repeated attempts at a difficult mathematics problem can show a similar pattern: the model keeps producing new arguments without recognizing that an earlier step is invalid.
Check the Goal and Necessary Conditions First
Before detailed reasoning, the system can briefly identify:
- What the user ultimately wants to accomplish.
- Which conditions are necessary to accomplish it.
- Which facts are provided and which are assumptions.
- Whether any constraint directly determines the answer.
This check should remain short. It should not turn a simple question into another lengthy analysis.
Allocate Reasoning Budgets According to Task Risk
Different tasks should not all use the same workflow.
Text cleanup, format conversion, and classification under clear rules may need direct processing with lightweight validation. Cross-module code changes, data migrations, and permission design require more planning and verification.
When the budget increases, teams should check whether outcomes improve. If the failure rate stays the same while responses become longer and execution takes more time, the strategy needs adjustment—not simply more reasoning.
Add an Exit Mechanism for Error Loops
An illustrative rule is:
When the same failure recurs:Save the failure evidenceCheck whether new diagnostic information is availableIf no new information is available:Stop repeated modificationsReport ruled-out causes, remaining hypotheses,and required human inputOtherwise:Choose a verifiable fixApply it and rerun the test
The principle is to base retries on new evidence, rather than changes in wording or repetitions of similar operations.
5. Third Positive Signal: Costs Can Be Optimized, but Must Be Measured Against Successful Delivery
At large token volumes, models repeatedly read project instructions, tool descriptions, code excerpts, and previous execution results. If the runtime supports context caching, some repeated input may be processed at a lower cost.
Caching is not identical across environments, however. Cacheable content, retention periods, invalidation conditions, and billing rules must be checked against the actual service terms. The existence of caching alone does not establish that the bill will be lower.
Separate the Cost Components
A general cost model is:
Total cost = uncached input cost + cached input cost + output cost + tool and runtime cost.
If a service separately meters reasoning consumption, that consumption should be included according to its actual billing rules, without omission or double counting.
Human review, failed retries, and corrective work may not appear on an API bill, but they are still part of the real delivery cost.
Keep Stable Context Stable
Project conventions, permission boundaries, and fixed tool instructions are good candidates for stable context. Expanding logs, temporary debugging output, and obsolete code excerpts should not be appended indefinitely to later inputs.
Practical approaches include:
- Organizing fixed instructions separately from current task information.
- Providing only the code relevant to the current change.
- Reducing lengthy logs to error locations, surrounding context, and necessary evidence.
- Summarizing and archiving completed phases.
- Avoiding unnecessary changes to stable content that could invalidate the cache.
Context compression should not go too far. Rework caused by removing a critical constraint can cost more than the extra input tokens needed to preserve it.
Measure Cost per Successfully Accepted Task
A more useful metric than price per million tokens is the cost of completing an acceptable task.
Dividing total expenditure during a reporting period by the number of tasks that pass acceptance gives an average cost per successful task. This metric must be reported alongside task type, difficulty, and quality requirements. Simple page generation and complex codebase changes should not be treated as equivalent.
A lower per-call price does not necessarily produce a lower total cost. A higher per-call price does not automatically produce better delivery efficiency either. Success rate, retry count, and the extent of human takeover are what matter.
6. Designing a Credible AI Coding Evaluation
The interface demonstration and a successful record-creation operation described in the source account show that some functionality works. They do not establish the reliability of the complete system. A fuller evaluation should cover at least four areas.
Functionality and Business Consistency
Check whether create, update, delete, and query operations meet the requirements. Pay particular attention to invalid input, empty datasets, duplicate submissions, and category changes.
For a bookkeeping application, verify consistency between individual records and aggregate reports. A successful interaction on one page must not conceal incorrect summary logic.
Maintainability
Look for duplicate implementations, hidden configuration, unhandled exceptions, and missing documentation. Confirm that the project can start in a clean environment using the documented instructions, rather than only in the environment where the agent developed it.
Stability and Recovery
Use different task formulations and multiple independent runs to observe outcomes. Record failure types rather than reporting only the best result.
In a safe test environment, simulate unavailable dependencies, test failures, and data anomalies. Check whether the agent identifies the problem, preserves task state, and exits appropriately.
Security and Operational Boundaries
Check for sensitive-information exposure, unauthorized operations, and bypassed approvals. Security must not depend solely on the model claiming that it acted safely. Tool permissions, environment isolation, and audit mechanisms must enforce the boundaries.
Evaluation reports should state task conditions, budget limits, human intervention, and acceptance criteria. Only with that context do execution duration, token usage, and completion rates become meaningful.
7. Practical Adoption: Put Autonomy Inside a Controlled Workflow
Teams adopting AI coding systems can begin with low-risk tasks that support automated acceptance, such as adding tests, fixing localized defects, or implementing clearly specified data-processing logic. They can then expand gradually into cross-module development.
Before each task, define the requirements boundary and success criteria. During execution, retain task state, tool evidence, and resource usage. At completion, use independent tests for acceptance rather than relying on the agent’s declaration that the work is finished.
For high-risk tasks, place human approval at points that materially affect data or environments, instead of requiring developers to watch every code-generation step. This preserves the efficiency of autonomous execution while controlling operational risk.
The central lesson from practice at the 10-million-token scale is not that consuming more tokens proves greater capability. It is that an engineering feedback loop determines the value of autonomy. Planning turns requirements into tasks; verification turns results into evidence; permission controls constrain risk; and cost governance establishes whether the investment is worthwhile. All four are necessary for AI coding to move from demonstrations to dependable delivery.
