Expand description
The Claude agent’s shell prefix: agentmux-bashwrap as the CLI’s
CLAUDE_CODE_SHELL_PREFIX, which streams Bash output without the hook
rewriting the call (docs/specs/SPEC_BASH_STREAMING_VIA_SHELL_PREFIX_2026_10_10.md).
Constants§
- BASHWRAP_
MODE_ 🔒ENV - srv’s own environment variable that turns the shell prefix off:
rewritekeeps the hook rewriting commands, as before the prefix.
Functions§
- apply_
bash_ 🔒shell_ prefix - Claude Code runs every Bash tool command through
CLAUDE_CODE_SHELL_PREFIXwhen it is set: pointed atagentmux-bashwrap, that streams the command without the hook rewriting the call, so the CLI’s permission rules and labels see the model’s own command (docs/specs/SPEC_BASH_STREAMING_VIA_SHELL_PREFIX_2026_10_10.md §2.4). Only Claude Code reads the variable. A prefix the agent’s owncmd:envsets is kept (the hook then rewrites, as it does without a prefix); no prefix is set without the wrapper, or when srv runs withAGENTMUX_BASHWRAP_MODE=rewrite. - apply_
for_ 🔒spawn - Set the prefix in an agent’s spawn environment
(
input::build_persistent_spawn_env). Not for a pane in the MCP self-heal’s safe profile: its MCP server failed to start and reconnecting didn’t help, so its CLI runs without the prefix, as withAGENTMUX_BASHWRAP_MODE=rewrite(backend::mcp_health). - mode_
for 🔒 rewritefor a pane in the safe profile, else srv’s own setting.