Subagents with no MCP tools still receive MCP server instructions (mcp_instructions_delta)

Status Open
Reported on v2.1.284
Maintainer reply None cached
Activity 1 comment · opened Sep 30, 2026

Summary

When a subagent cannot use any MCP tool (disallowedTools: ["mcp__*"], or a tools: allowlist with no MCP tools), Claude Code still injects the MCP server instructions (mcp_instructions_delta) into that subagent's context. It arrives just before the subagent's 2nd API call, for every connected server. The tool names are correctly left out, so the instructions describe tools the subagent can never call.

Measured (Claude Code 2.1.284, Linux)

  • 29 connected MCP servers. The attachment is ~11.4 KB, about 4.3K tokens (measured ~2.4 bytes/token), in every lane of such a subagent. It is cache-written once and then re-read on every later call.
  • The rest of the attachment set behaves as expected:
  • deferred_tools_delta carries no mcp__ names.
  • The agent listing is absent when Agent is disallowed.
  • The skill listing is absent when Skill is disallowed.
  • Only the server instructions are unconditional.
  • mcpServers: [] in the agent definition does not help. The empty list is dropped at parse time, and the field only adds servers.
  • The only related knob is CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH. It is global, and it truncates rather than removes.

Repro

Run these from a project with several MCP servers connected, then inspect the subagent transcript (<session>/subagents/agent-*.jsonl) for an attachment record of type mcp_instructions_delta.

A='{"probe": {"description": "probe", "prompt": "Run shell commands exactly as asked.", "disallowedTools": ["mcp__*"], "model": "haiku"}}'
claude -p 'Use the Agent tool with subagent_type probe: run `echo one` with Bash, then reply DONE.' \
  --model haiku --agents "$A" --allowedTools "Bash(echo *)" Agent --output-format json

Request

Skip MCP server instructions for a subagent whose resolved tool set contains no mcp__* tools. Alternatively, treat an explicit mcpServers: [] as "inherit no servers". For fleets that route mechanical work to MCP-less subagents, this is ~4.3K tokens of dead context per lane.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗