Deep Agents: LangChain Just Open-Sourced a Replica of Claude Code
Exploring Deep Agents: An Open-Source LangChain Framework for Coding Agents Inspired by Claude Code
Originally published on Medium.
LangChain Deep Agents: Claude Code Clone -- A retro pixel art dinosaur coding agent on a dark terminal, surrounded by floating tool icons connected with glowing lines in LangChain green on dark background
Exploring Deep Agents: An Open-Source LangChain Framework for Coding Agents Inspired by Claude Code
Dive into the world of coding agents with LangChain's newly open-sourced Deep Agents! Discover how this powerful toolkit can elevate your development workflow, whether you're curious about agent architecture or just looking to enhance your coding efficiency. Don't miss out on exploring the future of AI-driven coding! #LangChain #DeepAgents #OpenSource
Summary: LangChain has open-sourced Deep Agents, a replica of Claude Code, designed to facilitate coding agents with a customizable framework. It includes features like task planning, file system tools, sandboxed shell access, and sub-agents for parallel tasks. The system promotes smart defaults for agent behavior, automatic context management, and built-in observability. Deep Agents supports both Python and TypeScript, making it versatile for developers seeking an open-source alternative to proprietary solutions like Claude Code.
LangChain just open-sourced a replica of Claude Code.
It is called Deep Agents (v0.4.11, MIT), and it recreates the core workflow behind coding agents like Claude Code in an open system you can inspect, modify, and extend. The LangChain team built it on top of LangGraph, taking inspiration from Claude Code, Perplexity Deep Research, and Manus.
If you are curious how coding agents actually work under the hood, this is the repo to read.
What Is an Agent Harness?
Every team that builds a coding agent from scratch wires up the same primitives: file access, shell execution, task planning, context management, sub-agents for parallel work. This is not domain logic. It is scaffolding. Boilerplate for agents.
An agent harness ships that scaffolding as defaults. You get a working agent on first run and customize from there.
That is deepagents.
What Ships in the Box
Deep Agents -- Batteries Include Agent Harness
Planning: write_todos
Before acting, the agent plans. write_todos gives it a structured way to break down tasks, track progress, and reason about next steps. If you have used Claude Code, this maps directly to its task tracking. Think first, act second.
Filesystem: Seven Tools for Working with Code
read_file("src/api/handlers.py")
write_file("src/api/handlers.py", new_content)
edit_file("src/api/handlers.py", old_str, new_str)
ls("src/api/")
glob("**/*.py")
grep("class.*Handler", "src/")
Reading, writing, targeted edits, directory listing, glob pattern search, content search by regex. The full toolkit for navigating and modifying a codebase.
Shell: execute with Sandboxing
execute("pytest tests/")
execute("pip install -r requirements.txt")
execute("git diff HEAD~1")
Direct shell access with a sandboxing layer. The agent can run tests, install dependencies, and check git history. It is not a root shell handed to an LLM.
Sub-Agents: task with Isolated Context Windows
This is the most interesting piece.
task("Research the deepagents API and summarize key interfaces")
task("Write unit tests for the new FileProcessor class")
Each task call spawns a sub-agent defined as:
{
"name": "researcher",
"description": "Researches topics and returns summaries",
"system_prompt": "You are a research assistant...",
"tools": [read_file, grep, glob]
}
The sub-agent gets an isolated context window: a clean slate with just the task description, not the main agent's full conversation history. You can also wrap compiled LangGraph graphs directly as CompiledSubAgent objects for more complex sub-agent behavior.
Main Agent and SubAgents
This is how you tackle genuinely large problems without context limits collapsing the main thread.
Smart Defaults: Prompts That Teach the Model
deepagents ships system prompts that teach the model how to use its tools: plan before acting, search before writing, delegate to sub-agents for parallel work. These behaviors are defaults, not configuration tasks for you.
Context Management: Zero-Config Auto-Summarization
Introduced in v0.2, auto-summarization runs as middleware with no configuration required. When the conversation gets long, it compresses older history automatically. When tool output is large, it offloads to a file and keeps a reference in context.
Lean Context Management Flow
Observability from Day One
LangSmith tracing requires two environment variables and nothing else:
export LANGSMITH_API_KEY=your_key
export LANGSMITH_TRACING_V2=true
Every run is traced: what the agent planned, what tools it called, what each tool returned, where it failed. No code changes. No instrumentation work.
MCP tool support follows the standard mcp_server_tools bridging pattern. Any MCP-compatible tool server works: databases, APIs, custom services.
Python and TypeScript
deepagents ships for both ecosystems:
Python:
pip install deepagents
deepagents
TypeScript (deepagentsjs):
npm install deepagents
import { createDeepAgent } from "deepagents";
const agent = createDeepAgent({ tools: [...] });
Same harness architecture, both languages.
How It Compares to Claude Code
Both converge on the same primitive set. The differences are in orientation:
| Feature | Deep Agents | Claude Code |
|---|---|---|
| Model | Any LangChain provider (100s) | Claude: Opus, Sonnet, Haiku |
| Planning | write_todos | Task tracking |
| Filesystem | 6 tools | Read, Write, Edit, Glob, Grep |
| Shell | execute (sandboxed) | Bash (sandboxed) |
| Sub-agents | task (isolated context) | Agent tool |
| Context Management | Auto-summarization + file offload | Auto-compression |
| Observability | LangSmith (built-in) | Claude Code hooks |
| Extension | MCP + LangGraph | MCP + Skills |
| Underlying Framework | LangGraph | Proprietary |
| License | MIT | Proprietary |
For teams committed to Anthropic, Claude Code is excellent. For teams that want to run across multiple models, inspect the internals, or build on an open stack, deepagents is the better starting point.
Why This Repo Is Worth Reading Even If You Do Not Use It
If you want to understand how Claude Code, Cursor, or Devin are structured, deepagents is a clean open-source reference. The implementation shows you:
- How planning loops work
- How tool-calling cycles are structured
- How context compression is handled in practice
- How sub-agent delegation patterns are implemented
The tooling around coding agents is converging on the same primitives. deepagents shows you what those primitives are, in code you can read.
Are you building on deepagents, LangGraph, or rolling your own? What would you add to the default toolkit? Drop a comment.
Follow for more coverage of agent frameworks and developer tooling.
#LangChain #AIAgents #DeepAgents #DeveloperTools #LLM #AgentEngineering #OpenSource
Further Reading -- LangChain Articles
- LangChain Deep Agents: Real-World Use Cases and the Democratization of AI Agents -- Rick Hightower, March 21, 2026
- LangChain's Harness Engineering: From Top 30 to Top 5 on Terminal Bench 2.0 -- Rick Hightower, March 21, 2026
- The Agent Framework Landscape: LangChain Deep Agents vs. Claude Agent SDK -- Rick Hightower, March 20, 2026
- LangChain Deep Agents: Harness and Context Engineering: Memory, Skills, and Security -- Rick Hightower, March 18, 2026
- Introduction to LangChain Deep Agents and the Shift to "Agent 2.0" -- Rick Hightower, March 15, 2026
- From Chatbots to AI Agents: Building Real-Time, Tool-Using Systems with LangChain -- Rick Hightower, February 26, 2026
- LangChain and MCP: Building Enterprise AI Workflows with Universal Tool Integration -- Rick Hightower, June 23, 2025
- LangChain: Building Intelligent AI Applications with LangChain -- Rick Hightower, June 10, 2025
About the Author
Rick Hightower is a technology executive and data engineer who led ML/AI development at a Fortune 100 financial services company. He created skilz, the universal agent skill installer, supporting 30+ coding agents including Claude Code, Gemini, Copilot, and Cursor, and co-founded the world's largest agentic skill marketplace. Connect with Rick Hightower on LinkedIn or Medium. Check out SpillWave, your source for AI expertise.
Rick has been actively developing generative AI systems, agents, and agentic workflows for years. He is the author of numerous agentic frameworks and developer tools and brings deep practical expertise to teams looking to adopt AI.