[BUG] /code-review (ultrareview) regression: no longer finds git repos in subdirectories of the session root
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
/code-review ultra used to work from a VS Code workspace whose root is a parent directory
containing several sibling git clones. After updating the extension it refuses, with:
/ultrareview needs a git repository so it can clone your code into a cloud sandbox,
but /home/user/Git/Parent is not inside one.
Run "git init" here to create a repository, or cd into an existing one.
The workspace root has not changed. Only the extension version did.
Environment
- Extension:
anthropic.claude-code2.1.220 (linux-x64), installed 2026-07-25 - VS Code: official build,
/usr/share/code/code, launched from the GNOME menu (restores last workspace) - OS: Linux 6.8.0 (Ubuntu), shell
/bin/tcsh
Directory layout
The workspace root is a container directory, not itself a repo. The git repos are one level down:
/home/user/Git/Parent/ <- VS Code workspace root (NOT a git repo)
├── RepoA/ <- git repo (feature branch under development)
├── RepoB/ <- git repo (companion project, separate branch)
└── ...
/home/user/Git/Other/RepoC/ <- further repos added to the same workspace
This layout is deliberate: work spans several interdependent repos, and a parent-level root keeps
them all visible in one window.
Expected behaviour
/code-review ultra reviews the branch of the relevant repository, as it did prior to the update.
Actual behaviour
It refuses outright because the session root itself contains no .git, without considering the
repositories in its subdirectories.
Evidence that this is a regression, not a configuration change
The session root has been unchanged for over a month. Claude Code stores one project directory
per session root under ~/.claude/projects/; mine shows:
-home-user-Git-Parent/— ~70 sessions, continuous daily use from 2026-06-27 through today-home-user-Git-Parent-RepoA/— zero session files
So every session, including all the ones where /code-review ultra worked, ran from the same
parent root. The only variable that changed is the extension version (updated 2026-07-25 to 2.1.220).
Possibly related changelog entries
- v2.1.216 (2026-07-20): "Fixed
.gitdetection issues in various scenarios" - v2.1.218 (2026-07-22): "/code-review now runs as background subagent"
Both land in the window between "working" and "broken", though neither states that
subdirectory/parent-directory discovery was intentionally removed.
Related issue
#50343 — "/ultrareview fails in bare-repo + worktree container directory" describes the same
shape (refusal from a container directory when valid repos exist in subdirectories). It was closed
2026-05-25 and marked stale 2026-07-20. This report is a clean before/after case with an unchanged
workspace, which that issue lacked.
Impact on workflow
/code-review ultra was the last step before opening a PR, run in the same chat as the work itself,
with findings landing in the conversation where the code was written.
The available workarounds are all materially worse:
- Reopen VS Code on the repo — only one directory can be the root, but reviews are needed across
several repos, so no single choice works.
- Multi-root workspace with the repo first — same problem: the root is singular.
- A second VS Code window per repo — works, but the review runs in a separate chat with none of
the working context, and findings have to be copied back by hand.
- CLI in a terminal — defeats the point of working in the editor.
Suggested fix
Restore discovery of a git repository from the session root — e.g. locate the repo that contains the
changed files, or offer a choice when the root contains several. Failing that, allow the target
repository to be passed explicitly (/code-review ultra --repo <path>); today the only argument is a
GitHub PR number, which does not help repos hosted elsewhere (e.g. self-hosted Bitbucket/Stash).
Minor: the suggested remedy is harmful here
The error advises Run "git init" here. In this layout that would create a repository in a directory
whose subdirectories are already repositories — confusing at best, and it does not achieve what the
user wants. The message should not suggest git init when subdirectories already contain repos.
What Should Happen?
/code-review ultra should locate the git repository containing the code under review,
rather than requiring the session root itself to be a repository.
My VS Code workspace root is a container directory holding several sibling clones
(Parent/RepoA, Parent/RepoB). Until the 2.1.220 update, running /code-review ultra from
that root worked — it reviewed the branch I was working on. It should still do that:
discover the repo that contains the changed files, or prompt me to choose when the root
contains more than one.
The workspace root has not changed; only the extension version did.
Error Messages/Logs
Steps to Reproduce
cat > /tmp/claude-1000/-home-math-Git-Compiler/b5a069bf-227c-4473-b983-3f66837b004d/scratchpad/field-repro.txt <<'EOF'
- Create a container directory that is NOT itself a git repository, holding two git
repositories as subdirectories:
mkdir -p /tmp/parent/RepoA /tmp/parent/RepoB
cd /tmp/parent/RepoA && git init && git commit --allow-empty -m init
git checkout -b feature/x && git commit --allow-empty -m "work"
cd /tmp/parent/RepoB && git init && git commit --allow-empty -m init
- In VS Code: File -> Open Folder -> /tmp/parent
(the container directory, NOT one of the repos). This is the session root.
- Open the Claude Code chat panel in that window.
- Run: /code-review ultra (or /ultrareview)
- Observed: it refuses immediately with
/ultrareview needs a git repository so it can clone your code into a cloud sandbox,
but /tmp/parent is not inside one.
Run "git init" here to create a repository, or cd into an existing one.
It does not consider RepoA or RepoB, even though both are valid git repositories
directly beneath the session root and one has a feature branch ahead of its base.
- Workaround that confirms the cause: File -> Open Folder -> /tmp/parent/RepoA
(the repo itself) in a new window, then run /code-review ultra there. It works.
Only the session root differs between the failing and working case.
Extension version: anthropic.claude-code 2.1.220 (linux-x64).
The same workspace root worked with earlier versions; it broke after updating.
EOF
nohup xclip -selection clipboard -i /tmp/claude-1000/-home-math-Git-Compiler/b5a069bf-227c-4473-b983-3f66837b004d/scratchpad/field-repro.txt >/dev/null 2>&1 &
sleep 1; echo "on clipboard: $(xclip -selection clipboard -o 2>/dev/null | wc -c) bytes"; xclip -selection clipboard -o 2>/dev/null | head -2
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unknown precisely — the previous version was replaced by auto-update on 2026-07-25 and VS Code retained no record of it. Probable last working version: 2.1.215, on the basis that v2.1.216 (2026-07-20) lists "Fixed .git detection issues in various scenarios" in its changelog. This is inferred from the changelog and the timing, not verified by downgrading. Confirmed broken in: 2.1.220 (linux-x64).
Claude Code Version
2.1.220
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
VS Code extension chat panel (not a terminal)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗