Memory system
Location:src/memdir/
Claude Code’s persistent memory is based on CLAUDE.md files. These plain Markdown files are read at session start and injected into the context, giving Claude awareness of project conventions, user preferences, and previously captured facts.
Memory hierarchy
- Project memory
- User memory
- Extracted memories
- Team memory sync
File:
CLAUDE.md in the project rootStores project-specific facts, coding conventions, architecture decisions, and team norms. Committed to version control so the whole team benefits.Managing memory
/memory command
View, edit, and clear memory entries directly from the REPL.
remember skill
Invoke the
remember skill to explicitly persist a fact from the current session to memory.useMemoryUsage hook
The
useMemoryUsage React hook tracks how much of the context window is consumed by memory content.Task system
Location:src/tasks/
The task system manages background and parallel work items — shell commands, local agents, remote agents, and parallel teammate processes.
Task types
LocalShellTask
LocalShellTask
Location:
src/tasks/LocalShellTask/Executes a shell command in the background. The main session continues while the command runs, and output is captured for later retrieval.LocalAgentTask
LocalAgentTask
Location:
src/tasks/LocalAgentTask/Runs a sub-agent locally. The sub-agent has its own context and tool access, operating independently from the main session.RemoteAgentTask
RemoteAgentTask
Location:
src/tasks/RemoteAgentTask/Runs an agent on a remote machine. Enables distributing work across multiple hosts.InProcessTeammateTask
InProcessTeammateTask
Location:
src/tasks/InProcessTeammateTask/A parallel teammate agent running in the same process. Used for concurrent work on different parts of a task.DreamTask
DreamTask
Location:
src/tasks/DreamTask/A background “dreaming” process that runs autonomously in the background while the user is not actively interacting.LocalMainSessionTask
LocalMainSessionTask
Location:
src/tasks/LocalMainSessionTask.tsWraps the main interactive session as a task, enabling it to participate in the task management system.Task tools
The task system exposes six tools for managing work items:| Tool | Purpose |
|---|---|
TaskCreateTool | Create a new background task |
TaskUpdateTool | Update task status or metadata |
TaskGetTool | Retrieve details for a specific task |
TaskListTool | List all active and completed tasks |
TaskOutputTool | Retrieve the output of a task |
TaskStopTool | Stop a running task |
Coordinator (multi-agent)
Location:src/coordinator/
The coordinator orchestrates multiple agents working in parallel on different aspects of a task. It is gated behind the COORDINATOR_MODE feature flag.
How it works
Coordinator lifecycle
coordinatorMode.ts manages the full coordinator lifecycle — startup, agent registration, message routing, and shutdown.Team creation
TeamCreateTool and TeamDeleteTool create and disband named agent teams. Each team can work on a distinct subtask in parallel.Inter-agent communication
SendMessageTool enables agents to communicate with each other — passing results, asking for clarification, or handing off work.Coordinator tools
TeamCreateTool
Creates a named team of agents assigned to a specific subtask.
TeamDeleteTool
Disbands a team once its work is complete.
SendMessageTool
Sends a message from one agent to another for inter-agent coordination.
AgentTool
Spawns a new sub-agent with a given task and context.
Related
/memorycommand — Manage project and user memory/taskscommand — Manage background tasks- Architecture — Feature flags including
COORDINATOR_MODE - Subsystems overview — All subsystems at a glance