[FEATURE] Detect Jujutsu (.jj/) repositories in environment metadata

Resolved 💬 2 comments Opened Apr 4, 2026 by lukasmalkmus Closed May 14, 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

Claude Code's environment metadata includes Is a git repository: true/false based on .git/ detection. There is no equivalent for Jujutsu (.jj/) repositories.

In colocated jj+git repos (both .jj/ and .git/ present), the environment reports only Is a git repository: true. The model treats this as authoritative system context and defaults to git commands, even when users have configured CLAUDE.md instructions, SessionStart hooks, and PreToolUse guards directing it to use jj.

User-injected additionalContext from hooks cannot reliably override built-in environment metadata because the model treats system-level context as more authoritative.

Proposed Solution

Detect .jj/ directories alongside .git/ when populating the environment metadata section of the system prompt:

  • .jj/ only (non-colocated): Is a jj repository: true
  • .jj/ + .git/ (colocated): Is a jj repository: true (or similar, indicating colocated setup)
  • .git/ only: Is a git repository: true (unchanged)

This would let the model correctly identify the primary VCS without users needing to fight the built-in metadata with hooks.

Alternative Solutions

  • SessionStart hooks injecting additionalContext stating "this is a jj repo" (partially works, but the built-in metadata contradicts it)
  • PreToolUse hooks that block mutating git commands in .jj/ directories (works for enforcement, but the model still thinks in git terms)
  • Project-level CLAUDE.md with explicit jj instructions (per-repo, doesn't scale)

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

  1. User opens Claude Code in a jj colocated repository
  2. System prompt says Is a git repository: true with no mention of jj
  3. User asks "tell me what VCS this project uses"
  4. Model answers "Git" because that's what the environment metadata reports
  5. Subsequent version control operations default to git commands
  6. User's hooks and rules have to fight uphill against the model's initial understanding

Additional Context

Jujutsu is growing in adoption. Colocated repos (.jj/ + .git/) are the default setup, so detecting .git/ alone will always misidentify these as plain git repos.

This is the same class of problem as alternative VCS tools (Sapling, etc.) not being detected, but Jujutsu's colocated mode makes it particularly problematic since .git/ is present and actively misleads the model.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗