cajias/claude-skills/bash-subagent-write-limitation
Claude Code and agent skill by cajias/claude-skills
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Fix for Task tool subagents with subagent_type=Bash being unable to write files when PreToolUse hooks block write operations. Use when: (1) dispatching parallel Bash agents to implement code in worktrees, (2) agents report "Permission to use Bash has been auto-denied", (3) agents can read files but all write/touch/cp/dd commands fail. Solution: write files from the parent session using Write/Edit tools, then optionally dispatch Bash agents only for validation (lint, test, typecheck).
Install
npx vskill@latest install cajias/claude-skills/bash-subagent-write-limitationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as cajias/claude-skills/bash-subagent-write-limitation.
Bash Subagents Cannot Write Files Under PreToolUse Hooks
Problem
When dispatching parallel agents using Task with subagent_type=Bash, these agents only have access to the Bash tool. If PreToolUse hooks (e.g., from hookify or custom plugins) block file-write Bash commands, the agent gets stuck in a loop trying different write approaches (heredoc, dd, python -c, base64) — all denied.
Context / Trigger Conditions
- Using
Tasktool withsubagent_type=Bashandrun_in_background=true - PreToolUse hooks configured that filter/block Bash write operations
- Agent output shows repeated "Permission to use Bash has been auto-denied"
- Agent can run read-only commands (ls, cat, whoami, date) but not writes
Solution
- Don't use Bash subagents for implementation tasks when hooks are active
- Write files from the parent session using Write/Edit tools (these bypass Bash hooks)
- Then dispatch Bash agents only for validation: lint, test, typecheck, commit
- Alternative: use
subagent_type=general-purposewhich has Write/Edit tools, but these
are heavier and slower
Recommended Pattern
Verification
- Check agent output file for "auto-denied" messages
- If agents complete successfully with commits, the approach worked
Notes
- The
general-purposesubagent type has all tools but is slower to start - If no hooks are configured, Bash subagents can write files normally
- This is specific to the interaction between Task tool's Bash agents and PreToolUse hooks
- The hooks system doesn't distinguish between "write to project" and "write to /tmp"
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/bash-subagent-write-limitation/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cajias/claude-skills/bash-subagent-write-limitation)