MPIsaac Ventures
Back to Blog

The Agent Loop Map: Claude Code Is Mostly Search, Edit, Shell, Repeat

Michael Isaac
Michael Isaac
Operator. 30 yrs in enterprise AI.3 min read

The public imagination of coding agents is still too chat-shaped.

The data says something else.

Claude Code is an execution loop. In my refreshed corpus, the dominant loop was:

search -> inspect -> edit -> run shell/test -> inspect result -> repeat

The corpus basis:

  • 4,234 parsed session IDs
  • 247,592 tool events
  • 244,000+ tool-family transitions
  • Timestamp range: November 25, 2025 to May 6, 2026

The Finding

At the tool-family transition level:

PatternTransitionsShare
Same-family transitions162,81466.6%
Search/edit/shell core199,55781.7%
Shell/edit back-and-forth28,35911.6%

Top transitions:

TransitionCountShare
shell -> shell91,38137.40%
file_edit -> file_edit46,52619.04%
file_edit -> shell14,9956.14%
shell -> file_edit13,3645.47%
file_search -> file_search10,0154.10%
file_search -> file_edit9,2333.78%
file_edit -> file_search7,5133.08%

The center of gravity is not exotic.

It is shell, files, search, and feedback.

Why This Is Non-Obvious

Agentic coding advice often overweights prompts, personas, and high-level planning rituals.

Those matter, but the loop map points somewhere more concrete:

  • Can the agent find the right code fast?
  • Are command outputs short enough to interpret?
  • Do tests fail with useful messages?
  • Are file edits narrow and reviewable?
  • Does the agent get structured reality back after every action?

The model is not operating in a vacuum. It is trapped inside the feedback loop you give it.

The So What

If 81.7% of the action lives inside search/edit/shell, then the biggest leverage is not a clever prompt.

It is improving those surfaces.

Practical moves:

  • Prefer rg over broad grep-style scans.
  • Ask for targeted file inspection before edits.
  • Keep command output narrow: one test file, one failure class, one diff.
  • Make test failures descriptive.
  • Make scripts deterministic and idempotent.
  • Put common checks behind short commands the agent can reuse.
  • Avoid dumping giant logs unless the agent asks for a specific slice.

This is loop-shaping.

The Operator Protocol

For Claude Code, use this working contract:

Before editing, locate the relevant implementation and call sites.
After editing, run the narrowest meaningful verification.
If verification fails, diagnose the failure class before retrying.

The "narrowest meaningful verification" line is what closes the verification-debt loop: the receipt the agent produces is the same artifact that turns "done" into a defensible terminal state.

That protocol maps directly onto the loop:

locate -> inspect -> edit -> narrow verification -> report receipts

It sounds plain because it is plain. Most of the gains come from removing noise from the execution loop.

The Counterintuitive Part

Adding more tools can make the agent worse if those tools add noise to the loop. And noise is where stuckness gets expensive: the same noise that confuses the loop also drives sessions into long error tails.

A bloated MCP server, a verbose test runner, or a noisy project script can cost more than it helps. The agent already spends most of its life in a small action core. Make that core better before you expand the surface area.

The top 0.01% agentic coder is not the person with the most plugins loaded.

It is the person whose agent gets the cleanest possible reality after every action.

The public query factory is here: MPIsaac-Per/claude-code-ops-audit.