Guide

Context management for a multi-bot assistant setup

Published 16 Nov 2026 · Problem, method and result · Every source is a checked official link

All guides · All case studies

Problem

A personal assistant setup uses one primary router bot, teammate bots, and background workers. It also uses scheduled routines, long chats, memory notes, skills, and Claude Code on a subscription. Context grows in each of these places. Stale tool results, full chat histories, and long dispatch briefs fill the window. Quality decreases, and some workflows stop when the context is exhausted.

Anthropic offers two API features for this class of problem. These features are context editing and the memory tool. The official announcement states "In a 100-turn web search evaluation, context editing enabled agents to complete workflows that would otherwise fail due to context exhaustion—while reducing token consumption by 84%." A second official result is separate. On an internal evaluation set for agentic search, context editing alone improved performance by 29% over baseline. The memory tool plus context editing improved performance by 39% over baseline.

Applicability

Context editing and the memory tool are Anthropic API features. They apply directly only where a stack calls the Claude API with those features. Grok Bot and a Claude Code subscription manage context in their own products. In those products, only the principles transfer.

The 84% figure is an official Anthropic result for that internal 100-turn web search evaluation with context editing. Anthropic does not publish the full method, the exact baseline token count, or the model configuration. The 84% figure does not automatically apply to Grok Bot or to Claude Code. It also does not apply to a multi-bot setup without those API features.

Method

  1. Give each task a fresh session. Do not continue a long router chat when a worker can start with a short brief.
  2. Keep dispatch briefs short. Include the goal, the sources, the approval limits, and the output format. Do not paste a full prior transcript.
  3. Offload durable facts to memory notes or to files, not only to the chat. In Grok Bot, ask the Bot to remember stable rules, and keep numbers that change in the source system. Where you call the Claude API with the memory tool, Claude can write and read files under /memories.
  4. Clear stale tool results after you record the facts that matter. Where you call the Claude API with context editing, use clear_tool_uses_20250919 past your threshold. In Grok Bot and in Claude Code, use the product's own context tools. Do not resend raw results that you can fetch again.
  5. For a long chat that must continue, write a short summary of decisions and open items. Then continue from that summary.
  6. Trim saved context. Keep skills and memory notes short, and do not load every note into every turn.
  7. Let the primary router delegate work to a worker or a teammate bot, and take back a short result.
  8. If you call the Claude API directly, enable context editing and the memory tool there. Do not assume that Claude Code or Grok Bot turns those API features on for you.

Result

The active context for each bot stays short and relevant. Workers start from a clean brief. Durable facts live in memory or in files, not only in a long chat. Workflows can continue for more turns without a context overflow. Token use can decrease, but there is no sourced percentage for this setup. Do not claim an 84% reduction here.

Sources

  1. Anthropic, Managing context on the Claude Developer Platform: https://claude.com/resources/articles/context-management
  2. Anthropic, Context editing: https://platform.claude.com/docs/en/build-with-claude/context-editing
  3. Anthropic, Memory tool: https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool

More write-ups: case studies. Related study: context rot.