Three Weeks of AI Coding Agents Rebuilding My Codebase: 5x Budget, Fake Skills, and Out-of-Control Tests

    A product manager with a development background let two AI coding agents rebuild a personal project over three weeks with almost no human review. The result: $100 a day in token costs (five times his weekly budget), placeholder skills that never executed, and unit tests silently hitting production inference endpoints. This article breaks down what went wrong, why it happened, and the practical checklist for rebuilding with AI agents the right way.

    A product manager at a large tech company responsible for shipping AI products is not your typical “non-technical” bystander. He had an early career in software development, an AI research background, and worked with large language models daily. So when he decided to hand a personal project over to AI coding assistants, expectations were high: write a clear specification, let a few agents take turns doing the work, and three weeks later receive a fully architected, feature-rich system.

    The reality: he was burning $100 a day — five times his usual weekly token budget. By the time he actually sat down to read the code, he discovered that much of it wasn’t “implemented” — it just looked implemented. Three weeks in, the project had to be rebuilt from scratch.

    This is not a story about “AI can’t write code.” It’s an engineering accident caused by “AI writing code + humans completely letting go.”

    The Project: From a Podcast Pipeline to a Multi-Agent Workbench

    The project started simple: a personal podcast processing pipeline that automatically downloaded podcasts, transcribed audio, and generated summaries.

    As requirements grew, the system expanded into a more complete personal knowledge processing platform:

    • Scraping trending content from social media platforms and generating summaries;
    • Adding a scheduler so the system could run around the clock;
    • Integrating an email inbox — send a link, and the system fetches the content and returns a summary;
    • Organizing scattered information into a searchable personal knowledge base;
    • Building real agent workflows on top of the existing system, including deep research, daily usage reflection, skill accumulation, and instruction optimization suggestions.

    To support these capabilities, he wrote a dedicated specification for a full agent runtime:

    • An agent registry;
    • The ability to register, discover, and schedule independent agents;
    • Support for plugging in different agent SDKs;
    • Independent context and task boundaries for every agent.

    By any reasonable standard, this was far more serious than a typical “have AI write me a script” project. It had requirements, a spec, a target architecture, and a phased development plan. The real problem lay in how the following three weeks were executed: he never wrote code himself. Instead, he let two different AI coding assistants take turns, with almost no human code review.

    Three Core Problems Exposed After Three Weeks

    When he finally read the code seriously for the first time, the problems went far beyond “badly written code.” These weren’t isolated bugs — they were structural deviations at the system level.

    Problem 1: The Agent Runtime Existed Only in Name

    The spec explicitly required an agent runtime with a registry, scheduler, task queue, timeout and retry handling, context isolation, and observability.

    So what did the code actually look like? The class names existed. Runtime objects were created. But the real scheduling logic never went through the registry. Calls between agents were hardcoded; the registry was just a dictionary nobody consulted. No concurrency control, no timeouts, no retries, no task-level logging.

    Why did this happen?

    The core reason: the agents saw the spec as natural language, not as an interface contract. “Registry” in a natural language spec can be interpreted many ways. When generating code, AI coding assistants tend to make code look complete rather than make it actually fully wired up. It can create an empty shell structure without breaking existing functionality — the code keeps compiling and running — while the real registration, scheduling, and isolation mechanisms never land.

    In traditional development, this kind of deviation is easy to catch, because code review asks the obvious question: “Who actually uses this registry?” But when nobody reads the code for three weeks, the question never gets asked.

    Problem 2: Fake Skills — the Registry Was Full of Placeholders

    A key late-stage goal was to automatically accumulate new skills through daily reflection, so agents could invoke them in future tasks.

    On the surface, the skill registry had multiple entries with complete names, descriptions, and parameter schemas. But digging into the implementation revealed that many skill functions were empty shells:

    1. # Auto-generated skill registry
    2. SKILLS = {
    3. "daily_reflection": {
    4. "description": "Generate reflection based on the day's commits",
    5. "handler": "skills.daily_reflection.run"
    6. }
    7. }
    8. # Actual execution file
    9. def run(*args, **kwargs):
    10. return {"status": "ok", "output": "not implemented"}

    The code compiled. The system started. But the skills never actually executed. What made this even more insidious: these “fake skills” never raised errors. They existed in the registry, existed in the modules — they just never produced any real effect.

    Skill accumulation is not writing a document, nor dropping an interface name into a registry. A real skill should be:

    • Executable;
    • Registrable with the runtime;
    • Equipped with clear inputs and outputs;
    • Equipped with verifiable success criteria;
    • Genuinely callable by other agents;
    • Traceable with call chains and token cost records.

    Without these constraints, an AI can generate large amounts of plausible-looking placeholder code — and then keep referencing those placeholder skills in later output. The result: the system looks increasingly intelligent while just spinning in circles.

    Problem 3: Unit Tests Were Hitting the Production Inference Endpoint

    This was the most expensive and most dangerous mistake of the entire project.

    Unit tests should run fully offline, without depending on external services, and should never touch production. But in the actual code, the client in the test module was never properly replaced with a mock — real inference requests were sent straight to the production model endpoint.

    In other words, every test run made real LLM inference calls. Tests ran roughly 30 rounds a day, each round potentially generating large volumes of prompt and completion tokens. Over time, token consumption blew past the budget.

    The reason he was burning $100 a day — five times the usual weekly budget — was precisely this hidden problem going undetected.

    What made this so dangerous:

    • Tests looked green;
    • The system threw no errors;
    • Logs showed nothing unusual;
    • Costs were quietly spiraling;
    • Without a cost dashboard and alerting, it was nearly impossible to catch manually.

    A true unit test should be able to run with the network disconnected. Integration tests can call real services, but they must use a dedicated test environment, test accounts, and test data — behind an explicit opt-in flag.

    Root Cause: Not That Agents Aren’t Smart Enough — the Engineering Process Was Missing Half Its Steps

    Many people would attribute this failure to “AI coding assistants not being good enough.” But more accurately, the engineering process was missing critical checkpoints.

    1. The Spec Said What to Build, Not How to Verify It

    The original spec described the capabilities the system should have, but lacked verifiable acceptance criteria.

    For example:

    • “Implement an agent registry” is a valid requirement;
    • “Once registered, an agent must be discoverable by the scheduler, and a call must only be resolved within the registry” is verifiable;
    • “Implement skill accumulation” is a valid requirement;
    • “Skills must be executable and must have corresponding regression tests” is verifiable.

    Without acceptance criteria, the AI only needs to make things “look right” to pass a purely mental human review.

    2. No Human Review After Each Generation

    Not looking at the code for three weeks was the amplifier for every other problem.

    AI coding assistants excel at generating large amounts of code, but their local optimization ability far exceeds their global consistency. They won’t notice they just wrote an empty shell function, and they won’t notice that tests are hitting a production endpoint — unless a human sets up checkpoints for them.

    The right approach is neither “full trust” nor “full distrust,” but a layered review process:

    • Agent generates code;
    • Automated static checks, unit tests, and builds run;
    • A human reviews diffs and design decisions;
    • Changes merge to the main branch;
    • CI continuously validates afterward.

    3. No Cost Observability

    Token cost overruns don’t happen overnight — they accumulate day by day.

    If the system had call-level logging from day one:

    • Every inference request logged task ID, module, input length, output length, and token usage;
    • Test and production environments used different configurations;
    • Alerts fired automatically when thresholds were exceeded;
    • Every test case was tagged “allowed to call external services” or “forbidden from calling external services”;

    Then problems two and three would have been caught on day one — not three weeks later.

    A Practical Checklist for Rebuilding with Agents

    If you were to start over, how should you design it?

    1. Upgrade the Spec into an Interface Contract

    Don’t make the AI guess the architecture from natural language. For critical modules, write out the interfaces, boundaries, constraints, and test requirements directly.

    1. class AgentRegistry:
    2. def register(self, name: str, agent: Agent) -> None:
    3. ...
    4. def resolve(self, name: str) -> Agent:
    5. ...

    Corresponding acceptance criteria:

    • A registered agent must be resolvable;
    • Registering the same name twice must raise an error;
    • Resolving a nonexistent agent must return a clear exception;
    • The scheduler may only resolve agents through the registry — no direct imports of concrete implementations.

    2. Refactor in Phases with Small, Frequent Merges

    Don’t let an agent rebuild the entire codebase in one shot. The better approach:

    • Split the system into independent modules;
    • Map each module to a clearly scoped agent task;
    • Limit each task to a bounded scope of changes;
    • Commit and run tests immediately after each task completes;
    • Have humans review high-risk parts — but always review.

    3. Strictly Isolate the Test Environment

    All test code must satisfy:

    1. # Production endpoints are forbidden in test code
    2. def test_summarize():
    3. client = get_client()
    4. client.base_url = "mock://local"
    5. response = client.summarize("hello")
    6. assert response.status == "ok"

    An even stricter approach: block all external network connections in the CI environment. If a test genuinely needs an external service, it must be explicitly marked as an integration test and use a dedicated test environment.

    4. Skills Must Be Executable at Registration

    A skill should no longer be a string — it should be an executable object:

    1. class Skill:
    2. name: str
    3. description: str
    4. def execute(self, context: dict) -> dict:
    5. raise NotImplementedError
    6. def selftest(self) -> bool:
    7. ...

    Skills must pass a self-check at registration time, and each skill must be invoked by at least one real task. Skills with no callers are not allowed into the registry.

    5. Budget and Cost Guardrails

    In agent projects, token cost is not an “operating expense” — it’s an “engineering quality metric.”

    Concrete practices:

    • Log token usage for every inference call;
    • Assign each agent task its own cost budget;
    • Automatically pause a task when costs exceed a threshold;
    • Fail any unit test that triggers real inference;
    • Produce daily and weekly cost reports with alerting.

    The Final Lesson

    AI coding agents can absolutely write code — lots of it. But they won’t take responsibility for your architecture, won’t do your code review, and won’t watch your budget.

    When letting agents rebuild a codebase, the real key is this: the human doesn’t exit the coding process. The human shifts from “writing code” to “defining system boundaries, acceptance criteria, quality gates, and cost thresholds.”

    Three weeks without reading the code is like handing the car over to autopilot with no dashboard and no brakes. By the time you notice something is wrong, you’re no longer fixing bugs — you’re rebuilding the entire project.

    If you’re planning to use AI coding agents for a codebase rebuild, remember one thing: time spent before generating code is always cheaper than time spent rewriting it afterward.