[BUG] Task tool subagents cannot write files to disk
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug Report: Task tool subagents cannot write files to disk
Environment:
Claude Code CLI version: [current version]
OS: Linux 6.8.0-90-generic
Date: 2026-01-18
Summary:
When delegating file creation tasks to subagents via Task tool with subagent_type parameter, the subagents report successful file creation in their output, but no files are actually written to disk. This creates a false impression that work was completed when nothing was actually done.
Steps to Reproduce:
Use Task tool to spawn a specialized agent (e.g., subagent_type="Backend & ETL engineer")
Include file creation instructions in the prompt (e.g., "Create file: db/migrations/038_add_news_articles.sql")
Agent returns successful completion message like "File created successfully at: /path/to/file.sql"
Check filesystem - file does not exist
Expected Behavior:
Either:
Option A: Subagents should have access to Write/Edit tools and actually create files on disk
Option B: Task tool should explicitly warn that subagents CANNOT write files and delegation should be limited to read-only operations (research, code search, analysis)
Actual Behavior:
Subagents simulate file creation
Return messages claiming success ("File created successfully")
No actual files written to disk
User believes work is done but nothing happened
Impact:
HIGH: Wastes user time - they think files are created but they're not
HIGH: Breaks trust - system appears to lie about completed work
CRITICAL for AIDD workflows: Multi-step pipelines fail silently when intermediate steps produce no output
Current Workaround:
Do NOT delegate file creation to subagents via Task tool
Main assistant must use Write/Edit/Read tools directly
Use Task tool only for read-only operations (research, code search, analysis)
Proposed Fix:
Give subagents access to Write/Edit tools so they can actually modify files, OR
Add clear error message when Task tool receives write-related prompts: "Subagents cannot write files. Use Write/Edit tools directly instead of delegating via Task tool.", OR
Document this limitation clearly in Task tool description
Example Code:
This APPEARS to work but does NOT create files:
Task(
description: "Create migration file",
subagent_type: "Backend & ETL engineer",
prompt: "Create file: db/migrations/038_add_news_articles.sql with content: ..."
)
Agent returns: "File created successfully" - BUT FILE DOES NOT EXIST
CORRECT approach (works):
Write(
file_path: "/home/user/project/db/migrations/038_add_news_articles.sql",
content: "..."
)
Related Issues:
This affects all AIDD workflows that use /implement command with agent delegation
Particularly problematic for multi-task tickets where early tasks appear complete but aren't
Severity: HIGH
Priority: HIGH (breaks core functionality for development workflows)
What Should Happen?
Task tool subagents cannot write files to disk
Error Messages/Logs
Steps to Reproduce
This APPEARS to work but does NOT create files:
Task(
description: "Create migration file",
subagent_type: "Backend & ETL engineer",
prompt: "Create file: db/migrations/038_add_news_articles.sql with content: ..."
)
Agent returns: "File created successfully" - BUT FILE DOES NOT EXIST
CORRECT approach (works):
Write(
file_path: "/home/user/project/db/migrations/038_add_news_articles.sql",
content: "..."
)
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Version 2.1.11
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗