Team mode: agent constraints written to memory files are not reliably enforced in task instructions
Problem
When using Claude Code in team mode (multi-agent), the team-lead agent has a memory system (~/.claude/projects/.../memory/) where feedback and constraints are stored. However, these constraints are not reliably included in task instructions sent to teammate agents via SendMessage.
Concrete example
We have a feedback memory rule: \"graphql-expert must never use --no-verify when committing — always attempt a normal commit first and report hook errors.\" This was written to both:
- A project memory file (
feedback_no_verify.md) - The agent's own
.mdfile (graphql-expert.md) under Lessons Learned
Despite this, when the team-lead sent the next task to graphql-expert via SendMessage, the constraint was not included in the message. The agent used --no-verify again on the very next task.
A second example: a constraint was written that \"review tasks must read actual code with gh pr diff, not just check API status.\" On the next review task, the team-lead's SendMessage instruction did not include this requirement, and the agent again skipped reading the code.
Root cause
The team-lead agent writes constraints to memory files reactively (after being corrected), but does not proactively look up and apply relevant memory constraints when composing task instructions for teammates. Memory files exist but are not consulted at the point of task dispatch.
Expected behavior
Before sending a task to a teammate agent, the team-lead should:
- Load relevant memory/feedback files that apply to that agent or task type
- Explicitly include applicable constraints in the
SendMessageinstruction
Impact
Users must repeatedly correct the same mistakes across sessions, even when they've explicitly asked Claude to \"remember\" the constraint. This makes the memory system feel unreliable and erodes trust.
Environment
- Claude Code team mode (
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) - Memory system at
~/.claude/projects/<path>/memory/ - Agent definitions at
~/.claude/agents/
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗