Why Agentic Coding Is Hard to Use and How to Fix It

    This article explains why capable LLMs still produce unreliable agentic coding experiences, using a common "add a captcha" failure scenario to illustrate the problem. It breaks down the root causes—error accumulation, weak context engineering, poor controllability, and missing observability—and presents a practical framework for making autonomous coding agents more dependable through context engineering, minimal-change constraints, sandboxing, observability, and clear human-oversight boundaries.

    1. The Problem: Capability Is Not the Same as Experience

    As agentic coding spreads rapidly, a common pattern has emerged: foundation models keep improving on benchmarks for code understanding, reasoning, and generation, yet the real-world reputation of model-driven autonomous coding agents is sharply divided. The most frequent developer feedback is that these tools “look impressive but are hard to control.”

    To analyze this rationally, it helps to separate two layers:

    • Model layer: the base capability for understanding requirements, logical reasoning, and code generation.
    • Agent platform layer: tool invocation, file reading and writing, command execution, context organization, task orchestration, and artifact management.

    A strong model does not automatically make a good agent product. What really determines the experience is whether the platform can reliably turn model capability into correct, minimal, and verifiable code changes. What separates the two is an engineering pipeline, not just parameter count.

    2. A Typical Failure: Why “Add a Captcha” Goes Off the Rails

    Consider one of the most common requests: add a captcha step to the login flow while preserving the existing authentication logic. The ideal execution path should be:

    1. Read the existing code and reconstruct the authentication flow.
    2. Locate the exact files and functions that need to change.
    3. Keep the change scope tight and avoid unrelated refactoring.
    4. Run tests to confirm existing functionality has not regressed.
    5. Produce a clear change description and diff summary.

    An agent that goes off the rails often does the opposite: it misreads the directory structure, expands the change surface, “optimizes” working code along the way, and declares completion without passing tests. Only during developer review do the regressions surface.

    At the pseudocode level, the difference looks like this:

    1. # Expected minimal change
    2. auth/login_flow -> add a verify_captcha(token) branch
    3. auth/session -> unchanged
    4. tests/ -> add captcha-related cases
    5. # Common runaway change
    6. auth/* -> large-scale refactor, naming cleanup, dependency upgrades
    7. tests/ -> deleted or skipped

    This is not unique to any single tool; it is a shared challenge of the current agent paradigm.

    3. Root Causes: Why Autonomy Amplifies the Cost of Errors

    3.1 Error accumulation

    A few wrong lines from code completion are almost instantly visible to the human eye. An agent, however, can execute dozens of steps in a row, and errors compound along the call chain until the result “looks done but is actually unusable.”

    3.2 Insufficient context engineering

    Project structure, dependencies, and historical decisions often exceed what the context window can hold. Without retrieval augmentation and layered summarization, the model can only guess the global picture from local information, sharply raising the chance of misjudgment.

    3.3 Weak controllability and rollback

    Without sandbox isolation, change snapshots, and one-click rollback, the cost of a single wrong execution is amplified across the entire workspace.

    3.4 Missing observability

    Without structured operation logs, diff views, and test reports, developers struggle to tell “what it actually did,” keeping trust costs high.

    4. A Framework for Fixing It: Put Autonomy in an Engineering Cage

    4.1 Prioritize context engineering

    Use retrieval augmentation, repository maps, and layered summaries to give the model a “trusted global view,” and explicitly constrain the range of files it may access.

    4.2 Enforce the minimal-change principle

    Hard-code the requirement in system prompts and task templates: change only necessary files, forbid unrelated refactoring, and require tests with every change.

    1. Constraint template example:
    2. - Only files directly related to the requirement may be modified;
    3. - Do not change dependency versions or directory structure;
    4. - Relevant tests must be run and their output pasted;
    5. - Output a change list and rollback notes.

    4.3 Sandboxing and snapshots

    Execute commands in a container platform or isolated environment, combined with version snapshots, to make the workflow “safe to experiment with and easy to roll back.”

    4.4 Observability and an acceptance loop

    Feed operation logs, command output, and test reports into a unified logging service and monitoring/alerting, forming a human-in-the-loop acceptance process.

    4.5 Define the human-agent boundary

    Position the agent as an “executor and recorder,” while keeping architecture decisions and final merge authority with the developer.

    5. Conclusion

    The “hard to use” nature of autonomous coding agents is fundamentally an immature engineering pipeline, not a ceiling on model capability. As context engineering, sandbox isolation, observability systems, and minimal-change constraints mature, these tools have a clear path to improvement. For developers, the practical way to use agentic coding tools today is to hold rational expectations, define clear boundaries, and strengthen acceptance. When building such capabilities in the cloud, you can rely on common categories such as container platforms, object storage, logging services, and monitoring/alerting to complete the engineering implementation.