⌨️CLAUDE_CODE_SHELL_PREFIX
Also known as CLAUDE_CODE_SHELL_PREFIX=/path/to/logger.sh
It wraps each shell command in a tool of yours, often a log.
Think of it like
It is like a guard at the door. The guard writes down each one who walks in.
Example
Lucy's team must keep a record of each command an AI runs. She points this at a small logger script.
Why it matters
It gives one place to see, log or block each command. The commands stay the same.
Definition
Example code
bash
#!/bin/bash
# logger.sh
echo "$(date) $1" >> ~/claude-commands.log
exec bash -c "$1"Common mistake
Key takeaways
- 1Wraps each command. Bash, hooks, MCP.
- 2Command in $1. As one value.
- 3Run it again. bash -c "$1".