Skip to main content
The Davenporter
Essays Notes Builds Now About
Theme
Palette
Jason Davenport

I write about agents doing real engineering work: source control, memory, telemetry, and the human side of AI.

Subscribe

Elsewhere

  • About me
  • Substack
  • Medium
  • LinkedIn
  • GitHub
  • X
  • RSS
  1. Home
  2. Essays
  3. CLI beat MCP for my code graph, and Blender broke my line limit

CLI beat MCP for my code graph, and Blender broke my line limit

Nov 23, 2026 · 7 min read · Also on LinkedIn ↗ · X ↗

Moving my code graph onto procedural Blender builds and parallel agent swarms broke two assumptions at once. MCP vanished inside swarm workers while a strict 250 line read cap trapped models in slicing loops. Flipping to a fast CLI cut cold start outline latency nearly 4x, interned edges shrank the index 6x, and sizing reads to code shape stopped the loops. Pick MCP vs. CLI intentionally, and keep tuning your tools as your code changes.

Architectural drafting workbench with a brass mechanical conduit beside a 3D wireframe blueprint, compass, and ruler.

When I started building procedural 3D venues in Blender and Three.js with parallel agent swarms (running Gemini 4 Neon and Claude Opus 5.5), my own coding agent setup broke in two places at once.

I originally built ast-graph as an MCP plugin for modular TypeScript web apps and Python services. The setup was simple: call the MCP server, outline the file first, and never read more than 250 lines at a time. That worked great on CRUD apps. On 3D code and parallel swarms, MCP wasn't the right primary interface for a local dev tool, and the 250 line cap trapped agents in slicing loops.

In Coding harnesses are cheap to swap now. Model behavior isn't., I wrote that teams should stop building harness glue and own policies, code, memories, and evaluation instead. This is what actually happens when you do that and your codebase changes shape. You have to be intentional about MCP vs. CLI, and you have to keep tuning your tools as you take on different kinds of code.

Why CLI beat MCP for a local code graph

Looking through a week of local transcripts, 124 swarm workers made 0 MCP calls.

Coordinators and standalone subagents used MCP plenty, while native swarm workers didn't even have the MCP server mounted. Almost half of those workers ran blind without the code graph, and the rest only reached it because a repo script happened to expose the CLI inside bash.

That matched my earlier search audit. Claude Opus 5.5 stayed in bash and skipped lazy MCP schemas unless forced, while Gemini 4 Argon read the schemas and queried the graph. Putting the graph behind a fast CLI gets rid of that split across models and workers.

I'm finding that CLI's are better for coding agents in local tools for four reasons:

  • No schema overhead either way: harnesses that preload MCP tool definitions inject JSON schemas into context before turn 1, while harnesses that lazy load schemas add an extra read turn that models like Opus often skip. A CLI shares one generic shell tool.
  • Universal reach: a CLI works identically in solo sessions, subagents, swarm workers, and CI without wiring an MCP server into every sandbox.
  • Unix composability: an agent can batch symbols, pipe output, or chain commands in one turn instead of paying a separate JSON-RPC round trip per step.
  • Native training habits: frontier models have ingested decades of terminal commands, flags, and stderr messages.

Not to say MCP isn't still valuable, in particular at external boundaries: remote SaaS API's (Jira, Figma, CRMs), multi user OAuth, hosted state, and locked down sandboxes where giving an agent raw bash isn't an option.

Here is how I split local CLI tools from remote MCP boundaries now.

Diagram comparing local CLI primary agent tools with remote MCP tools across swarms, speed, and auth.

Wrapping a local SQLite code graph in MCP first and treating CLI as an afterthought was backwards. I flipped ast-graph to CLI primary in the plugin rules and kept MCP optional.

Making a CLI fast enough to be primary

Flipping to CLI primary exposed a cost that a warm MCP server hides.

An MCP server stays warm in memory. A CLI pays cold start latency on every query.

Before optimizing node dist/cli.js, a single file outline call took around 650 ms. That felt wrong for SQLite.

So I profiled it. The actual SQLite query took 2 ms. Almost all of the wait went into loading modules on startup, including importing the TypeScript compiler on read only queries where zero source files had changed.

The fix was a clean index fast path. On read only commands (outline, symbol, search, refs, blast, tests), the CLI checks Git HEAD and file timestamps against SQLite first, and when the index is clean it answers directly without ever importing the indexer or TypeScript.

Cold outline latency dropped to around 170 ms (roughly 3.8x faster).

Moving onto the 3D repo exposed a storage bug at the same time. Schema v3 stored long string symbol IDs four times across the edges table and its indexes, pushing that repo's SQLite file to 353 MB. Schema v4 interned those IDs to integer keys and shrank the index down to 60 MB (nearly 6x smaller).

Here is how those fixes stacked up before and after.

What ChangedBeforeAfterWhat Fixed It
Swarm worker access0 MCP calls (124 workers)CLI primary in rulesWorks across solo, subagents, swarms
CLI outline cold start~650 ms~170 ms (~3.8x faster)Skipped loading TypeScript on clean reads
3D repo SQLite index353 MB60 MB (~6x smaller)Interned string edge IDs to integers
Coupled 3D / Blender reads250 line cap (up to 77 loops)Up to 800 linesSized read rule to code shape

Notice that last row. Even with a fast CLI and a compact database, one rule I wrote for web apps was still slowing the agents to a crawl.

Why Blender broke assumptions about lines of code

On a TypeScript web app or Python API, a strict 250 line read limit makes sense. Handlers, React components, and schemas are modular, so you rarely need more than one function to make a clean edit.

Blender code doesn't work like that.

In my Blender asset builders, coordinates, mesh passes, material palettes, and baking helpers are tightly coupled across long procedural functions. One builder (vehicles_forge.py) packs 942 lines into just 6 symbols, and the Three.js venue files next door cross 6,000 lines. Meanwhile, ast_outline capped inline output at a fraction of a huge venue file, and AGENTS.md strictly banned any read_file call over 250 lines.

Agents obeyed the rule right up to their demise.

Looking through the transcripts, models got bogged down in 250 line micro slicing loops. On Blender files, swarm workers walked builders like forge_glacier_assets.py and structures_forge.py 5 or 6 times straight (1-250, 251-500, 501-750, all the way to the bottom).

On coupled Three.js venue files, it got much worse. One session read crashJunctionVenue3d.ts 77 times in 250 line slices, and another agent's own reasoning literally wrote that the 250 line limit would be enforced during the inspection.

Lines of code was the wrong proxy. A long Blender builder isn't sloppy CRUD code you can edit through a keyhole, because you need surrounding geometry, transforms, and lighting state in view or you break the scene.

The fix wasn't ditching outline first navigation. It was sizing the read rule to the shape of the code.

Targeted symbol spans (250 lines or fewer) stay the default for modular code. When editing coupled visual or procedural files (Blender builders, Three.js scenes, shaders, and single symbols longer than 250 lines), the rule now tells the agent to outline first and read the full symbol or up to 800 contiguous lines in one call. No more slicing loops. However, I'm still learning here and you can see where the cost of a plugin here is slowly increasing to manage all the varieties of random code we have out there.

Keep tuning the tools as your code changes

Agent plugins, MCP configs, and AGENTS.md rules aren't setup work you finish once and forget.

They rot the moment your work changes. Shift from solo sessions to parallel swarms, or from web apps to procedural 3D, and yesterday's guardrail becomes today's bottleneck.

This is why owning your code, memories, and evaluation matters more than owning a coding harness. The outer harness is interchangeable. The fast CLI you ship for local repos, the rules in AGENTS.md, and the session log audits that catch slicing loops are where engineering time actually pays off.

Start with a fast, composable CLI whenever a tool runs locally against files, Git, or SQLite. Reach for MCP when you actually need OAuth, hosted state, or a remote server boundary.

Treat your session logs like a profiler. The next time you point Gemini 4 Neon or Claude Opus 5.5 at a new codebase, read five transcripts. Look for tools nobody called, cold starts burning half a second per step, or rules the model obeys in tight loops. Fix the tool instead of just nagging the prompt.

Which agent tool or rule broke the last time you moved onto a different kind of codebase? Let me know in the comments!

← All essays Browse all 28 essays Older essay → Coding harnesses are cheap to swap now. Model behavior isn't.

Get new posts by email

I send new essays by email through Substack. Subscribe there and they'll land in your inbox.

Subscribe on Substack ↗
About · Notes · Subscribe on Substack · RSS · Privacy ·
Ask

Social card and structured data

The share image, feeds and Schema.org JSON-LD that search engines and AI tools read for this page.

Social card

Direct brass conduit linking clockwork nodes beside a faceted 3D wireframe structure on an archival sheet.
Card URL: /og/cli-vs-mcp-coding-agents-ast-graph.svg

Machine feeds

/llms.txt /llms-full.txt /sitemap.xml /api/agent/spec

Structured data

{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Person",
      "@id": "https://davenporter.com/#jason-davenport",
      "name": "Jason Davenport",
      "alternateName": "@davenportjw",
      "jobTitle": "AI & Distributed Systems Architect",
      "description": "Exploring agent-first source control (cosm), trajectory-to-lineage observability, Spanner-backed agent memory consolidation (Electric Sheep), hybrid local/cloud LLM routing, and real-time multiplayer browser simulations on Google Cloud Run.",
      "url": "https://davenporter.com",
      "sameAs": [
        "https://davenporter.substack.com",
        "https://www.linkedin.com/in/davenportjw",
        "https://github.com/davenportjw",
        "https://x.com/davenportjw",
        "https://medium.com/@davenportjw"
      ]
    },
    {
      "@type": "WebSite",
      "@id": "https://davenporter.com/#website",
      "url": "https://davenporter.com",
      "name": "The Davenporter",
      "description": "Learnings about software, technology, agentic systems, and occasionally home renovation.",
      "publisher": {
        "@id": "https://davenporter.com/#jason-davenport"
      },
      "inLanguage": "en-US"
    },
    {
      "@type": "ImageObject",
      "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#primaryimage",
      "url": "https://davenporter.com/static/images/essays/cli-vs-mcp-coding-agents-ast-graph/og-cli-vs-mcp-blender-1200x630.png",
      "contentUrl": "https://davenporter.com/static/images/essays/cli-vs-mcp-coding-agents-ast-graph/og-cli-vs-mcp-blender-1200x630.png",
      "width": 1200,
      "height": 630,
      "caption": "Direct brass conduit linking clockwork nodes beside a faceted 3D wireframe structure on an archival sheet.",
      "representativeOfPage": true,
      "creator": {
        "@id": "https://davenporter.com/#jason-davenport"
      },
      "license": "https://creativecommons.org/licenses/by/4.0/",
      "acquireLicensePage": "https://davenporter.com/writings"
    },
    {
      "@type": "WebPage",
      "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#webpage",
      "url": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph",
      "name": "CLI beat MCP for my code graph, and Blender broke my line limit | The Davenporter",
      "description": "Moving my code graph onto procedural Blender builds and parallel agent swarms broke two assumptions at once. MCP vanished inside swarm workers while a strict 250 line read cap trapped models in slicing loops. Flipping to a fast CLI cut cold start outline latency nearly 4x, interned edges shrank the index 6x, and sizing reads to code shape stopped the loops. Pick MCP vs. CLI intentionally, and keep tuning your tools as your code changes.",
      "isPartOf": {
        "@id": "https://davenporter.com/#website"
      },
      "about": {
        "@id": "https://davenporter.com/#jason-davenport"
      },
      "primaryImageOfPage": {
        "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#primaryimage"
      },
      "inLanguage": "en-US"
    },
    {
      "@type": "FAQPage",
      "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#faq",
      "mainEntity": [
        {
          "@type": "Question",
          "name": "What is \u201cCLI beat MCP for my code graph, and Blender broke my line limit\u201d about?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Moving my code graph onto procedural Blender builds and parallel agent swarms broke two assumptions at once. MCP vanished inside swarm workers while a strict 250 line read cap trapped models in slicing loops. Flipping to a fast CLI cut cold start outline latency nearly 4x, interned edges shrank the index 6x, and sizing reads to code shape stopped the loops. Pick MCP vs. CLI intentionally, and keep tuning your tools as your code changes."
          }
        }
      ]
    },
    {
      "@type": "BlogPosting",
      "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#article",
      "mainEntityOfPage": {
        "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#webpage",
        "url": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph"
      },
      "headline": "CLI beat MCP for my code graph, and Blender broke my line limit",
      "alternativeHeadline": "Running ast-graph on procedural 3D code and parallel swarms forced a CLI rewrite, a 6x smaller index, and a new read rule.",
      "description": "Moving my code graph onto procedural Blender builds and parallel agent swarms broke two assumptions at once. MCP vanished inside swarm workers while a strict 250 line read cap trapped models in slicing loops. Flipping to a fast CLI cut cold start outline latency nearly 4x, interned edges shrank the index 6x, and sizing reads to code shape stopped the loops. Pick MCP vs. CLI intentionally, and keep tuning your tools as your code changes.",
      "datePublished": "2026-11-23T15:25:00Z",
      "dateModified": "2026-11-23T15:25:00Z",
      "wordCount": 1372,
      "keywords": "Agent Engineering, Developer Workflow, Developer Tools, Open Source",
      "author": {
        "@id": "https://davenporter.com/#jason-davenport"
      },
      "publisher": {
        "@id": "https://davenporter.com/#jason-davenport"
      },
      "image": {
        "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#primaryimage"
      },
      "url": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph",
      "sameAs": [
        "https://lnkd.in/p/dAgxtuCi",
        "https://x.com/davenportjw/status/2124891198682972285"
      ]
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph#breadcrumb",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://davenporter.com/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Essays",
          "item": "https://davenporter.com/writings"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "CLI beat MCP for my code graph, and Blender broke my line limit",
          "item": "https://davenporter.com/writings/cli-vs-mcp-coding-agents-ast-graph"
        }
      ]
    }
  ]
}

Ask The Davenporter

Ask anything about the essays and builds on this site.