# Claude Code extension (VS Code / Cursor)

1. First set up Claude Code as described in [Claude Code](https://docs.2api.dev/en/clients/claude-code/). Check that running `claude` in a terminal gives you a normal conversation.

2. Search for **Claude Code** in the VS Code or Cursor extension marketplace and install the official extension whose publisher is Anthropic (ID `anthropic.claude-code`).

3. Fully quit the editor and open it again. Press `Ctrl+Shift+P` (`Cmd+Shift+P` on macOS), search for Claude Code and open the panel.

## The extension keeps asking you to sign in

The extension's own login check doesn't read `~/.claude/settings.json`. An editor opened from the Dock or the Start menu also can't see variables you `export` in a terminal. Add these two settings to the editor's user settings, then fully quit the editor and open it again.

To open the user settings, press `Ctrl+Shift+P` (`Cmd+Shift+P` on macOS), type `Preferences: Open User Settings (JSON)` and press Enter:

```json title="VS Code / Cursor user settings.json"
{
  "claudeCode.environmentVariables": [
    { "name": "ANTHROPIC_BASE_URL", "value": "https://2api.dev" },
    { "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-your-key" }
  ],
  "claudeCode.disableLoginPrompt": true
}
```

If the file already has settings in it, don't paste the outer `{ }`. Paste only the lines in between, after the last existing item, and add a comma to the end of that item.

**If nothing else works**
Run `claude` in the editor's built-in terminal. It works the same as the extension, and you can also see the changes in your project.
