Tip: Use CLAUDE_CODE_SESSION_ID to Track Subprocess Origin in Multi-Agent Setups
Releasebot·medium signal
Claude Code v2.1.132 injects CLAUDE_CODE_SESSION_ID into every Bash tool subprocess environment. In multi-agent setups where several Claude Code sessions run concurrently, scripts and hooks can now read this variable to attribute which session spawned a given process — useful for logging, debugging race conditions, and routing subprocess output back to the correct agent.