Digitorn
Digitorn
All templates
developerintermediate

Claude Code clone

The flagship coding agent: Sonnet writes the code, Haiku does the grepping and reading, the runtime stitches them together. ~60% cheaper than running Sonnet on every turn. The architecture is documented end-to-end in the blog post linked below.

lines 56cost ~$0.18 per session (60% off Sonnet-only)install hub://digitorn/digitorn-code
Install in one command
digitorn install hub://digitorn/digitorn-code
What you get
  • Coordinator that plans first, then executes
  • Explorer worker for grep/glob/read at Haiku rates
  • Read-before-edit guard, plan-first behaviour rule
  • Sub-agent dispatch via the Agent tool
Credentials this template uses

Click each one for the credential setup command, scope guidance, and provider details.

The full YAML, ready to fork

app.yaml
1app:2  app_id: claude-code-clone3  name: "Claude Code clone"4  version: "1.0.0"5  description: "Multi-agent coding assistant."6  category: "developer-tools"78modules:9  filesystem:10    config:11      max_file_kb: 204812      read_before_edit: true13  shell:14    config:15      shell: bash16      allowed_roots:17        - "{{cwd}}"18        - "{{home}}"19  memory:20    config:21      working_memory: true22      todo_list: true23  agent_spawn: {}2425execution:26  mode: conversation27  entry_agent: coordinator2829behavior:30  profile: coding3132agents:33  - id: coordinator34    role: coordinator35    modules: [{agent_spawn: [Agent]}, {filesystem: [read, grep, glob]}, {memory: [todo_add, todo_update, set_goal]}]36    brain:37      provider: anthropic38      model: claude-sonnet-4-639      credential:40        ref: anthropic_main41        scope: per_user42        provider: anthropic43      config:44        api_key: "{{env.ANTHROPIC_API_KEY}}"45      temperature: 0.246      max_tokens: 819247    system_prompt: |48      You are a coordinator. Plan first, then execute.49      Delegate exploration to the explorer specialist via Agent(specialist='explorer', prompt='...').5051  - id: explorer52    role: specialist53    specialty: "Find files, grep symbols, sample contents"54    modules:55      - {filesystem: [read, grep, glob]}56      - {shell: [bash]}57    brain:58      provider: anthropic59      model: claude-haiku-4-560      credential:61        ref: anthropic_main62        scope: per_user63        provider: anthropic64      config:65        api_key: "{{env.ANTHROPIC_API_KEY}}"66      temperature: 0.067    system_prompt: |68      You explore codebases. Return only the key findings.69      No prose. Be FAST.

How it works

two agents, two brains
Coordinator on claude-sonnet-4-6 for the writing-and-deciding work. Explorer on claude-haiku-4-5 for the grep-and-summarise work. Each has its own tool surface scoped to what it needs.
shared modules across agents
filesystem and shell are declared at the top level so both agents read from the same _read_files set and the same workspace. The Agent tool dispatches the explorer with wait=false, the coordinator continues, then collects the result.
behavior profile for runaway protection
behavior.profile: coding ships sensible defaults including 'stop if the same file is edited 3 times in 5 turns' and 'inject a plan-first reminder if the agent skips the plan step'.
Read the deep dive

How to build a Claude Code clone in YAML

Read article
Newsletter

Get the next post in your inbox.

Engineering notes from the Digitorn team. No marketing, no launch announcements, no "10 prompts that will change your life". Just the things we write that we'd want to read.

One-click unsubscribe. We never share your address. Powered by our own infrastructure, not a tracker.

Other templates

developerStarter coder/templates/starter-coderresearchDeep research agent/templates/deep-researchmessagingSlack helper/templates/slack-helperdeveloperPull request reviewer/templates/pr-revieweropsWeekly digest reporter/templates/weekly-digestknowledgeDocumentation generator/templates/doc-writercreativeLive React app builder/templates/react-buildermessagingVoice assistant/templates/voice-assistantopsScheduled data pipeline/templates/data-pipeline