# Why I Deleted 254 MB of Agent Infra for 3 Markdown Files

*Published: November 13, 2026 | Topics: AI Orchestration, Spec-Driven Architecture, Context Engineering, Multi-Agent Systems, Systems Design*

> **TL;DR:** Heavy agent infrastructures—bundled skill registries, external graph databases, and 400 KB orchestrator prompts—degrade model attention and waste context before a single line of application code runs. Replacing ~254 MB (~17,200 files) of orchestration machinery with three structured Markdown files (a Specification, a Scoped Execution Plan, and a 50-line Rolling Summary) cut baseline system prompt overhead by ~85% while keeping verification deterministic.

Earlier this year, I ran a disk audit on my workspace while shipping [Bield](/projects/bield) and maintaining an autonomous job-intelligence pipeline. Sitting inside a portfolio repository that only needed clean Kotlin, TypeScript, and Python was more than 254 MB of "agent infrastructure": roughly 17,200 copied template files, a 1,500-entry offline skill archive, a 400 KB monolithic orchestrator manual, and a local dependency-graph server.

The system looked impressive on an architecture diagram. In daily production, it felt like dragging an anvil uphill. Agents ignored the dependency database half the time, burned tens of thousands of tokens reading bloated prompt preambles, and forgot critical constraints halfway through multi-file refactors. So I deleted all 254 MB and replaced the entire tower with three plain Markdown files.

## Why Do Multi-Agent Harnesses Collapse Under Their Own Weight?

Multi-agent frameworks collapse when orchestration metadata competes with real codebase context for the model's finite attention budget. Every extra instruction file, JSONL graph schema, or verbose status protocol creates coordination tax—forcing the LLM to spend reasoning cycles navigating your harness instead of solving the engineering problem.

Looking back across five months of building what eventually became the [Archevyn Method](/#methodology), every architectural mistake came from adding ceremony to patch a symptom of context degradation rather than fixing the root cause:

- **Phase 1 — The Manual Triad (v0.1–v0.5): **Three separate manual chat tabs acting as PM, Programmer, and QA Auditor, passing handoff Markdown logs back and forth. Copy-paste friction dominated the workflow, and agents routinely truncated or skipped sections once threads grew long.
- **Phase 2 — The Portable Skill Registry (v0.6–v0.8): **To standardize capabilities, I copied a 1,500+ entry skill library (~250 MB) directly into project folders with automated packaging scripts. Repositories filled up with unrelated files, and hundreds of active skill headers muddied model selection.
- **Phase 3 — External Graph DB & Heavy Orchestrator (v1.0): **I replaced manual tracking with a local JSONL dependency-graph tool and a ~400 KB autonomous orchestrator specification. Instead of simplifying work, the extra MCP calls added latency—and subagents quietly bypassed the graph database to edit code directly whenever tool calls felt slow.

As explored in [my previous deep dive on context rot](/blog/why-your-agentic-ai-system-forgets-itself-context-rot), models do not fail linearly as context grows—they degrade in sudden cliffs once noisy instructions drown out relevant invariants. Shipping [Job Finder](/projects/job-finder) and refactoring production Next.js apps made that threshold impossible to ignore.

## What Replaced 254 MB of Agent Tooling?

I replaced the entire local infrastructure with a single globally installed ruleset, on-demand documentation routing, and three focused per-project Markdown files. Removing ~17,200 redundant template files and archiving rarely used cloud/legacy docs behind a one-line router slashed baseline prompt tokens by roughly 85%.

Every project now runs on Git as the single source of code truth plus three lightweight documents:

1. **The Specification: **Defines the measurable baseline before work begins, business rules, strict non-goals, edge cases, and the exact Definition of Done.
1. **The Scoped Execution Plan: **Breaks work into isolated waves and enforces six harness boundaries per task—exact Allowed Files (create vs. modify), explicit Forbidden Scope, Stop Points (schema, public API, or auth mutations), and the mandatory shell verification command.
1. **The 50-Line State Summary: **Acts as compaction-proof memory (~300 tokens). Completed waves collapse into one line with Git commit SHAs, while active architectural rules are capped at 10 self-pruning bullets.

> **The 50-Line (~300-Token) Memory Ceiling:** Never let session state files grow unbounded. Compact finished execution waves into a single line referencing verified commits, and prune obsolete constraints so your active rule list stays capped at 10 bullets. A constant ~300-token footprint guarantees any newly spawned agent or post-compaction turn recovers full situational awareness instantly.

### Heavy Agent Infrastructure (v0.6–v1.0) vs. Lean 3-File Architecture (v2.0–v2.1)

| Engineering Dimension | Heavy Harness (v0.6–v1.0) | Lean 3-File Architecture (v2.0–v2.1) |
| --- | --- | --- |
| Per-Repo Footprint | ~254 MB (~17,200 copied files & registries) | 0 repo copies; 3 gitignored Markdown state docs |
| Baseline Prompt Overhead | ~400 KB orchestrator + hundreds of skill headers | ~85% reduction via concise core + on-demand routing |
| Task State & Source of Truth | External JSONL graph DB (frequently bypassed) | Git status/diff + compact 50-line (~300-token) summary |
| Verification Standard | Unstructured 'DONE' claims or subjective checks | Mandatory 4-line Evidence Report + exit-code-0 proof |
| Failure Circuit Breaker | 3-retry allowance before halting | Strict 2-retry limit + immediate rollback (~33% token savings) |

## How Production Hardening Eliminated Silent Loops and Context Rot

Making the architecture tiny solved prompt bloat, but production stability still required removing blind trust from subagent handoffs. In v2.1, I hardened the execution loop around two non-negotiable engineering disciplines: extreme diff minimalism (standard library first, zero speculative abstractions) and reproduce-first verification (always inspect root cause and run a failing check before touching production files).

Just as importantly, no worker agent is allowed to say "Task completed successfully" and run a Git commit on its own. Each worker operates inside an isolated workspace or parallel Git worktree for strictly disjoint file sets (capped at three concurrent tasks per wave) and returns a standardized four-line Evidence Report to the Tech Lead gatekeeper:

```yaml
# Worker Scope Contract (Example)
Allowed Files : [MODIFY] src/app/open-next.config.ts
Forbidden     : src/app/api/*, prisma/migrations/*
Stop Points   : Unplanned DB schema, public API, or auth changes

# Mandatory 4-Line Evidence Report (Before Commit)
Status       : SUCCESS
Proof        : npx tsc --noEmit && npm run build -> exit code 0
Decisions    : Switched bundler command to --webpack for Windows path safety
Blast Radius : Affects OpenNext server bundle output only; routes unchanged
```

Notice what happens when verification fails. Instead of discarding context and spinning up a brand-new agent to repeat the same mistake, the gatekeeper records a single anti-regression bullet in the state summary and messages the exact same subagent to fix it. If the fix still fails after two attempts, a strict circuit breaker trips: the working tree rolls back cleanly via Git rather than stacking broken patches on top of broken code. Dropping the ceiling from three retries to two saved roughly 33% of wasted tokens on stubborn failure loops.

## What Broke During the Transition—and When This Model Is Wrong

Shrinkage introduces its own operational friction, and pretending otherwise would be dishonest. When your persistent state file is strictly capped at 50 lines and 10 active bullets, forgetting to prune stale constraints creates a silent bottleneck—old rules start crowding out newer lessons until the coordinator forces manual cleanup.

You also lose automatic visual QA unless explicitly triggered: relying purely on CLI builds, type checks, and unit tests keeps token burn near zero, but CSS layout shifts or subtle responsive issues still require deliberate human or targeted inspection before major releases.

> **Where Three Markdown Files Are Not Enough:** Do not force a lightweight 3-file harness onto a 40-engineer enterprise organization juggling cross-team SLAs, multi-repo compliance audits, and shared staging queues. This architecture excels for solo builders and tight 1–3 person teams acting as AI Tech Leads over cohesive repositories—exactly the model outlined in 'I Don't Write Code. I Architect Systems That Do.'

If you feel your agentic pipeline spending more time updating task boards and loading plugins than passing tests, audit the weight of your harness first. Nine times out of ten, the missing feature is not another framework—it is deleting the 250 MB sitting between the model and your code.

## Frequently Asked Questions

### Why does deleting bundled agent skill libraries improve coding reliability?

Loading hundreds of instruction headers into a model's system prompt inflates baseline token overhead and blurs routing decisions between similar capabilities. Keeping only minimal active rules in the base prompt (~85% fewer tokens) and loading specialized runbooks strictly on demand produces cleaner, more predictable tool calls.

### What are the three Markdown files that replaced external task databases?

They split responsibilities cleanly: a Specification file defines the baseline, business rules, edge cases, and Definition of Done; a Scoped Execution Plan locks exact allowed files, forbidden scope, stop points, and test commands per wave; and a Rolling State Summary tracks completed commits plus up to 10 active anti-regression constraints under a strict 50-line ceiling.

### Why cap the circuit breaker at two retries instead of three?

In production runs, if an agent fails an automated verification check twice after targeted root-cause fixes, a third attempt almost always stacks workarounds onto a broken mental model. Halting at two retries saves roughly 33% of wasted failure-loop tokens and forces an immediate, clean repository rollback before re-planning.

### How does a 50-line state summary survive long multi-hour sessions?

Whenever a wave of changes is verified and committed to Git, its finished tasks collapse into a single line referencing the commit hashes, while active constraints are capped at 10 bullets by pruning obsolete rules. Maintaining a ~300-token constant footprint guarantees every subagent and compacted session restarts with full operational constraints intact.
