blog

June 17, 2026

Why AI coding gets expensive when context is badly prepared

AI coding gets expensive when the model is asked to make up for unclear work. A vague task usually leads to more prompting, more correction, longer review, and more code that a senior developer has to inspect before it can safely move anywhere near production.


For software teams, token consumption should be evaluated together with task preparation. A high token bill may reflect meaningful AI usage, but it may also point to weak task definition, missing constraints, broad context dumps, and repeated attempts to get usable output from an instruction that was too loose at the start.



High AI usage is not the same as useful output


A high volume of AI usage can look productive from the outside.

Developers are prompting often, draft code appears quickly, and the team can point to visible AI activity across the development process.

The more useful question is how much of that output survives review and reaches production without avoidable rework.


If AI generates three possible implementations and two are discarded, the discarded tokens are only the most visible part of the waste. The larger cost sits in the time spent reading, judging, correcting, and reconciling those outputs with the actual system.


When the model misunderstands the permission model, uses a pattern the team no longer wants, ignores an edge case, or changes logic that should have remained stable, a senior developer has to bring the work back to a safe path.


This is where badly prepared context becomes expensive. The team does not only pay for generation, but also for every extra loop between generated code and accepted code.



The model can read code, but it does not know what matters


A mature codebase contains a lot of information, but not all of it has the same value. Some files show current architectural patterns, some preserve older decisions that should no longer be copied, some contain business rules that are enforced indirectly, and some represent edge cases that are obvious only to the team that has handled production incidents, customer requests, integration failures, and operational exceptions.


An AI coding tool does not automatically know which of those details carry weight. It may see a controller, a service class, a method, or a test, but it does not know by default whether that pattern is preferred, outdated, tolerated, or risky. It can infer a plausible implementation from the surrounding code, but plausible code is not always production-fit code.


This is why generic prompts often produce work that looks useful at first glance and becomes expensive during review. The output may compile and follow a visible pattern while still missing the business rule that matters most.


Good context preparation reduces this ambiguity before generation starts. It tells the model which files are relevant, which existing pattern should be followed, what must remain untouched, which edge cases matter, and how the result will be judged.



More context is often a weak substitute for better context


One common reaction to poor AI output is to add more material. When the model gives a weak answer, the developer sends more files, more logs, more documentation, more examples, and more background explanation, hoping that a larger context window will produce a better result.


Sometimes that helps. In many cases, it only gives the model more material to misread.


Large context can dilute the signal because mature systems contain old patterns, naming inconsistencies, partial migrations, deprecated approaches, and implementation details that should not influence the current change. Not every visible pattern is a pattern worth repeating.


A better approach is to prepare a smaller context package with higher information density. Instead of asking AI to inspect half the repository and discover the task, the developer should frame the work in engineering terms.


The instruction should make clear what needs to change, where the change belongs, which current implementation should be used as reference, which constraints are non-negotiable, which tests should pass, and which parts of the system should not be changed.


This is one reason senior developers tend to get better output from the same tools. They know which context is relevant, which context is distracting, and which assumptions must be blocked before the model starts producing code.


Reusable AI coding brief for mature codebases


The following brief can be copied into an AI coding workflow, internal developer guide, or pull request preparation checklist.


Before asking AI to write code, prepare the task like this


1. State the exact engineering task

Weak version
“Add CSV export.”


Better version
“Add CSV export to the invoice list so users can export the currently filtered invoice results from the existing invoice overview page.”


2. Name the relevant files, modules, or services

Example
“Work in InvoiceController, InvoiceExportService, and the existing invoice list view. Use CustomerExportService only as a reference for export formatting.”


3. Point to the pattern that should be followed

Example
“Follow the export pattern used in CustomerExportService, including file naming, delimiter handling, and response headers.”


4. Define what must not change

Example
“Do not change the invoice query logic, permission checks, filtering behaviour, database schema, or existing API response format.”


5. Add business rules and edge cases

Example
“The export must include only invoices the current user is allowed to see, must respect active filters, must handle empty results, and must preserve special characters in customer names.”


6. Specify the acceptance criteria

Example
“The task is complete when the export works for filtered and unfiltered invoice lists, permission rules are unchanged, existing invoice tests pass, and new tests cover empty results, special characters, and unauthorized access.”


7. Ask for the smallest safe change

Example
“Make the smallest change that satisfies the acceptance criteria. Do not refactor unrelated code.”


8. Require an implementation summary

Example
After the implementation, summarize the changed files, the reason for each change, and any assumptions made.”


This structure does not slow the work down in practice. It reduces the number of unnecessary loops between the first answer and a reviewable change.



Good context lowers token cost and review cost


A well-prepared task usually consumes fewer tokens because the model has less irrelevant material to process and fewer chances to move in the wrong direction. More importantly, it reduces review cost because the output is easier to judge against clear boundaries.


The reviewer can compare the result against the task, the named files, the stated constraints, and the acceptance criteria. If the model changes something outside that frame, the issue is visible. If it misses an edge case, the omission is clear. If it follows an outdated pattern, the reference pattern makes the mistake easier to catch.


This has a direct impact on cost per accepted change. A team should care less about how much code AI can produce and more about how much accepted, tested, maintainable code it helps deliver. The same token spend can have very different value depending on how much of the output is merged and how much senior time is needed to make it safe.



What this means for teams using AI in development


For teams already using AI in development, the useful question is not whether developers can generate code faster, but whether that code reaches production with less rework, lower review effort, and controlled token spend.


At Blocshop, we use AI inside a senior-led development process where tasks are prepared carefully, context is kept tight, and output is measured by accepted changes rather than generated code. I


f you want to understand whether AI is improving delivery in your team or mainly adding hidden cost, we can help you assess the process around it.

blog

June 17, 2026

Why AI coding gets expensive when context is badly prepared

AI coding gets expensive when the model is asked to make up for unclear work. A vague task usually leads to more prompting, more correction, longer review, and more code that a senior developer has to inspect before it can safely move anywhere near production.


For software teams, token consumption should be evaluated together with task preparation. A high token bill may reflect meaningful AI usage, but it may also point to weak task definition, missing constraints, broad context dumps, and repeated attempts to get usable output from an instruction that was too loose at the start.



High AI usage is not the same as useful output


A high volume of AI usage can look productive from the outside.

Developers are prompting often, draft code appears quickly, and the team can point to visible AI activity across the development process.

The more useful question is how much of that output survives review and reaches production without avoidable rework.


If AI generates three possible implementations and two are discarded, the discarded tokens are only the most visible part of the waste. The larger cost sits in the time spent reading, judging, correcting, and reconciling those outputs with the actual system.


When the model misunderstands the permission model, uses a pattern the team no longer wants, ignores an edge case, or changes logic that should have remained stable, a senior developer has to bring the work back to a safe path.


This is where badly prepared context becomes expensive. The team does not only pay for generation, but also for every extra loop between generated code and accepted code.



The model can read code, but it does not know what matters


A mature codebase contains a lot of information, but not all of it has the same value. Some files show current architectural patterns, some preserve older decisions that should no longer be copied, some contain business rules that are enforced indirectly, and some represent edge cases that are obvious only to the team that has handled production incidents, customer requests, integration failures, and operational exceptions.


An AI coding tool does not automatically know which of those details carry weight. It may see a controller, a service class, a method, or a test, but it does not know by default whether that pattern is preferred, outdated, tolerated, or risky. It can infer a plausible implementation from the surrounding code, but plausible code is not always production-fit code.


This is why generic prompts often produce work that looks useful at first glance and becomes expensive during review. The output may compile and follow a visible pattern while still missing the business rule that matters most.


Good context preparation reduces this ambiguity before generation starts. It tells the model which files are relevant, which existing pattern should be followed, what must remain untouched, which edge cases matter, and how the result will be judged.



More context is often a weak substitute for better context


One common reaction to poor AI output is to add more material. When the model gives a weak answer, the developer sends more files, more logs, more documentation, more examples, and more background explanation, hoping that a larger context window will produce a better result.


Sometimes that helps. In many cases, it only gives the model more material to misread.


Large context can dilute the signal because mature systems contain old patterns, naming inconsistencies, partial migrations, deprecated approaches, and implementation details that should not influence the current change. Not every visible pattern is a pattern worth repeating.


A better approach is to prepare a smaller context package with higher information density. Instead of asking AI to inspect half the repository and discover the task, the developer should frame the work in engineering terms.


The instruction should make clear what needs to change, where the change belongs, which current implementation should be used as reference, which constraints are non-negotiable, which tests should pass, and which parts of the system should not be changed.


This is one reason senior developers tend to get better output from the same tools. They know which context is relevant, which context is distracting, and which assumptions must be blocked before the model starts producing code.


Reusable AI coding brief for mature codebases


The following brief can be copied into an AI coding workflow, internal developer guide, or pull request preparation checklist.


Before asking AI to write code, prepare the task like this


1. State the exact engineering task

Weak version
“Add CSV export.”


Better version
“Add CSV export to the invoice list so users can export the currently filtered invoice results from the existing invoice overview page.”


2. Name the relevant files, modules, or services

Example
“Work in InvoiceController, InvoiceExportService, and the existing invoice list view. Use CustomerExportService only as a reference for export formatting.”


3. Point to the pattern that should be followed

Example
“Follow the export pattern used in CustomerExportService, including file naming, delimiter handling, and response headers.”


4. Define what must not change

Example
“Do not change the invoice query logic, permission checks, filtering behaviour, database schema, or existing API response format.”


5. Add business rules and edge cases

Example
“The export must include only invoices the current user is allowed to see, must respect active filters, must handle empty results, and must preserve special characters in customer names.”


6. Specify the acceptance criteria

Example
“The task is complete when the export works for filtered and unfiltered invoice lists, permission rules are unchanged, existing invoice tests pass, and new tests cover empty results, special characters, and unauthorized access.”


7. Ask for the smallest safe change

Example
“Make the smallest change that satisfies the acceptance criteria. Do not refactor unrelated code.”


8. Require an implementation summary

Example
After the implementation, summarize the changed files, the reason for each change, and any assumptions made.”


This structure does not slow the work down in practice. It reduces the number of unnecessary loops between the first answer and a reviewable change.



Good context lowers token cost and review cost


A well-prepared task usually consumes fewer tokens because the model has less irrelevant material to process and fewer chances to move in the wrong direction. More importantly, it reduces review cost because the output is easier to judge against clear boundaries.


The reviewer can compare the result against the task, the named files, the stated constraints, and the acceptance criteria. If the model changes something outside that frame, the issue is visible. If it misses an edge case, the omission is clear. If it follows an outdated pattern, the reference pattern makes the mistake easier to catch.


This has a direct impact on cost per accepted change. A team should care less about how much code AI can produce and more about how much accepted, tested, maintainable code it helps deliver. The same token spend can have very different value depending on how much of the output is merged and how much senior time is needed to make it safe.



What this means for teams using AI in development


For teams already using AI in development, the useful question is not whether developers can generate code faster, but whether that code reaches production with less rework, lower review effort, and controlled token spend.


At Blocshop, we use AI inside a senior-led development process where tasks are prepared carefully, context is kept tight, and output is measured by accepted changes rather than generated code. I


f you want to understand whether AI is improving delivery in your team or mainly adding hidden cost, we can help you assess the process around it.

logo blocshop

Talk to sales

blog

June 17, 2026

Why AI coding gets expensive when context is badly prepared

AI coding gets expensive when the model is asked to make up for unclear work. A vague task usually leads to more prompting, more correction, longer review, and more code that a senior developer has to inspect before it can safely move anywhere near production.


For software teams, token consumption should be evaluated together with task preparation. A high token bill may reflect meaningful AI usage, but it may also point to weak task definition, missing constraints, broad context dumps, and repeated attempts to get usable output from an instruction that was too loose at the start.



High AI usage is not the same as useful output


A high volume of AI usage can look productive from the outside.

Developers are prompting often, draft code appears quickly, and the team can point to visible AI activity across the development process.

The more useful question is how much of that output survives review and reaches production without avoidable rework.


If AI generates three possible implementations and two are discarded, the discarded tokens are only the most visible part of the waste. The larger cost sits in the time spent reading, judging, correcting, and reconciling those outputs with the actual system.


When the model misunderstands the permission model, uses a pattern the team no longer wants, ignores an edge case, or changes logic that should have remained stable, a senior developer has to bring the work back to a safe path.


This is where badly prepared context becomes expensive. The team does not only pay for generation, but also for every extra loop between generated code and accepted code.



The model can read code, but it does not know what matters


A mature codebase contains a lot of information, but not all of it has the same value. Some files show current architectural patterns, some preserve older decisions that should no longer be copied, some contain business rules that are enforced indirectly, and some represent edge cases that are obvious only to the team that has handled production incidents, customer requests, integration failures, and operational exceptions.


An AI coding tool does not automatically know which of those details carry weight. It may see a controller, a service class, a method, or a test, but it does not know by default whether that pattern is preferred, outdated, tolerated, or risky. It can infer a plausible implementation from the surrounding code, but plausible code is not always production-fit code.


This is why generic prompts often produce work that looks useful at first glance and becomes expensive during review. The output may compile and follow a visible pattern while still missing the business rule that matters most.


Good context preparation reduces this ambiguity before generation starts. It tells the model which files are relevant, which existing pattern should be followed, what must remain untouched, which edge cases matter, and how the result will be judged.



More context is often a weak substitute for better context


One common reaction to poor AI output is to add more material. When the model gives a weak answer, the developer sends more files, more logs, more documentation, more examples, and more background explanation, hoping that a larger context window will produce a better result.


Sometimes that helps. In many cases, it only gives the model more material to misread.


Large context can dilute the signal because mature systems contain old patterns, naming inconsistencies, partial migrations, deprecated approaches, and implementation details that should not influence the current change. Not every visible pattern is a pattern worth repeating.


A better approach is to prepare a smaller context package with higher information density. Instead of asking AI to inspect half the repository and discover the task, the developer should frame the work in engineering terms.


The instruction should make clear what needs to change, where the change belongs, which current implementation should be used as reference, which constraints are non-negotiable, which tests should pass, and which parts of the system should not be changed.


This is one reason senior developers tend to get better output from the same tools. They know which context is relevant, which context is distracting, and which assumptions must be blocked before the model starts producing code.


Reusable AI coding brief for mature codebases


The following brief can be copied into an AI coding workflow, internal developer guide, or pull request preparation checklist.


Before asking AI to write code, prepare the task like this


1. State the exact engineering task

Weak version
“Add CSV export.”


Better version
“Add CSV export to the invoice list so users can export the currently filtered invoice results from the existing invoice overview page.”


2. Name the relevant files, modules, or services

Example
“Work in InvoiceController, InvoiceExportService, and the existing invoice list view. Use CustomerExportService only as a reference for export formatting.”


3. Point to the pattern that should be followed

Example
“Follow the export pattern used in CustomerExportService, including file naming, delimiter handling, and response headers.”


4. Define what must not change

Example
“Do not change the invoice query logic, permission checks, filtering behaviour, database schema, or existing API response format.”


5. Add business rules and edge cases

Example
“The export must include only invoices the current user is allowed to see, must respect active filters, must handle empty results, and must preserve special characters in customer names.”


6. Specify the acceptance criteria

Example
“The task is complete when the export works for filtered and unfiltered invoice lists, permission rules are unchanged, existing invoice tests pass, and new tests cover empty results, special characters, and unauthorized access.”


7. Ask for the smallest safe change

Example
“Make the smallest change that satisfies the acceptance criteria. Do not refactor unrelated code.”


8. Require an implementation summary

Example
After the implementation, summarize the changed files, the reason for each change, and any assumptions made.”


This structure does not slow the work down in practice. It reduces the number of unnecessary loops between the first answer and a reviewable change.



Good context lowers token cost and review cost


A well-prepared task usually consumes fewer tokens because the model has less irrelevant material to process and fewer chances to move in the wrong direction. More importantly, it reduces review cost because the output is easier to judge against clear boundaries.


The reviewer can compare the result against the task, the named files, the stated constraints, and the acceptance criteria. If the model changes something outside that frame, the issue is visible. If it misses an edge case, the omission is clear. If it follows an outdated pattern, the reference pattern makes the mistake easier to catch.


This has a direct impact on cost per accepted change. A team should care less about how much code AI can produce and more about how much accepted, tested, maintainable code it helps deliver. The same token spend can have very different value depending on how much of the output is merged and how much senior time is needed to make it safe.



What this means for teams using AI in development


For teams already using AI in development, the useful question is not whether developers can generate code faster, but whether that code reaches production with less rework, lower review effort, and controlled token spend.


At Blocshop, we use AI inside a senior-led development process where tasks are prepared carefully, context is kept tight, and output is measured by accepted changes rather than generated code. I


f you want to understand whether AI is improving delivery in your team or mainly adding hidden cost, we can help you assess the process around it.

logo blocshop