Skip to content

[BUG] High memory usage (~13-16 GB) when using Team/Teammate mode #23883

@alexeyshibanov

Description

@alexeyshibanov

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code process consumes ~13 GB of RAM when running a session with Teammate mode (multi-agent teams via TeamCreate / Task with team_name). Upon closing the session, memory usage spikes to ~16 GB before the process terminates.

What Should Happen?

Memory usage should remain reasonable (under 2-4 GB) even during multi-agent sessions, with proper cleanup of agent contexts when they go idle or shut down.

Error Messages/Logs

Steps to Reproduce

  1. Start a Claude Code session
  2. Create a team using TeamCreate and spawn multiple teammates via Task tool (I used just 3 teammates and teamlead)
  3. Work with the team for a moderate session (~30-60 min)
  4. Observe memory usage in Task Manager — it grows to ~13 GB
  5. Close/exit the session — memory spikes to ~16 GB before process exits

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.34 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Image
  • Node.js version: v22.22.0
  • RAM: 32 GB total
  • Single-agent (non-team) sessions do not exhibit this level of memory usage
  • The issue appears to be related to agent context accumulation — each teammate likely retains its full conversation history in memory without compaction or disposal

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions