An opinionated workflow for parallel AI-assisted feature development using cmux, git worktrees, Claude Code and LazyVim. This repo contains a couple of shell scripts for the workflow.
midnight.demo.mov
This repo helps me isolate concurrent agent workspaces in cmux. The scripts in this repo create a clean workflow where git worktrees are helpful:
- Running
new-featurespawns a new cmux workspace in a dedicated git worktree - Each workspace launches dedicated processes in their own cmux workspace tab: Claude code, nvim, an action menu. I'd suggest you to tinker with this aspect of the script so that each invocation of
new-featureopens up a workspace that is suitable for your working style.
- Herdr
- This HN post enumerates extra options even more
- Superset
- Emdash
- cmux — terminal with workspace/tab management CLI
- Claude Code —
claudeCLI available in PATH - Neovim —
nvimCLI available in PATH. I recommend LazyVim. - gum — renders the session controls TUI (menus, confirmations). Install with
brew install gum. - git 2.5+
Clone or copy the scripts into a directory on your $PATH:
git clone https://github.com/appendjeff/agentic-workflow.git ~/agent-binAdd ~/agent-bin to your PATH if needed (e.g. in ~/.zshrc):
export PATH="$HOME/agent-bin:$PATH"Run from anywhere inside a git repository. Creates a new isolated workspace for a feature.
$ new-feature
Feature name: user auth redesign
What it does:
- Prompts for a feature name (e.g.
"user auth redesign") - Slugifies it into a branch name:
feature/user-auth-redesign - Ensures
.worktrees/is in.gitignore(adds it if missing) - Fetches
originand creates a worktree branching fromorigin/main - Opens a new named cmux workspace pointed at the worktree
- Starts
claudein the left pane - Opens LazyVim (in file picker mode) in a right split pane for browsing/reviewing files
- Opens a terminal in a bottom split under Claude (~20% height)
- Refocuses the Claude pane
Result: A new cmux tab named "user auth redesign" with Claude on the top-left, a terminal on the bottom-left (~20%), and nvim on the right — all scoped to .worktrees/user-auth-redesign/ on branch feature/user-auth-redesign.
Run from inside a feature worktree when the work is complete (merged or abandoned).
$ done-feature
Cleaning up:
Branch: feature/user-auth-redesign
Worktree: /path/to/repo/.worktrees/user-auth-redesign
Workspace: 5B485556-0051-4F7C-826D-189F4E61F199
What it does:
- Guards against running from outside a
.worktrees/directory - Navigates to the main repo root
- Removes the worktree directory
- Deletes the local branch (
-d; prompts before force-deleting if unmerged) - Closes the cmux workspace (last, since this kills the shell)
# Start a new feature from any directory inside your repo
$ new-feature
Feature name: redesign search
# ... Claude works in the isolated worktree ...
# ... you review, merge the PR ...
# when the agent fails, you can use the text editor to fix it or open one of the items from the action menu to improve things
# Clean up from inside the worktree tab
$ done-feature