Introduction
Claude Code stands out among LLM agents for its minimal design, strong prompting and well-scoped tools that make it reliable and pleasant to use.
Bottom line: cut complexity, steer with robust prompts and provide deterministic tools.
The method focuses on one main loop, layered tools, and example-driven prompts. This keeps the agent responsive, debuggable and consistent, without multi-agent graphs or heavy RAG pipelines.
Context
The approach comes from hands-on use in coding workflows. It leverages LLM strengths—reading, pattern detection, guided reasoning—while offsetting weaknesses through explicit task management, style rules and tool policies.
Why Claude Code works
It keeps control through minimal architecture and precise tools that reduce hidden failures.
- Single main loop with at most one auxiliary branch
- Small models for heavy I/O, parsing and summarization
- Long prompts with examples, structured tags and policies
- LLM search over RAG for code exploration
- Tools at low/medium/high levels with clear usage rules
- Agent-managed todo list to sustain focus
- Steerability via tone, strong constraints and an explicit algorithm
Simple control loop
Keep one conversation and only branch when strictly necessary.
The loop remains linear: flat history, iterative tool calls, and a single subordinate branch for complex tasks whose result returns as a tool response. This avoids multi-agent opacity and streamlines debugging. Many calls use a smaller model for large reads, git summaries or quick labels, cutting cost and latency while preserving quality for local decisions.
Prompting that truly steers
Structure the prompt with sections, tags and concrete cases.
The system prompt covers tone, style, proactivity, task management, tool policy, date and environment. A persistent rules file (like claude.md) carries user preferences and project constraints. XML tags for reminders and good/bad examples plus Markdown headings create explicit decision lanes when options compete.
Context file (claude.md) and preferences
A shared rules file codifies constraints and style, always included.
Without this context the agent drifts: the file captures non-code signals (exclusions, libraries, conventions) and stabilizes long sessions.
XML tags, Markdown and examples
Tags and headings reduce ambiguity and regressions.
System reminders, contrasting examples and checklists guide tool selection, path handling and common pitfalls, improving accuracy under uncertainty.
Tools: LLM search beats RAG
Search like a developer: targeted commands and strong regex.
Rather than indexing and chunking, the agent queries source with powerful filters and reads progressively, often via small models. This avoids RAG pitfalls (similarity, reranking, chunking unstructured files) and lets the model do the understanding with fewer fragile parts.
Designing tools (low, medium, high level)
Mix granularities based on usage frequency and reliability.
Low-level tools (bash, read, write) keep flexibility; medium ones (grep, glob, edit) speed up frequent actions safely; high-level tools (web fetch, IDE diagnostics, execute) return deterministic results. Provide clear descriptions, examples and selection rules.
- Task, Bash, Read, Write, Edit/MultiEdit, NotebookEdit
- Glob, Grep, LS for structured search and navigation
- WebFetch, WebSearch for controlled external access
- TodoWrite to track and update objectives
- IDE diagnostics/execute as reliable atomic actions
Agent-managed todo list
Todos prevent context drift and keep the plan visible.
The agent creates, checks and edits todos frequently. This stabilizes long sessions, enables mid-course corrections and leverages interleaved thinking to insert or reject tasks as new facts appear.
Steerability: tone, constraints and algorithm
Control aesthetics, limits and decision steps with examples.
Sections on tone/style avoid needless preambles; strong wording ("IMPORTANT", "NEVER") still curbs bad behaviors. Crucially, write the operational algorithm: step-by-step with heuristics and realistic cases to plan, pick tools, verify outcomes and adjust.
Conclusion
The core lesson: architectural simplicity, expressive prompts and deterministic tools outperform complex scaffolding. One loop, small models for I/O-heavy work, LLM search and an explicit todo list yield a controllable, economical agent that improves as models advance.
FAQ
-
What makes Claude Code stand out among LLM agents?
A single loop, targeted tools and rich prompting that cut hidden complexity and errors. -
When should I use small models in this approach?
For large reads, summarization, parsing and frequent labeling, to save cost and latency. -
Why avoid RAG for AI search in codebases?
To prevent similarity/chunking failure modes and exploit precise regex-driven search. -
How does a claude.md-like file help?
It encodes preferences and constraints not visible in code, improving consistency. -
What is the role of an agent-managed todo list?
It preserves focus, clarifies priorities and enables course correction in long sessions. -
Do I really need a multi-agent system?
Usually not: one loop with at most one branch is easier to debug and reason about.