Suddenly everyone is building multi-agentic workflows on top of git worktrees, and there are a lot of apps to manage them. Most of them do too much, and they don't support jj workspaces. Here is mine, which aims to do as little as possible while remaining useful.
dwm (pronounced "doom") creates, lists, and deletes workspaces stored under
<repo>.dwm/worktrees/<name>/, with a shell wrapper that
auto-cds into the selected workspace. It works with both jj and git
repositories.
The workspace directory sits next to the repo rather than inside it, so for
~/dev/myrepo workspaces live in ~/dev/myrepo.dwm/worktrees/.
A jj workspace has no .git of its own, so git and editors that use it walk up
to the nearest enclosing repo; keeping workspaces outside the repo means they are never
mistaken for ignored files in it, and there is nothing to add to your ignore rules.
It provides an interactive TUI picker for browsing and switching between workspaces, with filtering, sorting, and inline deletion. It will also show a live-updating summary of Claude Code sessions that are running in each workspace.
My workflow looks like this: dwm new to create and move to the new worktree,
and then claude to open my coding assistant of choice. Once my changes are
done, I run dwm delete to clear up the worktree. If I'm switching between
long-lived tasks, I use dwm list to see my open workspaces.
Shell installer (macOS and Linux):
curl --proto '=https' --tlsv1.2 -LsSf
https://github.com/drivasperez/dwm/releases/download/v2.1.1/dwm-installer.sh | sh
Pre-built binaries are available on the latest GitHub release.
`dwm` needs to add a small snippet to your shell config in order to be able to switch
directories for you. Run dwm setup interactively and it will offer to add the
wrapper to your shell config and set up agent hooks automatically:
dwm setup
Or add it manually:
Bash / Zsh — add to .bashrc or .zshrc:
eval "$(dwm shell-setup)"
Fish — add to ~/.config/fish/config.fish:
dwm shell-setup --fish | source
This wraps the dwm binary so that selecting a workspace automatically
cds into it.
After dwm new creates a workspace, it can run a setup script (e.g.
npm install, copy .env, …) so the workspace is immediately usable.
Configure it via .dwm.toml at the repo root:
[scripts]
setup = "npm install && cp ../main/.env .env"
# `run` and `archive` are reserved for future lifecycle hooks; parsed but not invoked yet
If .dwm.toml is absent but a
Conductor
conductor.json exists at the repo root, dwm reads
scripts.setup from it as a drop-in fallback. Conductor-specific fields like
runScriptMode and enterpriseDataPrivacy are accepted and ignored,
so an existing conductor.json works without edits.
The script runs as sh -c "<command>" with the new workspace as its
working directory. Stdout and stderr from the script are forwarded to dwm's stderr (dwm's
stdout is reserved for the path the shell wrapper cds into). A non-zero exit
prints a warning but doesn't unwind — the workspace is still created and you're still
cdd into it.
The script sees these environment variables:
jj or git--from <name> value, if providedDWM_REPO_ROOT, for Conductor compatDWM_WORKSPACE_PATHDWM_WORKSPACE_NAMESeed new Git or jj workspaces with selected ignored files before setup runs. On APFS and supported Linux filesystems, independent copies share disk blocks until modified. Other filesystems fall back to ordinary copies.
[workspace]
copy = ["node_modules", "target"]
copy_mode = "auto"
# Git only; opt in to experimental tracked-file sharing:
# checkout = "cow"
Paths are literal and relative. Files must be ignored in both workspaces;
tracked files and existing destination files are never overwritten. Files
not ignored at the new workspace's revision are skipped with a warning, or
fail creation with copy_unignored = "error".
--from selects the copy source. Keep source artifacts idle while
copying and let setup reconcile dependencies. Symlinks keep their original
targets; environments containing absolute paths may need rebuilding.
A .worktreeinclude file at the source root, Claude Code's
convention, is also honoured: it uses .gitignore syntax, and every
ignored file matching one of its patterns is copied alongside the
copy entries.
Experimental Git checkout sharing reports fallback for unsupported filesystems, hooks, attributes, and other unproven configurations. It currently trades additional verification time for reduced disk allocation. Failed population leaves a locked worktree for inspection. jj supports ignored-file copying but not the experimental checkout mode. Logical directory sizes do not show copy-on-write savings.
dwm can show the status of
Claude Code agents running in
your workspaces. The TUI's "Agent" column displays per-workspace counts like
2 waiting, 1 working.
To set it up, run:
dwm setup
This installs Claude Code hooks that report agent status to dwm.
--yes is passed
dwm --version)
┌──────────────────────────┐
│░░░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░Hello░░robot░░│
│░░░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░┌┐░░┌┐░░░░░│
│░░┌┐░░░░░░░░░░░└┘░░└┘░░░░░│
│░░││░░░░░░░░░░░░░░░░░░░░░░│
│░░└┘░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░┌─────────────┐░░│
│░░░░░░░░░│▚▚▚▚▚▚▚▚▚▚▚▚▚│░░│
│░░░░░░░░░└─────────────┘░░│
│░░░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░░░│
└──────────────────────────┘