[FEATURE] /diff panel: support Jujutsu (jj) working copies

Status Open
Reported on v2.1.283
Maintainer reply None cached
Activity 1 comment · opened Sep 26, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The /diff panel reads only git. In a Jujutsu (jj) repository that leaves it either blind or showing git's view of the repository:

  • Secondary jj workspaces (jj workspace add) have a .jj/ but no .git. git rev-parse fails there, so /diff reports that the directory isn't in a git repository and opens nothing. This is where we do most of our work: one workspace per change.
  • The colocated default workspace works by accident: jj keeps git's HEAD at @-, so "uncommitted changes" happen to equal the working-copy change. The comparison bases are still git's (HEAD, the merge-base with the default branch), not jj's (@-, trunk()).

Proposed Solution

Ship a jj backend for the built-in diff mod. The mod already has the slot: INSTALLED_BACKEND_PROBES in mods/diff/hooks/backend/installed-backend-probes.ts ("Where a host adds backends: probes for version-control systems other than git … Empty as shipped"), and backendOf asks those probes before git.

A jj probe could claim a directory where jj root succeeds and map the existing modes:

| Mode | jj |
| --- | --- |
| uncommitted | jj diff --git -r @ (the working-copy change against its parent) |
| branch | jj diff --git --from 'trunk()' --to @ |
| session | jj diff --git --from <commit id of @ at session start> --to @; commit ids are stable, so no mtime heuristics are needed |

jj diff --git prints git-format unified diffs, the format the panel already reads.

Alternative Solutions

  • Expose the probe slot to plugins, for example as a noun contract, so a jj backend can live in a plugin. Today only a host compiling the module in can reach it ("there is no other channel").
  • Copy mods/diff into our own plugin with a jj probe added. That forks an early-access API that may change between releases.
  • Run jj diff in the terminal. That loses the live panel, the refresh on edits and attaching lines to the next prompt.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

  1. I keep several jj workspaces side by side, one per change under review.
  2. I start Claude Code in one of them and ask it to change code.
  3. With jj support, /diff opens beside the conversation and shows the change growing as Claude edits, compared against @- or trunk().
  4. Today it opens nothing in that workspace, so I leave the session to run jj diff.

Additional Context

  • Claude Code 2.1.283, jj 0.45.1, macOS.
  • Every jj command snapshots the working copy unless it passes --ignore-working-copy. The panel's periodic checks (the headKeyOf poll) should pass it, or they will record files the user hasn't cleaned up yet, such as build artifacts.
  • Related jj gaps: #74775 (detecting .jj/ in environment metadata), #85118 (worktree isolation guard and jj).

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗