workon
Development workspace launcher using Zellij.
Opens a project directory in a 3-pane Zellij layout:
- Left top (80%): Claude CLI
- Left bottom (20%): Terminal
- Right (50%): branchdiff
Dependencies
- zellij - Terminal multiplexer
- claude - Claude CLI
- branchdiff - Git/jj diff TUI
- jj - Required for
-w(workspace) mode
Installation
Or build from source:
Usage
Workspace mode (-w)
Creates an ephemeral jj workspace in ~/.worktrees/ for running a second independent session on the same repo. The workspace is cleaned up when the Zellij session closes.
What it does:
- Initializes jj (colocated) if the project only has git
- Creates a jj workspace branched from trunk (main/master)
- Clones gitignored files (build artifacts,
node_modules/,target/, etc.) using APFSclonefile(2)on macOS for near-instant copy-on-write directory cloning, with cross-platform reflink fallback via clonetree - For Rails apps: creates an isolated test database and loads the schema
- Launches a Zellij session in the workspace
- On exit: prompts to bookmark uncommitted work, forgets the jj workspace, drops any test database, and removes the directory in the background
The primary session (workon mbc) is unaffected — it works directly in the project directory as before.
Limitations
- The workspace shares the development database with the primary session. Don't run migrations or the Rails server from a workspace.
parallel_rspecuses shared test databases. Usebundle exec rspecin the workspace for isolated specs.
Custom layout
The default Zellij layout is embedded in the binary. To override it, create ~/.config/workon/layout.kdl with your preferred layout.
Session management
Sessions are named after the directory basename. Running workon mbc twice reattaches to the existing session. Use -n to start fresh.
If a zellij server is hung, workon detects the unresponsive IPC (5s timeout), kills only the server bound to your project's session (other sessions are left alone), removes the stale socket, and launches a fresh session. Recovery runs whether or not you pass -n. Pre-flight checks before attach and launch ensure the no-timeout interactive zellij commands won't block on a wedged server.
Workspace sessions are named <project>-ws-<id> (e.g., mbc-ws-a1b2c3) and don't collide with primary sessions.
Claude Code setup
To skip the workspace trust prompt and auto-allow file operations in worktrees, add to ~/.claude/settings.json:
Workspace trust is also pre-seeded in ~/.claude.json automatically on each workon -w launch.
Tips
- Click URLs:
Cmd+Shift+Clickto open hyperlinks (Shift bypasses zellij mouse handling) - Locked mode: Zellij starts in locked mode. Press
Ctrl+Gto unlock for Zellij features.