Remix.run Logo
meowface 3 hours ago

As a daily Claude Code and Codex user, I've really got to start getting into jj. I keep telling myself I will but I'm just so used to git.

Can you elaborate on how you personally use jj workspaces with command-line coding agents?

cube2222 2 hours ago | parent [-]

Sure. Honestly I think you can get the same with git work trees, though I haven't tried.

After a couple iterations on this, I've ended up having claude code vibe-code a helper CLI in Go for me which I can invoke with `ontheside <new-workspace-name> <base-change>` and will

- create a new jj workspace based on the given change

- create a docker container configured with everything my unit tests need to run, my claude code config mounted, and jj configured

- it also sets up a claude code hook to run `jj` (no arguments) every time it changes a file, so that jj does a snapshot

- finishes by starting an interactive claude code session with `--dangerously-skip-permissions`

- it also cleans it all up once I exit the claude code session and fish shell that's running it

With this I can have Claude Code working asynchronously on something, while I can review (or peek) the changes in batch from my main editor by running `jj show <change-id>` / `jj diff -r "..."` (which in my case opens it up in the Goland multi-file diff viewer). I can also easily switch to the change it's working on in my main editor, to make some manual modifications if necessary.

This is, in general, primarily for "in the background async stuff" I want to have it work on. Most of the time I just have a dead-normal claude code session running in my main workspace.

Minor self-plug - if you want, I posted a jj intro article a while ago[0], though it doesn't include my current workspace usage.

[0]: https://kubamartin.com/posts/introduction-to-the-jujutsu-vcs...