agents/skills/jj-workspaces/SKILL.md
Use when you want to work in an isolated jj working copy — parallel task, experimental scratch, subagent with its own tree. Covers creating a workspace, working inside it from anywhere, and cleaning up without losing history.
npx skillsauth add timofreiberg/dotfiles jj-workspacesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A workspace is a second working directory attached to the same repo. Each
workspace has its own @ (working-copy commit), but they share the same
.jj store — commits you make in one appear immediately in jj log from
the other. Analogous to git worktree but through jj's abstraction.
@ (WIP pile,
in-progress conflict resolution, mid-rebase).Not the right tool for:
jj new.jj -R <path> to operate on a different repo.
Workspaces share the same repo; they're not independent clones.# Default: shares parents with current @
jj workspace add --name NAME /abs/path/to/new-workspace
# With an explicit base revision
jj workspace add --name NAME -r <rev> /abs/path/to/new-workspace
Convention: put the workspace as a sibling of the repo. Repo at
~/src/foo → workspace at ~/src/foo-NAME/. Keeps jj log's
<name>@ marker meaningful and avoids nesting a workspace under a path
the main repo scans.
NAME appears in jj workspace list and as <name>@ in jj log from any
workspace. Pick something descriptive; you'll see it until you forget.
You don't have to cd into the workspace. jj accepts a repo path via
-R, and most tools handle absolute paths:
# Target the workspace from anywhere
jj -R /abs/path/to/workspace st
jj -R /abs/path/to/workspace log
jj -R /abs/path/to/workspace commit /abs/path/to/workspace/file.ts -m "msg"
Claude's Bash tool doesn't persist shell state between calls, so cd in
one call doesn't affect the next. For one-shot ops, jj -R <abs-path> is
the cheapest shape. For a concentrated stretch inside the workspace,
chain with ; or && in a single Bash call:
cd /abs/path/to/workspace && jj st && jj new -m scratch
Order: check → commit/push anything you want to keep → forget → remove dir.
# 1. Inspect. Uncommitted changes?
jj -R /abs/path/to/workspace st
# 2. Any commits reachable only from this workspace? (from main workspace)
jj log
# Look for changes under the <name>@ marker that aren't bookmarked or pushed.
# If they matter: bookmark, push, or rebase onto main before proceeding.
# 3. Detach the workspace from the repo's workspace list.
jj -R /path/to/main/repo workspace forget NAME
# 4. Remove the directory.
rm -rf /abs/path/to/workspace
workspace forget doesn't touch the filesystem — it only releases the
working-copy commit from the repo's tracking. After that, commits only
reachable from the forgotten @ become eligible for GC eventually, so
bookmark or push anything you want to keep before forgetting.
The "I committed everything, just prune" happy path:
jj -R /abs/path/to/workspace st # verify clean
jj -R /path/to/main/repo workspace forget NAME
rm -rf /abs/path/to/workspace
rm -rf without workspace forget — main repo keeps a dead entry
in jj workspace list. Not data loss, just noise. Fix with
jj workspace forget NAME after the fact.jj log — reachable-only commits can be
GC'd. Always inspect first; bookmark or push anything worth keeping.-R — resolved against cwd, not the workspace.
Use absolute paths when targeting a non-current workspace.@ independently,
but two workspaces editing the same path and both committing can leave
the repo with two divergent heads. Not broken, just confusing; prefer
one active workspace per logical task.development
Quick internet research via a web-search-enabled model. Returns summaries with source URLs.
tools
Use when working on the pi coding agent harness or writing pi extensions.
testing
Use when creating, editing, or reviewing a skill before it ships. Covers when to write a skill, file layout, the SKILL.md shape, and how to verify it before relying on it.
data-ai
Use when creating or updating CLAUDE.md / AGENTS.md files for a project or a subdirectory. Covers the split between top-level (how to work here) and domain-level (why this exists, what it promises), and the freshness date convention.