By Dcouple Inc. Terminal-first workflow with opinionated UI and Windows build support.
Pane is a fully-implemented Electron desktop application for managing multiple AI code assistant instances (Claude Code and Codex) against a single directory using git worktrees. It provides a streamlined interface for running parallel AI assistant sessions with different approaches to the same problem.
Use these reference pages for more information:
- How to invoke Claude Code through the command line as an SDK: https://docs.anthropic.com/en/docs/claude-code/sdk
- How to run multiple Claude Code instances with Git Worktrees: https://docs.anthropic.com/en/docs/claude-code/tutorials#run-parallel-claude-code-sessions-with-git-worktrees
- Adding New CLI Tools: Guide for extending Pane to support additional CLI tools beyond Claude Code
- Implementing New CLI Agents: Step-by-step instructions for adding new CLI agent tools with code examples and best practices
- Codex Configuration: Configuration guide for Codex CLI integration
All core features have been successfully implemented with significant enhancements beyond the original requirements.
- Multi-session support: Run multiple Claude Code instances simultaneously
- Session templates: Create single or multiple sessions with numbered templates
- Session persistence: SQLite database for persistent sessions across restarts
- Session archiving: Archive sessions instead of permanent deletion
- Conversation continuation: Resume conversations with full history context
- Real-time status tracking: initializing, running, waiting, stopped, error
- Automatic session naming: AI-powered session name generation based on prompts
- Isolated development: Each Claude Code session operates in its own git worktree
- Conflict prevention: Prevents conflicts between parallel development efforts
- Automatic cleanup: Worktree cleanup when sessions are deleted
- Branch management: Support for existing branches or creation of new branches
- Empty repo handling: Automatic initial commit for repositories with no commits
- Rebase from main: Pull latest changes from main branch into worktree
- Squash and rebase to main: Combine all commits and rebase onto main
- Diff visualization: View all changes with syntax highlighting
- Commit tracking: History with statistics (additions, deletions, files changed)
- Uncommitted changes: Detection and display of uncommitted changes
- Command preview: Git command tooltips for transparency
- Error handling: Detailed error dialogs with full git output
- Multiple projects: Support for multiple projects with easy switching
- Auto-initialization: Automatic directory creation and git initialization
- Project settings: Custom prompts, run scripts, main branch configuration
- Active project: Persistent active project selection
- Dual tab system: Main view tabs (Output | Diff | Logs | Editor) with tool panel bar underneath
- Tool Panel System: Flexible panel framework supporting multiple terminal instances per session
- Multiple view modes:
- Output View: Formatted terminal output with syntax highlighting
- Messages View: Raw JSON message inspection for debugging
- View Diff View: Git diff viewer with file statistics
- Editor View: File editor with syntax highlighting
- Multi-instance terminals: Multiple XTerm.js terminals per session with 50,000 line scrollback
- Panel management: Create, switch, rename, and close tool panels dynamically
- Sidebar navigation: Session list, project selector, prompt history
- Real-time updates: IPC-based live output streaming
- Status indicators: Color-coded badges with animations
- Unread indicators: Activity tracking across views
- Prompt history: Complete history of all prompts across sessions
- Search functionality: Search prompts and session names
- Quick reuse: One-click prompt reuse for new sessions
- Prompt navigation: Jump to specific prompts within session output
- Clipboard support: Copy prompts to clipboard
- Panel-based terminals: Each terminal runs in its own panel with independent state
- Multi-instance support: Multiple terminal panels per session for parallel workflows
- Multi-line input: Auto-resizing textarea with keyboard shortcuts
- Smart formatting: Automatic formatting of JSON messages
- Tool call display: Clear visual structure for Claude's tool usage
- Script execution: Run project scripts with real-time output
- Process management: Start/stop script processes
- State persistence: Terminal scrollback, working directory, and history persist across app restarts
- Lazy initialization: Terminal processes only start when panels are first viewed
- Flexible architecture: Extensible panel framework supporting multiple panel types
- Multi-instance terminals: Run multiple terminal instances per session in separate panels
- Lazy initialization: Panels only start processes when first viewed for memory efficiency
- State persistence: Terminal scrollback, working directories, and panel configurations persist across restarts
- Panel lifecycle management: Create, switch, rename, and delete panels dynamically
- Event-driven communication: Panel event bus enabling future inter-panel communication
- Always-visible panel bar: Tool panel tabs always visible below main view tabs
- Seamless integration: Panels integrate with existing session and view management
- Memory efficient: Inactive panels suspend rendering while maintaining background processes
- Future extensibility: Architecture designed to support Claude, Diff, and Editor panels in future releases
- Global settings:
- Verbose logging toggle
- Anthropic API key configuration
- Global system prompt additions
- Custom Claude executable path
- Notification settings:
- Desktop notifications toggle
- Sound notifications with Web Audio API
- Customizable triggers (status changes, waiting, completion, errors)
- Project-specific settings:
- Custom system prompts per project
- Run scripts for testing/building
- Main branch customization
- SQLite Database:
projects: Project configurations, paths, and commit settingssessions: Core session metadata with active_panel_id, folder_id, tool_type ('claude'|'codex'|'none'), and status trackingsession_outputs: Terminal output history (linked to panels via panel_id)conversation_messages: Conversation history with tool calls/results (linked to panels via panel_id)execution_diffs: Git diff tracking per execution (linked to panels via panel_id)prompt_markers: Navigation markers for prompts with completion timestamps (linked to panels via panel_id)tool_panels: Panel configurations, state, metadata, and settings (JSON)folders: Hierarchical folder structure for organizing sessions (supports nesting via parent_folder_id)project_run_commands: Multiple configurable run commands per projectclaude_panel_settings: Claude-specific panel configuration (legacy, being migrated to tool_panels.settings)ui_state: UI state persistence for application preferencesapp_opens: Application launch tracking for analyticsuser_preferences: User preference storage for application behavior
- Automatic initialization:
~/.panedirectory created on first run - Migration system: Dual migration system (TypeScript and SQL) for schema evolution
- JSON Configuration: Application configuration stored in ~/.pane/config.json
- Task Queue: Bull queue with optional Redis support
- Process Management: node-pty for Claude Code instances
- Error handling: Comprehensive error reporting and recovery
- Performance optimizations: Lazy loading, debounced updates, caching
- Keyboard shortcuts: Cmd/Ctrl+Enter for input submission
- Main Process: Electron main process with IPC communication
- Window management with native OS integration
- Custom ConfigManager for configuration persistence (~/.pane/config.json)
- IPC handlers for renderer communication
- Framework: React 19 with TypeScript
- State Management: Zustand for reactive state management
- UI Styling: Tailwind CSS utility-first framework
- Terminal: @xterm/xterm professional terminal emulator
- Build Tool: Vite for fast development
- Icons: Lucide React for consistent iconography
- Runtime: Node.js with TypeScript
- IPC Server: Direct IPC communication with renderer process
- Database: Better-SQLite3 for synchronous operations
- Task Queue: Bull with in-memory queue for Electron
- Claude Integration: @anthropic-ai/claude-code SDK
- Process Management: node-pty for PTY processes
- Git Integration: Command-line git worktree management
- Electron IPC: Secure inter-process communication for all operations
- Event System: IPC-based event handling for real-time updates
┌─────────────────────────────────────────────────────────┐
│ Electron Desktop Application │
├─────────────────────────────────────────────────────────┤
│ Renderer Process (Frontend) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌────────────┐ │
│ │ Sidebar │ │ Terminal │ │ Help │ │
│ │ (Sessions) │ │ (XTerm.js) │ │ Dialog │ │
│ └─────────────────┘ └─────────────────┘ └────────────┘ │
├─────────────────────────────────────────────────────────┤
│ IPC Communication │
├─────────────────────────────────────────────────────────┤
│ Main Process (Electron + Node.js) │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────────┐ │
│ │ Task Queue │ │ Session │ │ Config │ │
│ │ (Bull) │ │ Manager │ │ Manager │ │
│ └──────────────┘ └──────────────┘ └───────────────────┘ │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────────┐ │
│ │ Worktree │ │ Claude Code │ │ Config │ │
│ │ Manager │ │ Manager │ │ Manager │ │
│ └──────────────┘ └──────────────┘ └───────────────────┘ │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────────┐ │
│ │ IPC Handlers │ │ Event │ │ Git Diff │ │
│ │(git,session) │ │ Manager │ │ Manager │ │
│ └──────────────┘ └──────────────┘ └───────────────────┘ │
├─────────────────────────────────────────────────────────┤
│ Better-SQLite3 Database │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ sessions │ │session_ │ │conversation_ │ │
│ │ table │ │outputs │ │messages │ │
│ └─────────────┘ └─────────────────┘ └─────────────────────┘ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │execution_ │ │prompt_ │ │ projects │ │
│ │diffs │ │markers │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
├─────────────────────────────────────────────────────────┤
│ Claude Code SDK Instances (node-pty) │
│ ┌─────────────────────────────┐ │
│ │ Git Worktrees │ │
│ └─────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘The main process has been refactored from a monolithic index.ts file into a comprehensive modular structure:
Core Main Process:
index.ts(776 lines): Core Electron setup and initializationevents.ts(1,108 lines): Event handling and coordination
IPC Handlers (main/src/ipc/):
session.ts(1,872 lines): Session management IPC handlersgit.ts(1,391 lines): Git-related IPC handlersfile.ts(865 lines): File operations (read/write/delete/list)dashboard.ts(741 lines): Dashboard overview and project statuscodexPanel.ts(496 lines): Codex AI panel managementbaseAIPanelHandler.ts(382 lines): Base class for AI panel handlersproject.ts(349 lines): Project CRUD operationsclaudePanel.ts(268 lines): Claude AI panel managementscript.ts(230 lines): Script execution handlerspanels.ts(228 lines): General panel lifecycle management- Plus 13 additional specialized handlers
Service Layer (main/src/services/):
sessionManager.ts(1,598 lines): Core session lifecycle managementworktreeManager.ts(931 lines): Git worktree operationsgitStatusManager.ts(872 lines): Git status trackingtaskQueue.ts(671 lines): Async task queue managementgitDiffManager.ts(606 lines): Diff generation and trackingcliToolRegistry.ts(532 lines): CLI tool registration systempanelManager.ts(374 lines): Panel lifecycle coordinatorterminalPanelManager.ts(370 lines): Terminal panel processes- Plus 8 additional service modules
Panel Services (main/src/services/panels/):
codex/codexManager.ts(1,251 lines): Codex CLI integrationcli/AbstractCliManager.ts(994 lines): Abstract CLI manager base classclaude/claudeCodeManager.ts(741 lines): Claude CLI integrationlogPanel/logsManager.ts(496 lines): Log panel managementai/AbstractAIPanelManager.ts(395 lines): Abstract AI panel base classcodex/codexPanelManager.ts(403 lines): Codex panel lifecycleclaude/claudePanelManager.ts(135 lines): Claude panel lifecycle
Frontend Hooks (frontend/src/hooks/):
useSessionView.ts(1,694 lines): Session view logic and state managementuseClaudePanel.ts(475 lines): Claude panel state managementuseCliPanel.ts(452 lines): CLI panel state managementuseIPCEvents.ts(349 lines): IPC event handlinguseCodexPanel.ts(343 lines): Codex panel state managementuseAIInputPanel.ts(311 lines): AI input panel logicuseNotifications.ts(212 lines): Notification system
Frontend Stores (frontend/src/stores/):
sessionStore.ts(699 lines): Session state management with ZustandsessionPreferencesStore.ts(154 lines): User session preferencespanelStore.ts(109 lines): Panel state managementsessionHistoryStore.ts(93 lines): Session history tracking
Major Frontend Components (frontend/src/components/):
DraggableProjectTreeView.tsx(2,565 lines): Main project/session tree UICreateSessionDialog.tsx(1,293 lines): Session creation dialogProjectTreeView.tsx(612 lines): Project tree displaySettings.tsx(589 lines): Settings management UISessionView.tsx(587 lines): Session display (uses useSessionView hook)
This modular structure improves maintainability and makes it easier to locate and modify specific functionality.
GET /api/sessions- List all sessions with statusPOST /api/sessions- Create new session(s) with templatesGET /api/sessions/:id- Get specific session detailsDELETE /api/sessions/:id- Archive session and cleanup worktree
POST /api/sessions/:id/input- Send input to Claude Code instancePOST /api/sessions/:id/continue- Continue conversation with full historyGET /api/sessions/:id/output- Retrieve session output historyGET /api/sessions/:id/conversation- Get conversation message history
GET /api/config- Get current application configurationPOST /api/config- Update configuration settings
GET /api/projects- List all projectsPOST /api/projects- Create new project (with automatic directory/git init)GET /api/projects/:id- Get project detailsPUT /api/projects/:id- Update project settingsPOST /api/projects/:id/activate- Set active projectDELETE /api/projects/:id- Delete project
GET /api/prompts- Get all prompts with associated sessionsGET /api/prompts/:sessionId/:lineNumber- Navigate to specific prompt
- Session Creation: User provides prompt and worktree template via dialog
- Worktree Setup: Backend creates new git worktree using
git worktree add - Claude Instance: Spawns Claude Code process in worktree using node-pty
- Database Storage: Session metadata and output stored in SQLite
- Real-time Updates: IPC streams session status and terminal output
- Session Management: Users can switch between sessions, continue conversations
pnpm run setup # One-time setup (install, build, and rebuild native modules)pnpm electron-dev # Run as Electron app in development mode
pnpm run dev # Shorthand for electron-dev
pnpm dev # Run frontend only (without Electron shell)Note: You must run pnpm run build:main at least once before running pnpm electron-dev to compile the main process.
pnpm build # Build for production (all platforms)
pnpm build:main # Build main process only
pnpm build:frontend # Build frontend onlypnpm build:mac # Build for macOS (universal)
pnpm build:mac:x64 # Build for macOS (Intel only)
pnpm build:mac:arm64 # Build for macOS (Apple Silicon only)
pnpm build:linux # Build for Linux
pnpm build:win:x64 # Build for Windows (x64 only)
pnpm build:win:arm64 # Build for Windows (ARM64 only)pnpm run release patch # Bump patch version (0.0.2 -> 0.0.3) and trigger release
pnpm run release minor # Bump minor version (0.0.2 -> 0.1.0) and trigger release
pnpm run release major # Bump major version (0.0.2 -> 1.0.0) and trigger release
pnpm run release 1.2.3 # Set explicit version and trigger releaseThe release script (scripts/release.js) bumps the version in package.json, commits, creates a git tag, and pushes. The tag push triggers the GitHub Actions release workflow which builds and publishes installers for all platforms (macOS universal, Linux x64+arm64, Windows x64+arm64) to GitHub Releases.
build.yml: CI validation on push toreleasebranch. Builds all platforms, uploads artifacts.build.yml(release mode): Triggered byv*tags. Builds all platforms and publishes to GitHub Releases.quality.yml: Runs linting and type checking on PRs.
pnpm test # Run Playwright tests
pnpm test:ui # Run tests with Playwright UI
pnpm test:headed # Run tests in headed browser modepnpm typecheck # Type checking across all workspaces
pnpm lint # Linting across all workspacesPane/
├── frontend/ # React renderer process
│ ├── src/
│ │ ├── components/ # React components (50+ files)
│ │ │ ├── panels/ # Panel components (Terminal, Claude, Codex, Diff, Editor, Logs, Dashboard, SetupTasks)
│ │ │ ├── Help.tsx # Help dialog
│ │ │ ├── DraggableProjectTreeView.tsx # Main project/session tree UI
│ │ │ └── ... # Other UI components
│ │ ├── hooks/ # Custom React hooks (9 hooks)
│ │ │ ├── useSessionView.ts # Session view logic (1,694 lines)
│ │ │ ├── useClaudePanel.ts # Claude panel state
│ │ │ ├── useCodexPanel.ts # Codex panel state
│ │ │ └── ... # Other hooks
│ │ ├── stores/ # Zustand state stores
│ │ │ ├── sessionStore.ts # Session state (699 lines)
│ │ │ ├── panelStore.ts # Panel state
│ │ │ └── ... # Other stores
│ │ ├── contexts/ # React context providers
│ │ ├── services/ # Frontend services
│ │ └── utils/ # Utility functions
│ │ └── timestampUtils.ts # Timestamp handling
├── main/ # Electron main process
│ ├── src/
│ │ ├── index.ts # Main entry point (776 lines)
│ │ ├── preload.ts # Preload script
│ │ ├── events.ts # Event handling (1,108 lines)
│ │ ├── database/ # SQLite database
│ │ │ └── migrations/ # Database migration files
│ │ ├── ipc/ # IPC handlers (23 handlers)
│ │ │ ├── git.ts # Git operations (1,391 lines)
│ │ │ ├── session.ts # Session management (1,872 lines)
│ │ │ ├── file.ts # File operations (865 lines)
│ │ │ ├── claudePanel.ts # Claude panel management
│ │ │ ├── codexPanel.ts # Codex panel management
│ │ │ └── ... # 18 more IPC handlers
│ │ ├── services/ # Business logic services (33 modules)
│ │ │ ├── sessionManager.ts # Core session lifecycle (1,598 lines)
│ │ │ ├── worktreeManager.ts # Git worktree operations (931 lines)
│ │ │ ├── panelManager.ts # Panel lifecycle coordinator
│ │ │ ├── terminalPanelManager.ts # Terminal panel processes
│ │ │ ├── taskQueue.ts # Bull queue
│ │ │ └── panels/ # Panel-specific services
│ │ │ ├── claude/ # Claude CLI integration
│ │ │ ├── codex/ # Codex CLI integration
│ │ │ ├── cli/ # Abstract CLI manager
│ │ │ └── ai/ # Abstract AI panel base
│ │ ├── polyfills/ # Node.js polyfills
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ │ └── timestampUtils.ts # Timestamp handling
│ └── dist/ # Compiled output
├── shared/ # Shared TypeScript types
│ └── types/
│ └── panels.ts # Panel type definitions
├── tests/ # E2E tests (Playwright)
├── scripts/ # Build and utility scripts
├── docs/ # Documentation
│ ├── troubleshooting/ # Troubleshooting guides
│ ├── ADDING_NEW_CLI_TOOLS.md
│ └── IMPLEMENTING_NEW_CLI_AGENTS.md
├── dist-electron/ # Packaged Electron app (generated during build)
├── package.json # Root workspace configuration
└── pnpm-workspace.yaml- Create/Select Project: Choose a project directory or create a new one
- Create Session: Click "Create Session" and enter a prompt
- Parallel Sessions: Run multiple sessions for different approaches
- View Results: Switch between Output, View Diff, and Terminal views
- Click the ? button in the sidebar to open the comprehensive help dialog
- The help dialog covers all features, keyboard shortcuts, and tips
- 🟢 Initializing: Setting up git worktree
- 🟢 Running: Claude is actively processing
- 🟡 Waiting: Needs your input
- ⚪ Completed: Task finished successfully
- 🔵 New Activity: Session has new unviewed results
- 🔴 Error: Something went wrong
- Rebase from main: Updates your worktree with latest main branch changes
- Squash and rebase: Combines all commits and rebases onto main
- Always preview commands with tooltips before executing
- Use descriptive prompts for better AI-generated session names
- Create multiple sessions to explore different solutions
- Review View Diff tab before git operations
- Use Terminal tab to run tests after changes
- Archive completed sessions to keep the list manageable
- Set up project-specific prompts for consistency
- Session won't start: Check if git repository is initialized
- Git operations fail: Ensure no uncommitted changes conflict
- Terminal not responding: Check if Claude Code is installed correctly
- Notifications not working: Grant permission when prompted
Enable verbose logging in Settings to see detailed logs for troubleshooting.
In development mode, Pane automatically captures all frontend console logs and writes them to a file that Claude Code can read for debugging purposes.
Location: frontend-debug.log and backend-debug.log in the project root directory
Usage for Claude Code debugging:
- Add debug console.log statements to frontend components
- Reproduce the issue in the Pane app
- Read
frontend-debug.logandbackend-debug.logto see what happened - No need to manually check Chrome DevTools or ask humans to copy logs
frontend-debug.log and backend-debug.log are reset every time the user runs in development mode, so if they report that a change is not working, you can look at those logs and they will represent the session they tested the change.
IMPORTANT Logs are best investigated in a sub-agent
File rotation: The log file grows continuously during development. Delete or truncate it manually if it gets too large.
Note: This feature is only active in development mode and will not affect production builds.
IMPORTANT: This codebase enforces a strict no-any policy. The TypeScript 'any' type is NOT allowed.
- ❌ NEVER use *
any** type* - ESLint will error and CI/CD will fail - ✅ Use
unknownwhen the type is truly unknown (requires type guards before use) - ✅ Use specific types or interfaces whenever possible
- ✅ Use generics with type constraints for flexible but type-safe code
Enforcement:
- ESLint rule
@typescript-eslint/no-explicit-anyis set to'error' - GitHub Actions quality workflow enforces this on all PRs
- Local development will show errors immediately
Pane is an independent project created by Dcouple Inc. Claude™ is a trademark of Anthropic, PBC. Pane is not affiliated with, endorsed by, or sponsored by Anthropic. This tool is designed to work with Claude Code, which must be installed separately.
Do what has been asked; nothing more, nothing less. NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one. NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.