Building Your Own Coding Agent
Most teams should NOT build a custom coding agent — Claude Code or the Deep Agents CLI with skills files is usually sufficient. This article tells you when building custom is justified, walks through the correct setup, and covers the failure modes, cost math, and evaluation strategy that actually matter in production.
Quick Reference
- →Build custom only when CLI + skills files are not enough — the overhead is real and ongoing
- →Five components: model, system prompt, backend (sandbox), skills, memory — each is an engineering decision
- →Edit-verify loop: edit → run tests → fix → repeat. Circuit breaker at 5 iterations, then ask the user
- →DaytonaSandbox: 27-90ms cold start, OCI containers — never run agent-generated code on your host
- →Skills load domain knowledge on demand; memory (AGENTS.md) persists conventions across sessions
- →Cost: ~$0.05–0.15 per coding task at Sonnet 4.6 pricing; measure before scaling to your team
When to Build (and When Not To)
Before writing any code, answer this honestly: can Claude Code or Cursor handle your use case? For most coding tasks — fixing bugs, generating tests, refactoring, code review — the answer is yes. The Deep Agents CLI with custom skills files handles the next tier: projects with unusual conventions, internal libraries, or domain-specific patterns. Custom agents built with `create_deep_agent()` are justified only in a narrow set of cases.
Most teams should stop at "CLI + skills files" — custom agents are a maintenance commitment
| Scenario | Right tool | Why not custom |
|---|---|---|
| General coding tasks | Claude Code | Full project context, hooks, best tool-use in class |
| Inline completions | GitHub Copilot / Cursor | IDE-native UX, completion-optimized |
| Custom project conventions | Deep Agents CLI + skills files | Skills are configuration, not code |
| Internal APIs + custom tools | create_deep_agent() | Only case that requires a custom agent |
| Custom verification (security scan, compliance) | create_deep_agent() | Custom tools needed for the verification step |
| CI/CD pipeline automation | create_deep_agent() headless | Programmatic control of the agent loop |
Every custom agent you build needs updates when Deep Agents adds new features, when your sandbox provider changes its API, and when your codebase evolves. Skills files are configuration — they update with your project. A custom agent is a service you now own. Make sure you need it before building it.