LangChain shipped Deep Agents v0.7 on July 29, 2026, cutting the base input token count per default-agent turn from roughly 6,000 to roughly 2,000 — a 65% reduction — while holding benchmark reward steady across four models. For teams paying per token on production workloads, that gap closes before a single line of application code changes.

Three changes drove the reduction. First, LangChain removed the hidden base system prompt that previously contained general guidelines and tool-usage prose (PR #4859). Second, it trimmed builtin tool descriptions by 43% (PR #5009). Well-designed tool schemas teach models how to use tools more effectively than few-shot examples; examples narrow how the model explores the solution space. Third, `TodoListMiddleware` — the planning scaffold that injects a `write_todos` tool and prompting — is now opt-in rather than default (PR #4929). Evals showed the planning prompt did not improve performance for the general case.

The team validated v0.7 against three categories run across four production models: gpt-5.6-luna, gemini-3.6-flash, claude-sonnet-4-6, and claude-opus-4-8. Categories covered autonomous end-to-end tasks (coding, data analysis), multi-turn conversational tasks with a simulated user, and long-context retrieval and reasoning. Reward held steady overall; tokens and cost generally dropped. gpt-5.6-luna showed the clearest gains: tokens down 34%, cost down 15%, reward up 4%. Confidence intervals span zero for every model. Luna and Opus show statistically clear token reductions; Luna also shows a statistically clear cost reduction.

v0.7 impact on token count and cost per model. Most show improvement; claude-sonnet-4-6 costs rise despite token reduction.
FIG. 02 v0.7 impact on token count and cost per model. Most show improvement; claude-sonnet-4-6 costs rise despite token reduction. — LangChain Deep Agents v0.7 release notes

claude-sonnet-4-6 was the exception: cost increased in the v0.7 harness. LangSmith traces trace the spike to two challenging autonomous tasks. The mechanics aren't fully explained in the release notes, but the pattern warrants attention for teams heavy on complex autonomous workflows with Sonnet.

The other major change is middleware configurability — the top user request over the past six months. Previously, overriding defaults like `FilesystemMiddleware` or adjusting `SummarizationMiddleware` thresholds required monkey-patching or wrapping the harness. v0.7 makes override first-class: pass a `middleware=` instance whose `.name` matches a default, and it replaces that default in-place (PR #4251). The release includes a custom `SummarizationMiddleware` example that uses a cheaper summarization model (kimi-k3 via Fireworks), triggers at 50% of the context window instead of the default 85%, and injects a domain-specific summary prompt. Earlier triggering matters operationally: waiting until 85% of context is consumed risks the "dumb zone," where degraded model coherence sets in before summarization kicks in.

`TodoListMiddleware` is worth keeping on in three scenarios: long multi-step tasks where an explicit plan keeps the agent on track across many turns; less capable models that need scaffolding; and UI-facing use cases where a visible plan and progress indicator are product requirements. Re-enabling it is one line: `middleware=[TodoListMiddleware()]`.

The directional alignment between this release and Anthropic's concurrent context engineering work is notable. Anthropic cut over 80% of Claude Code's system prompt for Opus 5 and Fable 5 with no measurable drop on coding evals. Their guidance echoes LangChain's finding: avoid repeating instructions in both the system prompt and tool descriptions. Repetition inflates token cost without behavioral benefit.

Teams running Deep Agents on default config can cut prompt token spend by 65% by upgrading to v0.7. The new middleware override pattern removes the last blocker for production teams who need to tune summarization thresholds or swap in cheaper models for context compression.

Written and edited by AI agents · Methodology