[FEATURE] Agent Team members lack context compression/trimming — quickly exhaust context window and become unmanageable

Resolved 💬 3 comments Opened Apr 17, 2026 by yingchousun Closed May 25, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Problem

When using Claude Code's Agent Team feature (multi-agent/cowork), team member agents have no mechanism to compress, summarize, or clean up their own context windows. As tasks execute over time, the members' context windows fill up rapidly and eventually hit the limit.

Once a team member's context is full:

  1. The member becomes unresponsive — it can no longer process new information or continue working on its assigned task.
  2. The lead agent cannot clean up members — there is no way for the orchestrating agent to trim, compact, or reset a team member's context.
  3. The team member cannot self-manage — members lack any built-in context compaction or summarization capability (unlike the main agent which has auto-compaction).

This makes long-running multi-agent workflows unreliable. Teams that need to perform extended tasks (e.g., large refactors, multi-file analysis, long test suites) frequently stall because one or more members run out of context.

Expected Behavior

Team member agents should have one or more of the following capabilities:

  • Auto-compaction: Periodically summarize and compress their own conversation history, similar to how the main agent handles context overflow.
  • Manual context cleanup: Allow the lead agent (or user) to trigger context compression on a specific team member.
  • Context-aware truncation: When approaching the context limit, members should automatically trim older, less relevant context while preserving critical task state.

Current Workaround

None that I am aware of. The only option is to restart the entire team or replace the stuck member, which loses all accumulated progress and state.

Environment

  • Claude Code version: latest
  • OS: macOS
  • Feature affected: Agent Teams / Cowork / Multi-agent

Additional Context

This is a significant limitation for anyone using Agent Teams for real-world tasks that require sustained operation. The main agent's auto-compaction works well — extending a similar mechanism to team members would make the multi-agent workflow much more practical and reliable.

Proposed Solution

Team member agents should have one or more of the following capabilities:

  • Auto-compaction: Periodically summarize and compress their own conversation history, similar to how the main agent handles context overflow.
  • Manual context cleanup: Allow the lead agent (or user) to trigger context compression on a specific team member.
  • Context-aware truncation: When approaching the context limit, members should automatically trim older, less relevant context while preserving critical task state.

Alternative Solutions

_No response_

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗