What
Appends a custom system prompt to every Task-tool subagent launched by Claude Code, propagated recursively to nested subagents.
Usage
claude --print --append-subagent-system-prompt "Always respond in JSON" ...Details
- Only works with
--print(non-interactive mode) - Sets
CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT=1automatically - Propagates the appended prompt through nested subagent chains
- Useful for enforcing output format, language, or tool constraints across all agents in a pipeline
Evidence
CLI flag description (search for "Append a system prompt to every Task-tool subagent") — UCp() at line ~763864
Strings lifted out of the shipped bundle, so the claim above can be checked against them.