Every agent turn pays a tax before the model sees your actual task: a base system prompt, tool schemas, and default middleware baked into the harness. On July 29, 2026, LangChain cut that tax by roughly two-thirds.
Deep Agents v0.7 removes the framework's hidden base system prompt entirely, trims builtin tool descriptions by 43%, and turns off TodoListMiddleware by default. Combined, base input tokens on a default agent turn drop from ~6,000 to ~2,000 — a 65% reduction — with reward holding steady across LangChain's eval suite.
This follows the same trajectory as LangChain's earlier Deep Agents harness-engineering results on Terminal-Bench 2.0, where scaffolding changes — not model swaps — drove the benchmark gains. v0.7 applies that same "the harness is the product" thinking to trimming the harness itself.
TL;DR
| Question | Answer |
|---|---|
| What changed? | Base system prompt removed, tool descriptions trimmed 43%, TodoListMiddleware now opt-in |
| How much smaller? | Base input tokens ~6K → ~2K per default turn (65% fewer) |
| Does it hurt performance? | No measurable drop in reward across autonomous, conversational, and long-context evals |
| Is this backwards compatible? | No — see breaking changes below |
| Can I still use todos? | Yes, one line: middleware=[TodoListMiddleware()] |
| Can I override defaults? | Yes — pass middleware whose .name matches a default to replace it in place |
| Filesystem changes? | write_file now overwrites instead of erroring; paginated read_file; capped, streamed grep/glob |
| Install | uv pip install -U deepagents (Python) or npm install deepagents@latest (JS/TS) |
Why Trim the Harness Now
LangChain's framing is context engineering: a model is only as capable as the context it's given, and prompting guidance keeps shifting under harness builders' feet. Anthropic recently published its own updated context-engineering guide alongside a report that it cut over 80% of Claude Code's system prompt for newer models like Opus 5 and Fable 5, with no measurable coding-eval regression.
LangChain says two of Anthropic's findings mirrored what they saw building v0.7:
- Interfaces beat examples — well-designed tool schemas teach usage better than few-shot examples, which can narrow how a model explores its options.
- Avoid repetition — repeating an instruction in both the system prompt and a tool's description doesn't meaningfully reinforce it; it just burns tokens.
This is the same pattern explainx.ai covered in the loop engineering guide: as base models get better at following structured tool interfaces, hand-holding prose in the system prompt becomes dead weight the harness carries for no benefit.
The Three Changes Behind the 65% Cut
1. Removed base system prompt
Deep Agents used to ship a default system prompt with general guidelines and tool-usage prose baked into every agent by default. v0.7 removes it outright (#4859). Your own system prompt is no longer competing with — or getting diluted by — hidden framework prose underneath it.
2. Trimmed tool descriptions by 43%
Builtin tool descriptions were cut by 43% (#5009). Less prose per tool schema, repeated across every builtin tool, adds up fast across a multi-tool agent — this is where a meaningful chunk of the token savings comes from.
3. Opt-in todos
create_deep_agent no longer includes TodoListMiddleware by default (#4929). LangChain's evals showed the planning prompt and write_todos tool didn't significantly improve performance in most cases — so the default agent turn no longer pays for a tool call it usually doesn't need.
Together: ~6K → ~2K base input tokens, a 65% drop, on a default agent turn.
How LangChain Validated the Change
LangChain built a new eval suite around three categories, each targeting different agent work:
| Category | What it tests |
|---|---|
| Autonomous | End-to-end tasks — coding, data analysis |
| Conversational | Multi-turn conversation with a simulated user |
| Long-context | Retrieval and reasoning over long context |
They ran v0.7 against the v0.6.12 baseline across all three categories on four models: gpt-5.6-luna, gemini-3.6-flash, claude-sonnet-4-6, and claude-opus-4-8.
Results: Reward held steady overall, tokens and cost generally dropped. gpt-5.6-luna saw the clearest win — tokens down 34%, cost down 15%, reward up 4%. claude-sonnet-4-6 was the exception, with a cost increase traced to two difficult autonomous tasks in LangSmith traces.
One caveat worth stating plainly: reward confidence intervals span zero for every model in LangChain's own report. Only Luna and Opus show statistically clear token reductions, and only Luna shows a statistically clear cost reduction. The honest read is "no measurable regression," not "proven uplift" — still a good trade if you're paying per token on every agent turn.
When to Turn Todos Back On
TodoListMiddleware still earns its keep in three cases, per LangChain:
- Long, multi-step tasks — an explicit plan helps an agent stay on track across many turns.
- Less capable models — need more scaffolding to avoid losing the thread.
- UI-facing use cases — where a visible plan and progress matter as much as execution.
If you're in one of those buckets, re-enabling it is one line:
from deepagents import create_deep_agent
from deepagents.middleware import TodoListMiddleware
agent = create_deep_agent(
model="anthropic:claude-sonnet-5",
middleware=[TodoListMiddleware()],
)
Full Control Over Middleware
Configurability was the top user request over the last six months — overriding FilesystemMiddleware, customizing SummarizationMiddleware thresholds, or replacing the base prompt globally all hit the same wall: no supported way to change what the default harness stack does.
v0.7 fixes this with a simple rule: pass a middleware= instance whose .name matches a default, and it replaces that default in place instead of erroring on a duplicate (#4251).
from deepagents import create_deep_agent
from deepagents.middleware import SummarizationMiddleware
agent = create_deep_agent(
model="anthropic:claude-sonnet-5",
middleware=[
SummarizationMiddleware(
model="fireworks:accounts/fireworks/models/kimi-k3",
trigger=("fraction", 0.5), # summarize at 50% instead of 85%
summary_prompt="Summarize the conversation so far, keeping any file paths and decisions verbatim...",
),
],
)
By default, SummarizationMiddleware triggers once a conversation crosses 85% of the context window using a generic summarization prompt. Different applications need different triggers and prompting — this same override pattern works for any other builtin default, including prompt-caching TTLs.
One power user quoted in LangChain's release notes summed up the prior pain: "We [used to do] some hacky stuff to remove some of the default middleware. Overriding middleware is a very welcome addition."
Filesystem Performance
The filesystem is Deep Agents' core context-management layer — the environment agents read, write, and navigate state through. v0.7 tunes it based on the same eval suite plus real agent trajectories across open and closed models:
| Change | Behavior |
|---|---|
write_file | Now overwrites an existing file instead of erroring (#4109) |
read_file | Paginated — reports total/remaining lines plus the next offset (#4540) |
grep / glob | Return partial results with a truncated flag instead of hanging on large trees (#4063, #4570, #4706) |
grep | Also gains a 1,000-match cap, streamed output, and optional context lines |
For any agent doing repo-scale exploration — the same class of work covered in explainx.ai's coding-agent evals on real repos — a grep that hangs on a large monorepo instead of truncating gracefully is a real production failure mode. v0.7 closes that gap.
Breaking Changes
v0.7 removes some compatibility shims and changes default behaviors — don't upgrade blind:
TodoListMiddlewareis no longer on by default (#4929) — opt-in viaTodoListMiddleware().- Backend factories removed — deprecated since v0.5, now fully replaced by concrete
BackendProtocolinstances (#4541). Other v0.5 file-format/backend-protocol deprecations are also removed. deletetool added to the default filesystem tool list —FilesystemMiddlewareaccepts a tool allowlist if you want to opt out (#4325, #4698).
LangChain's changelog includes full migration notes and an "upgrade" prompt written specifically for coding agents to run against your codebase.
What This Means If You're Building on Deep Agents
If you're running Deep Agents in production, the practical checklist is short:
- Audit your custom system prompt — it no longer competes with hidden framework prose, so trim anything that was compensating for the old defaults.
- Decide on todos per use case — leave off for short autonomous tasks, turn on for long multi-step work or UI-facing plans.
- Retune
SummarizationMiddlewareif you were hitting context limits before the default 85% trigger — this is now a one-line override instead of a fork. - Re-test
grep/glob-heavy agents against the new truncation and match-cap behavior if you depended on exhaustive results.
This is part of a broader 2026 pattern explainx.ai has tracked across agent harness engineering: as base models get more capable at following structured interfaces without hand-holding, the harnesses that win are the ones willing to delete code, not just add features.
Related Reading
- Agent Harness Engineering: When the Model Stays Fixed and the Scaffolding Wins
- What Is an Agent Harness? Complete Guide
- Context, Prompt, Loop: The Harness Engineering Stack
- Loop Engineering: Coding Agent Loops Guide
- Context Engineering: Clean Prompts Generator
- ByteDance DeerFlow 2: Super Agent Harness on LangGraph
- Multi-Agent Orchestration Patterns Guide
Sources: LangChain blog — "Deep Agents v0.7" by Sydney Runkle, July 29, 2026; deepagents v0.7.0 release notes. Stats and version details accurate as of July 29, 2026.
