Multi-pane Claude Code setup with role separation and execution hooks

Setup details
A developer on r/ClaudeAI describes a configuration to address Claude Code drifting mid-session and losing context. The solution uses a 2×2 grid in iTerm2, with each pane running a separate Claude Code instance assigned a fixed role.
- IMPL: Uses the Sonnet model with auto-accept enabled. Its role is to write code and run tests.
- AUDIT: Uses the Opus model in read-only mode. It reviews IMPL's output without generating code itself.
- PLAN: Runs at low effort for architecture discussions. It has no write restrictions, but the low effort setting prevents it from diving into implementation.
- PROMPT: Handles prompt refinement separately.
Each pane automatically picks up its role from the $ITERM_PROFILE environment variable. Typing cc launches the instance with the correct model and permission flags.
Hook system and session management
The setup includes a two-tier hook system enforced at execution time.
- PreToolUse hooks: Block operations like
.envfile edits andgit pushcommands before they execute. - PostToolUse hooks: Implement a circuit breaker that halts the session after three consecutive tool failures to prevent spiraling.
A SESSION_LOG—a plain markdown file—is updated by IMPL at the end of each day with completed work, decisions made, and next steps. At the start of a new session, it reads the last 60 lines of this log, reducing cold starts from re-explaining the entire project to picking up where it left off.
The full walkthrough with hook scripts and a gate/ship workflow is available in a linked guide and repository.
📖 Read the full source: r/ClaudeAI
👀 See Also

How I built 62 free tools in a month using Claude Code + a loop script
A developer shipped 62 browser-based, SEO-ready tools in 30 days using a shell script called Ralph that runs Claude Code autonomously in layers, plus a parallel cook.sh to run multiple tools at once.

Claude Code AI Agent Controls Physical iPhone via Accessibility APIs
A developer demonstrated Claude Code autonomously operating a physical iPhone through the Blitz Mac app, using WebDriverAgent and accessibility APIs with a zero-distance swipe workaround for taps.

OpenClaw Use Case: Building a Daily Personal News Digest with AI
A developer shares their OpenClaw setup for a daily news digest using a cronjob with a detailed prompt that specifies news sources, interest priorities, and output format. The system fetches RSS feeds from trusted Dutch publications and delivers 5 curated stories each morning.

Running Claude Code as a Kubernetes CronJob: Production Learnings and Open-Sourced Setup
A team at everyrow.io shares their experience running Claude Code unattended as a Kubernetes CronJob, documenting undocumented quirks and open-sourcing their Dockerfile, entrypoint, Helm chart, and logging setup.