liveBook · Manning

Frequency and complexity heuristic

As explained in Vibe Engineering

A frequency and complexity heuristic is a decision method that chooses an interface based on how often it is invoked and how complex its inputs and outputs are.

Choose an interface by combining invocation frequency with input and output complexity. CLI calls usually suit infrequent tools with concise output; MCP wrappers earn their cost for frequent calls or structured filtering. section 9.5.1

Apply the heuristic with these checks:

  • Prefer CLI when a tool runs once or twice per session, accepts simple arguments, and returns a few lines. section 9.5.1
  • Prefer MCP when a tool runs ten or more times per session, requires complex parsing, or must reduce large outputs to relevant data. section 9.5.1
  • Check the aggregate context budget first; individually justified servers can still consume roughly a third of the context window. section 9.5.1
Table 9.6 Context Usage claude-sonnet-4-5
Source
Tokens
Share
System prompt
3,900 tokens
2%
MCP tools
58,400 tokens
29%
Memory files
1,200 tokens
1%
Messages
42,000 tokens
21%
Free space
94,500 tokens
47%

Use the context breakdown to assess whether persistent tool definitions leave enough working space. section 9.5.1

How Vibe Engineering covers it

How deep it goes
Defines frequency thresholds, complexity signals, latency tradeoffs, and an aggregate context-budget caveat.
Examples
Compares GitHub MCP with gh CLI and Sentry MCP with sentry-cli, alongside test runners and type checkers.
What you can do after
Evaluate whether a tool should remain a raw CLI call or receive an MCP wrapper.
How it connects
Connects MCP, CLI, context windows, token budgets, structured output, and on-demand loading.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.