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 Businesses Use OpenClaw to Automate Client Communication
OpenClaw is being used by freelancers as a personal assistant in WhatsApp and email to handle client inquiries about rates, policies, and availability. Local businesses like restaurants use it to answer questions about menus, hours, and reservations when staff are unavailable.

Using Claude Code to Automatically Refresh OpenClaw OAuth Tokens
A developer shares a method using Claude Code to automatically rotate OpenClaw OAuth tokens every 8 hours, preventing expiration during long coding sessions. The approach requires keeping your computer on with an active Claude Code session.

Building a macOS clipboard manager with Claude: A practical workflow case study
A developer built Buffer, an open-source macOS clipboard manager using Claude as a planning and pair programming partner, finding that starting with implementation plans before coding reduced wasted prompts and debugging.

Developer Uses Claude AI to Build PosturePal Posture Scanner App
A developer built PosturePal: Posture Scanner using Claude AI for multiple aspects including code, product decisions, user feedback communication, and copywriting. The app analyzes side profile photos to provide posture scores, identify specific issues, and generate tailored exercises.