Repository navigation
custom claude command
The Assistant runs the claude command-line program. Many organizations let Claude Code run only inside a sandbox of their own: a container, a virtual machine, a launcher script or a remote host. With the Claude Command setting, you say how claude starts. Dear Reviewer learns nothing about your sandbox.
Open your user settings.json and set dearReviewer.claudeCommand to a list of strings:
"dearReviewer.claudeCommand": ["docker", "exec", "-i", "my-box", "claude"]The first item is the program, a path (a leading ~ is expanded) or a name on the PATH, and Dear Reviewer adds its own arguments after the others and runs the command without a shell.
Type each item without quotes around it, also when you add it with Add Item in the Settings editor. Each item is one whole argument, spaces included, and no shell removes quotes, so quotes typed around ~/bin/claude-in-sandbox become part of the path, and the ~ isn't expanded. The Settings editor warns about an item wrapped in quotes, and when the command can't run, the Assistant shows it as JSON, so stray quotes show.
You can also point it at a script of your own:
"dearReviewer.claudeCommand": ["~/bin/claude-in-sandbox"]Leave the list empty to use the first claude on your PATH, or else the first one in ~/.local/bin, /opt/homebrew/bin, /usr/local/bin, ~/.npm-global/bin or ~/.claude/local.
Dear Reviewer ignores this setting in a .vscode/settings.json or .code-workspace file. A repository you review can't make Dear Reviewer run a program it chose, so set the command in your user settings.json.
Dear Reviewer starts every run through the command: claude auth status, which checks your login, and each conversation with the Assistant.
Dear Reviewer talks to claude through its standard input and standard output, so your command must not change what passes through them. It must do five things:
- Pass the arguments, standard input and standard output to
claudeunchanged. Write nothing else to standard output, because a banner or a log line breaks the conversation. Write notes for yourself to standard error. - Run
claudein the folder your command was started in. Each conversation has a folder of its own, and--resumefinds a saved session only from that folder. - Show
claudeDear Reviewer's global storage folder at the same path your machine uses. That folder holds the conversation folders, the Change's worktrees and the Assistant folders, andclaudecan't read the Change without it. In a container, mount the folder at the same path. - Let
claudewrite its config folder, by default~/.claude.--resumeneeds the saved sessions there, and signing in saves credentials there. If the folder is read-only, or new on every run, the Assistant forgets earlier conversations. - Set any other environment variables in the command itself. Dear Reviewer passes only the variables
claudeneeds to find itself, your login and the network, plusLC_*, and neverANTHROPIC_*orCLAUDE_CODE_*. If your command needs more, such asDOCKER_HOST, set them in the script.
This script runs claude in a container that already has your storage folder mounted at the same path:
#!/bin/sh
# Start claude in the container "my-box", in the folder Dear Reviewer started
# this script in. -i passes standard input through; there is no terminal.
exec docker exec -i -w "$PWD" my-box claude "$@"Make it executable, then set dearReviewer.claudeCommand to its path. A command with arguments, such as the docker exec list above, works the same way when it needs no extra steps.
Dear Reviewer gives claude a small server that reads the Change's git history. claude starts it with VS Code's own program, at its path on your machine. When claude runs in a container or on another machine, that path doesn't exist or can't run there, so the server fails.
Everything else still works. The Assistant reads and searches the Change's files, and the summary, the chat and the Findings are unaffected. It can't look up older history, such as which commit added some code, and it says so instead of guessing.
When the git tools don't start, the Assistant's panel shows a line saying so, with a link to this guide. It shows again for each conversation that starts without them.
This page mirrors wiki/custom-claude-command.md. Edit it there: each push to main rewrites the wiki.