Home / Articles

Deep Agents Explained: Is It Really Claude Code's Architecture, Free?

LangChain's Deep Agents gives you the pattern behind Claude Code under an MIT license. Here is what the defaults, memory, costs and model support really mean.

Publisher: REACTAPP.TOP6 min read1353 words

This article is published in English.

Sources: Deep Agents: Did LangChain Open-Source Claude Code’s Architecture?

A post making the rounds claims that LangChain has open-sourced the architecture behind Claude Code, MIT licensed, any model, zero dollars. It's a catchy pitch. Why pay for a premium subscription when a free harness does the same thing? The claim isn't fake and it isn't wrong. It's roughly seventy percent true, and the missing thirty percent is what tends to frustrate people. Here is the fine print, so the decision can be an informed one.

Did they open-source Claude Code's architecture?

Sort of. LangChain open-sourced the pattern, not Claude Code itself. Deep Agents is an agent harness built on LangGraph that packages four ideas: a long system prompt, a planning tool, a file system and subagents. The MIT license is real and it works with any tool-calling model.

But it isn't free to run, the file system is virtual by default and long-term memory stays off until you wire it up. Want the architecture? It's yours to take. Want Claude Code? Keep using that.

What it is

Remove the marketing and Deep Agents is a bundle of middleware on top of LangGraph.

pip install deepagents
from deepagents import create_deep_agent
agent = create_deep_agent(
    model="openai:gpt-5.5",  # or anthropic:..., google_genai:..., a local one
    tools=[my_tool],
    system_prompt="You are a research assistant.",
)That’s real. It works. You get planning, a virtual file system, subagent delegation, human-in-the-loop, and shell access — plus everything LangGraph already gave you (streaming, checkpointing, Studio).

That works. You get planning, a virtual file system, subagent delegation, human-in-the-loop approval and shell access, plus whatever LangGraph already offers: streaming, checkpointing and Studio.

The interesting part isn't the code. It's that LangChain wrote down, publicly, what a deep agent consists of:

  1. A long, detailed system prompt
  2. A planning tool
  3. A file system
  4. Subagents

That is the whole recipe. For a year people treated this as a trade secret, and that's changing.

Detail one: the planning tool does nothing

The write_todos tool doesn't schedule or execute anything. It stores a to-do list in the agent's state and stops there. LangChain admits this in its own announcement about the tool it copied from Claude Code, calling it effectively a no-op and a context engineering strategy to keep the agent on track.

Why keep it? Putting the plan in writing feeds it back into the model's context. Each turn the list gets reread, which keeps the agent from wandering. That's the mechanism. It isn't orchestration, it's a sticky note. Once that's clear, much of what gets called advanced agent architecture reads as context engineering with good PR.

There's a twist too. Planning first is the headline bullet in every post about the project, yet as of version 0.7 task planning is opt-in. It used to be default middleware and isn't now. The feature everyone leads with is the one you must switch on yourself.

Detail two: the file system isn't yours

The pitch says file system access, and you imagine your project folder. The default backend is StateBackend, where files live inside LangGraph state, scoped to a thread, shared with no other thread and absent from your disk. The agent will happily write a file, read it back and feel productive. Then the thread ends and the files are gone unless a checkpointer persisted them.

For real disk access you want FilesystemBackend. For a shell as well, LocalShellBackend. To keep files across conversations, use StoreBackend, or CompositeBackend to route a /memories/ path somewhere durable while the rest stays thread-scoped. None of it is hard, but each is a decision you didn't know you were making.

Detail three: long-term memory is a setting

The same story applies to memory. It's listed as if included, in the way a car includes a trailer hitch: the mount exists and the trailer doesn't. The default is thread-scoped. Recall across threads needs a store backend. Demo it in a notebook, restart the kernel, ask what you decided yesterday, and the answer is a confident blank.

Detail four: human-in-the-loop needs a checkpointer

The docs are blunt. A checkpointer is required, because without one there's no state to freeze and no interrupt to resume. Resuming also isn't calling agent.invoke() again. After inspecting the interrupt, assemble a decisions list matching the pending actions one-to-one and in sequence, then resume via Command(resume={"decisions": decisions}) on the same thread ID. A wrong thread ID, wrong order or missing checkpointer and the approval flow quietly approves nothing.

Detail five: subagents and version pinning

This one is fixed, but it teaches something. Say you set recursion_limit=300 on the parent agent for a long task. For a while, SubAgentMiddleware didn't pass that config down, so subagents ran at LangGraph's default of 25. A subagent needing 40 steps would hit 25 and raise GraphRecursionError, which surfaced upstream as asyncio.CancelledError. That looks like a cancellation, not a limit, and it's miserable to debug late at night.

That was issue #1698 in the deepagents repository, filed in March 2026. Subagents now inherit the parent's limit, and you can set it with agent.with_config({"recursion_limit": 100}).

The reason to mention it: the fix landed in late March and the package was at 0.7.x by August. The project moves quickly, defaults move with it, and many blog posts describe versions that no longer exist. Pin your version and read the changelog before trusting a tutorial.

About the zero dollars

The license costs nothing. MIT, genuinely, no asterisk. Running it is a different matter. You bring your own model key and pay per token, and this architecture is designed to spend tokens:

  • A long system prompt on every turn
  • The to-do list reread every turn, once planning is turned on
  • Every subagent is its own full model invocation
  • Summarization is another model call, over your own context

Compared with a plain tool-calling loop, a deep agent burns more. That's the trade: you buy focus on long tasks with tokens. It's a fair deal as long as nobody budgets it as free.

The real savings are in flexibility. You can put a cheap model on the dull subagents and a strong one on the reasoning, a lever Claude Code doesn't offer.

About any model

True, with two footnotes. It works with any model that supports tool calling, which is a long list. The prompts, though, were tuned around Claude Code's habits, so the design carries that bias. A weaker or local model doesn't give a proportionally weaker agent. It gives one that neglects its task list, delegates to subagents needlessly and gets stuck going in circles.

The second footnote is quietly costly: prompt caching is on by default only for Anthropic and Bedrock models. On Claude, that big system prompt is cached. On another model you may pay full price for it every turn. Model-agnostic means it runs anywhere, not that it behaves or costs the same everywhere, so budget real evaluation time for any swap.

Worth trying?

An honest disclaimer first: none of this comes from production use. It's a careful read of the docs, the repository and the issue tracker, not months of experience. Two things stand regardless.

First, the most valuable thing LangChain shipped isn't the package, it's the plan. Four pillars, stated plainly, under an MIT license. You could build that yourself in an afternoon and understand every line, and for a single-purpose agent you probably should.

Second, a free clone of some product seldom turns out to be that product. What you get is the pieces, plus the job of tuning them yourself. Sometimes that's exactly right, and sometimes you just want the thing to work. Worth knowing before the pip install.