cajias/claude-skills/bash-subagent-write-limitation

Claude Code and agent skill by cajias/claude-skills

Trust tier 3
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
Source check pending

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-limitation

Semi-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 Task tool with subagent_type=Bash and run_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

  1. Don't use Bash subagents for implementation tasks when hooks are active
  2. Write files from the parent session using Write/Edit tools (these bypass Bash hooks)
  3. Then dispatch Bash agents only for validation: lint, test, typecheck, commit
  4. Alternative: use subagent_type=general-purpose which has Write/Edit tools, but these

are heavier and slower

Recommended Pattern
text
1. Parent session: Write all source files using Write tool
2. Parent session: Write all test files using Write tool
3. Dispatch Bash agents (parallel) for: ruff check, mypy, pytest, git commit
4. Or just run validation from parent session directly

Verification

  • Check agent output file for "auto-denied" messages
  • If agents complete successfully with commits, the approach worked

Notes

  • The general-purpose subagent 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cajias/claude-skills/bash-subagent-write-limitation/badge)](https://verified-skill.com/skills/cajias/claude-skills/bash-subagent-write-limitation)

Something wrong with this skill or its page? Tell us.