[BUG] Subagent Write tool rejects .md files named "report"/"summary"/"findings"/"analysis" — no opt-out

Open 💬 7 comments Opened Apr 7, 2026 by carrotRakko

What's Wrong?

Subagents spawned via the Agent tool are blocked from writing .md files when the filename starts with report, summary, findings, or analysis (case-insensitive). The Write tool returns an error:

Subagents should return findings as text, not write report files. Include this content in your final response instead.

This restriction was recently activated server-side — it was not present in earlier sessions on the same version (2.1.92). It breaks established workflows where subagents are explicitly instructed to write results to files.

There is no way to opt out: no setting in settings.json, no environment variable, no CLAUDE.md directive.

What Should Happen?

When a user explicitly instructs a subagent to write results to a file, the Write tool should respect that instruction. At minimum, there should be a way to opt out of this restriction.

Error Messages/Logs

Subagents should return findings as text, not write report files. Include this content in your final response instead.

Steps to Reproduce

  1. Spawn a subagent via the Agent tool with a prompt that explicitly instructs it to write results to a file:

"Write your findings to /tmp/test/report.md"

  1. The subagent attempts to use the Write tool to create report.md
  2. Write fails with the error above
  3. The subagent falls back to including the full content in its response, consuming the parent's context

Note: This is controlled by a server-side feature flag being rolled out gradually. It may not reproduce for all users yet.

Model: Opus

Regression?: Yes, this worked in a previous version

Last Working Version: Same version (2.1.92). Worked on Saturday April 5, stopped working Monday April 7. The restriction is server-side, not version-dependent.

Claude Code Version: 2.1.92

Platform: Anthropic API

OS: Ubuntu/Debian Linux

Terminal: iTerm2

Additional Information

Why subagent file writes matter: Some users design their subagent workflows to write results to files rather than returning them in the response. This is intentional, not accidental:

  1. Persistence — Subagent results survive context compaction. Response-only results are lost when the conversation is compressed.
  2. Context efficiency — The parent reads the file when needed, rather than having the full content injected into its context by the response.
  3. Fidelity — Direct file writes avoid information distortion from the parent re-serializing the subagent's output.

The current restriction assumes all subagent file writes are unintentional, and blocks them with no recourse. Users who have deliberately optimized their workflows around this pattern are affected.

Suggested fix: Add a setting (e.g., in settings.json) to disable this restriction. Users who want the guardrail keep it by default; users who don't can opt out.

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗