Deep Agents/Agentic Coding
Advanced14 min

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.

Need a coding agent?Is Claude Code or Cursor sufficientfor your use case?YesUse existingtoolNoDo you only need project-specificconventions and skills?YesDeep Agents CLI+ skills filesNoDo you need custom tools (internal APIs,proprietary DBs), custom verification,or CI/CD integration?NoRe-assessYesBuild custom agentcreate_deep_agent() + DaytonaSandbox

Most teams should stop at "CLI + skills files" — custom agents are a maintenance commitment

ScenarioRight toolWhy not custom
General coding tasksClaude CodeFull project context, hooks, best tool-use in class
Inline completionsGitHub Copilot / CursorIDE-native UX, completion-optimized
Custom project conventionsDeep Agents CLI + skills filesSkills are configuration, not code
Internal APIs + custom toolscreate_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 automationcreate_deep_agent() headlessProgrammatic control of the agent loop
Custom agents are a maintenance commitment

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.