IDE extensions
You don’t have to launch Claude Code from the terminal to get routing. The official Claude Code IDE extensions can route through the proxy too - install the notdiamond hooks once, point the extension at your running proxy, and every request from the editor is routed.
Supported editors
Section titled “Supported editors”| Editor | Extension | Notes |
|---|---|---|
| VS Code (and forks: Cursor, Windsurf, Kiro) | Claude Code (anthropic.claude-code) |
First-party. Bundles its own copy of the CLI. |
| JetBrains - IntelliJ IDEA, PyCharm, WebStorm, PhpStorm, GoLand, Android Studio (and most JetBrains IDEs) | Claude Code [Beta] | First-party. Requires the notdiamond / claude CLI installed separately. |
Any other tool that speaks the Anthropic API and honours global Claude Code hooks and ANTHROPIC_BASE_URL will work the same way.
Run notdiamond init first if you haven’t set up your credentials yet.
1. Install the hooks
Section titled “1. Install the hooks”notdiamond hooks install # add hooks and environment variables belownotdiamond hooks uninstall # remove hooks and environment variables belowIn the CLI, notdiamond claude installs hooks automatically to ensure features for routing can be extracted reliably. The IDE extensions launch Claude Code themselves, so notdiamond claude never runs, meaning we have to install the hooks separately.
The install writes the following to ~/.claude/settings.json, which every Claude Code session reads:
- Hooks:
SessionStartstarts the proxy if needed,UserPromptSubmitmarks human prompts, andPreModelSwitchrefuses/modeland the model picker. Each one compares the session’sANTHROPIC_BASE_URLagainst your proxy (localhost,127.0.0.1or[::1]at the configured port) and exits immediately if it doesn’t match. - The pin:
modelandeffortLevelstart every session onclaude-opus-5[1m]atxhigh,CLAUDE_CODE_EFFORT_LEVELlocks/effort, andCLAUDE_CODE_DISABLE_FAST_MODEcloses/fast. It also setsENABLE_TOOL_SEARCH=true, to reduce context window utilization overhead.
Note the settings values can’t be gated, so the pin applies to every Claude Code session on the machine after install, terminal included. When you run notdiamond hooks uninstall, it removes every key that still holds the installed value - including ones that were there before the install. Make sure you re-add anything you want to keep.
2. Point the extension at the proxy
Section titled “2. Point the extension at the proxy”VS Code, Cursor and Windsurf - add this to the editor’s settings.json (Command Palette → Preferences: Open User Settings (JSON)), then reload the window:
{ "claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "http://127.0.0.1:8082" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "notdiamond-proxy" } ]}ANTHROPIC_BASE_URLpoints the editor at the local proxy. Match the port to yourserver.portif you changed it in Configuration.ANTHROPIC_AUTH_TOKENis a sentinel value for API-key-backed proxy modes. Claude Code only routes to a custom base URL when an auth token is present; without it the extension falls back to the Anthropic login screen. The proxy ignores the value -notdiamond-proxyis just a placeholder.
Keeping this in the editor’s settings rather than ~/.claude/settings.json scopes routing to that editor, so a terminal claude on the same machine isn’t routed.
JetBrains - the plugin has no environment setting of its own, so use an env block in ~/.claude/settings.json instead:
{ "env": { "ANTHROPIC_BASE_URL": "http://127.0.0.1:8082", "ANTHROPIC_AUTH_TOKEN": "notdiamond-proxy" }}That block applies to every Claude Code session on the machine, terminal included. notdiamond claude handles it correctly - it detects the installed hooks and does not double up on them.
3. Open the extension
Section titled “3. Open the extension”Open the Claude Code panel in your editor and start a session. Requests now flow through the proxy; check notdiamond logs -f or the dashboard to confirm they’re being routed.
Notes per editor
Section titled “Notes per editor”- JetBrains runs your installed CLI directly, so once
~/.claude/settings.jsonis set it routes reliably. Point the plugin at the binary under Settings → Tools → Claude Code [Beta] → Claude command if it isn’t auto-detected. - VS Code bundles its own CLI build. Keep the extension up to date - some 2.0.x releases shipped a regression that ignored
ANTHROPIC_BASE_URL.
Troubleshooting
Section titled “Troubleshooting”Start with notdiamond doctor. It reports whether the hooks are installed, whether they still match your configured port, and whether the pin is still in place.
/model, /effort or /fast is refused in the editor. That’s the pin from step 1 - the same lock notdiamond claude applies in the terminal. notdiamond hooks uninstall releases it.
Requests show up on the logs, but new prompts keep reusing an earlier model. The human-turn hook may not be running. Re-run notdiamond hooks install after any change to server.port, then restart the Claude Code session. Older hook installations matched only the configured hostname, so update notdiamond and reinstall the hooks if you use localhost while the proxy is configured for 127.0.0.1.
The editor shows the Anthropic login screen instead of routing.
- Confirm the settings are in the right file: the editor’s own
settings.jsonfor VS Code,~/.claude/settings.jsonfor JetBrains. API-key-backed proxy modes need bothANTHROPIC_BASE_URLand the sentinelANTHROPIC_AUTH_TOKEN; forwarded credential mode should only setANTHROPIC_BASE_URLand must not use thenotdiamond-proxyplaceholder. - Update the Claude Code extension to the latest version.
- Launch the editor from a terminal (
code .) rather than the Dock/Finder - GUI launches don’t always inherit the right environment.
Every session fails to connect. The proxy isn’t running and the hook couldn’t start it, usually because the login expired. Run notdiamond login, then notdiamond start.