Skip to content

Instantly share code, notes, and snippets.

@siddhantmedar
Created May 24, 2026 04:30
Show Gist options
  • Select an option

  • Save siddhantmedar/e8bfb56d59c857a3473b217d1d59bb19 to your computer and use it in GitHub Desktop.

Select an option

Save siddhantmedar/e8bfb56d59c857a3473b217d1d59bb19 to your computer and use it in GitHub Desktop.
Pin Claude Code to Opus 4.6 (1M) for CLI + VS Code extension

Pin Claude Code to Opus 4.6 (1M context) — CLI + VS Code

Set a default model for both the Claude Code CLI and the VS Code extension. They share the same global config, so one change covers both.

TL;DR

Add a model key to your global user settings at ~/.claude/settings.json:

{
  "model": "claude-opus-4-6[1m]"
}

The [1m] suffix selects the 1-million-token context variant of Opus 4.6.

Steps

  1. Open (or create) ~/.claude/settings.json.

  2. Add the model key, merging with whatever is already there — don't overwrite the file. Example of a file that already had other settings:

    {
      "model": "claude-opus-4-6[1m]",
      "skipDangerousModePermissionPrompt": true,
      "enabledPlugins": {
        "warp@claude-code-warp": true
      }
    }
  3. Start a new session (restart the CLI, or reload the VS Code window). Already-open sessions won't switch mid-session.

  4. Verify with /model in a fresh session — it should show Opus 4.6 (1M) as active.

Why this covers both surfaces

The CLI and the VS Code extension run the same Claude Code core and both read ~/.claude/settings.json. Setting the model there makes it the default everywhere.

Caveats / precedence

Settings load in order user → project → local → flag, where later wins. So this global default is overridden by:

  • A project's .claude/settings.json or .claude/settings.local.json with its own model.
  • A --model flag on the CLI.
  • A manual pick via /model (CLI) or the VS Code model picker — that choice can take precedence for that session.

If /model doesn't show the expected model, check those higher-precedence sources.

Other ways to set it

  • /config inside Claude Code — interactive settings UI.
  • claude --model "claude-opus-4-6[1m]" — one-off per invocation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment