Lesson 3: dcode vs Claude Code
Understanding the similarities, differences, and when to use each
Side-by-Side Architecture
Architectural Comparison
(7+ providers)"] D_MODEL["Any LLM
provider:model"] end subgraph CLAUDE["Claude Code"] C_USER["~/.claude/"] C_AGENTS["CLAUDE.md"] C_SKILLS2["skills/"] C_STATE2["JSON state"] C_LOOP2["Agent Loop"] C_LOCAL["Local Execution"] C_MODEL2["Claude Models
(Opus, Sonnet, Haiku)"] end D_USER --> D_AGENTS D_USER --> D_SKILLS D_USER --> D_STATE D_LOOP --> D_SANDBOX D_LOOP --> D_MODEL C_USER --> C_AGENTS C_USER --> C_SKILLS2 C_USER --> C_STATE2 C_LOOP2 --> C_LOCAL C_LOOP2 --> C_MODEL2 style DCODE fill:#e8f5e9,stroke:#76b900,stroke-width:2px style CLAUDE fill:#e3f2fd,stroke:#1a5fb4,stroke-width:2px
Feature Comparison Matrix
Similarities (What They Share)
| Feature | dcode | Claude Code |
|---|---|---|
| Form Factor | Terminal CLI | Terminal CLI |
| Instructions File | AGENTS.md | CLAUDE.md |
| Skills Framework | ~/.deepagents/skills/ | ~/.claude/skills/ |
| Human-in-the-Loop | Approval controls | Permission system |
| MCP Integration | Full support | Full support |
| Context Management | Compaction | Summarization |
| Subagent Delegation | Supported | TaskCreate |
| Persistent Memory | Cross-session | Cross-session |
Differences (What Sets Them Apart)
| Aspect | dcode | Claude Code |
|---|---|---|
| Model Support | Any LLM (provider:model format) | Claude only (Opus, Sonnet, Haiku) |
| Sandbox Support | 7+ providers (LangSmith, Modal, E2B...) | Local + optional worktree |
| Tracing/Observability | Native LangSmith | None built-in |
| Programmatic API | create_deep_agent() SDK | CLI only |
| Session State | SQLite database | JSON files |
| Harness Tuning | Per-model optimization | Fixed for Claude |
| Governed Runtime | OpenShell kernel-level | Local permissions |
| Cost at Scale | 10x cheaper (with Nemotron) | Claude API pricing |
The Sandbox-as-Tool Pattern
This is the key architectural difference that enables remote sandboxing in dcode:
dcode: Sandbox-as-Tool Pattern
(LLM loop, memory, dispatch)"] end subgraph REMOTE["Remote Sandbox"] FS["Filesystem
read_file, write_file"] EXEC["Execution
shell commands"] TESTS["Testing
run tests"] end LOOP -->|"Tool calls"| FS LOOP -->|"Tool calls"| EXEC LOOP -->|"Tool calls"| TESTS style LOCAL fill:#e8f5e9,stroke:#76b900,stroke-width:2px style REMOTE fill:#e3f2fd,stroke:#1a5fb4,stroke-width:2px
"Deep Agents Code uses the 'sandbox as tool' pattern: the dcode process (LLM loop, memory, tool dispatch) runs locally, but agent tool calls (read_file, write_file, execute, etc.) target the remote sandbox, not the local filesystem." — LangChain Remote Sandboxes
Claude Code: Local Execution Pattern
(LLM loop, memory, dispatch)"] FS2["Local Filesystem
read_file, write_file"] EXEC2["Local Execution
shell commands"] TESTS2["Local Testing
run tests"] end LOOP2 -->|"Tool calls"| FS2 LOOP2 -->|"Tool calls"| EXEC2 LOOP2 -->|"Tool calls"| TESTS2 style LOCAL2 fill:#e3f2fd,stroke:#1a5fb4,stroke-width:2px
Configuration Comparison
dcode Configuration
# ~/.deepagents/config.toml
default_model = "nvidia:nemotron-3-ultra"
sandbox_provider = "langsmith"
# Resolution order:
# 1. DEEPAGENTS_CODE_* env var (highest)
# 2. Canonical env var
# 3. ~/.deepagents/config.toml
# 4. Built-in default (lowest)
Claude Code Configuration
// ~/.claude/settings.json
{
"model": "claude-sonnet-4-20250514",
"permissions": {
"allow": ["Bash(git *)"],
"deny": []
}
}
// Resolution order:
// 1. settings.local.json (highest)
// 2. settings.json
// 3. Built-in defaults (lowest)
Directory Structure Comparison
dcode Directory Structure
~/.deepagents/
├── .state/
│ ├── sessions.db # SQLite for checkpoints
│ └── history.jsonl # Command history
└── {agent}/
├── AGENTS.md # User instructions
├── skills/ # User-level skills
└── agents/ # Subagent definitions
{project}/
├── AGENTS.md # Project instructions (root)
└── .deepagents/
├── AGENTS.md # Project instructions (preferred)
├── skills/ # Project skills
└── agents/ # Project subagents
Claude Code Directory Structure
~/.claude/
├── settings.json # User settings
├── keybindings.json # Key customizations
├── CLAUDE.md # Global instructions
├── skills/ # User skills
└── projects/ # Project state
{project}/.claude/
├── settings.json # Project settings
├── settings.local.json # Local overrides (gitignored)
└── CLAUDE.md # Project instructions
When to Choose Which
Choose dcode / NemoClaw When:
- Model flexibility needed - Switch providers, self-host, optimize costs
- Enterprise governance - Kernel-level policy enforcement required
- Observability required - Native LangSmith tracing for debugging
- Remote sandbox required - Security isolation from local machine
- Custom harness tuning - Optimize scaffolding for specific models
- Regulatory compliance - Auditable, provable security controls
- Cost optimization - 10x cheaper with Nemotron vs closed models
Choose Claude Code When:
- Best Claude experience - Harness tuned specifically for Claude
- Local execution sufficient - Don't need remote sandbox isolation
- Simpler permission model - Local permissions adequate for your needs
- Anthropic ecosystem - Already invested in Claude-specific workflows
- Rapid development - No sandbox overhead, immediate execution
- Personal projects - Don't need enterprise governance features
The NemoClaw Advantage
When you combine dcode with NemoClaw's OpenShell runtime, you get capabilities neither tool has alone:
NemoClaw Stack Advantages
Tune, run, optimize Nemotron"] ADV2["Full Stack Control
Tools, context, evals, runtime, policies"] ADV3["10x Cost Efficiency
$4.48 vs $43.48 benchmark"] ADV4["Kernel-Level Security
Landlock LSM, deny-by-default"] ADV5["Multi-Cloud Portability
Cloud, on-prem, RTX, DGX"] end style NEMOCLAW fill:#e8f5e9,stroke:#76b900,stroke-width:2px
"Teams need full control over tools, context, evaluation methods, runtime location, and action policies - closed ecosystems prevent this. Companies need to own that work, improve it over time, and run agents with the controls their organizations require." — LangChain Blog
Benchmark Comparison
| Configuration | Aggregate Score | Cost | Cost Efficiency |
|---|---|---|---|
| Nemotron 3 Ultra + dcode | 0.86 | $4.48 | Baseline |
| Next closest alternative | ~0.86 | $43.48 | ~10x more expensive |
Source: LangChain NemoClaw Benchmark
Knowledge Check
Primary Source Reading
Recommended Reading
LangChain DeepAgents Code Overview
https://docs.langchain.com/oss/python/deepagents/code/overview
This page covers dcode's architecture, sandbox providers, and configuration in detail.