[FEATURE] Feature Request: Allow teammates to use sub-agent MD as primary context instead of CLAUDE.md
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 spawning a teammate with a custom agent definition (.claude/agents/my-agent.md), the teammate loads both:
- The agent MD file (as "Custom Agent Instructions")
- The project's
CLAUDE.md(as system-reminder context)
This creates three problems:
1. Identity conflicts: Our project uses 60+ specialized agent definitions, each with strict authority rules ("you are NOT the team lead", "you can ONLY edit this one file"). But CLAUDE.md contains team lead instructions ("you are the team lead", "spawn agents", "coordinate work"). The teammate sees both and gets confused about its identity and authority level.
2. Wasted context window: CLAUDE.md can be 400+ lines of team lead instructions that are completely irrelevant to a specialized teammate. The agent MD is another 400-800 lines. Together they consume 800-1200 lines of context before the teammate even starts working. For the teammate, only its own agent MD matters.
3. No opt-out mechanism: There's no way to tell Claude Code "for this teammate, load only the agent MD, skip CLAUDE.md." The only current workaround is adding a disambiguation block to every agent MD saying "ignore CLAUDE.md's identity instructions" - which is fragile and adds even more context overhead.
Current behavior
# Spawning a teammate with a custom agent definition
Task(
subagent_type="Agent-analyzer", # Loads .claude/agents/agent-analyzer.md
name="agent-analyzer",
team_name="my-team",
prompt="Analyze your file for edge cases"
)
The teammate receives:
agent-analyzer.md(its specialized identity - the intended context)CLAUDE.md(the team lead's project-wide instructions - unintended, conflicting)MEMORY.md(session memory)
The teammate should only need its own agent MD + optionally a shared project context file.
Why teammates over sub-agents?
Sub-agents (spawned without team_name) don't have this problem - they seem to load only the agent MD. But sub-agents have a significantly reduced toolset:
| Capability | Sub-agent | Teammate |
|-----------|-----------|----------|
| SendMessage (peer-to-peer) | No | Yes |
| Shared task list | No | Yes |
| Team coordination | No | Yes |
| Full Claude Code session | No | Yes (per docs) |
We need teammates for multi-agent coordination, but we need them to operate with their agent-specific context rather than inheriting the team lead's full CLAUDE.md.
Proposed Solution
Desired behavior
Option A: A flag to disable CLAUDE.md loading for specific agents:
# In .claude/agents/agent-analyzer.md
---
name: Agent-analyzer
skip_claude_md: true # <-- Don't load CLAUDE.md for this agent
tools: [Read, Edit, Write, Bash, ...]
---
Option B: A context field in the agent definition to control which files to load:
---
name: Agent-analyzer
context:
- .claude/agents/agent-analyzer.md # Primary identity
- PROJECT_BRIEF.md # Shared context (optional)
# CLAUDE.md deliberately excluded
---
Option C: A spawn-time parameter:
Task(
subagent_type="Agent-analyzer",
name="agent-analyzer",
team_name="my-team",
skip_project_context=True, # <-- Don't load CLAUDE.md
prompt="..."
)
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗