{
  "schema_version": 1,
  "type": "skill",
  "slug": "claude-code-1m-context",
  "title": "Claude Code 1M Context",
  "brief": "How to disable (or re-enable) the Claude Code 1M-context Opus 4.6 beta via the `CLAUDE_CODE_DISABLE_1M_CONTEXT` environment variable, wired up through the VS Code extension's...",
  "version": "1.0.0",
  "tags": [],
  "license": "MIT",
  "source_path": "SKILL.md",
  "readme": "# Claude Code 1M Context (Opt-Out)\n\n> ⚠️ **This skill may become obsolete.** The Opus 4.6 \"1M context\" mode\n> is currently an Anthropic **beta**. Once it graduates to GA (or\n> Anthropic changes the default back to 200K), everything documented\n> here stops mattering. If you're reading this and the\n> `CLAUDE_CODE_DISABLE_1M_CONTEXT` env var no longer does anything\n> — or the \"Opus 4.6 (with 1M context)\" label no longer shows up\n> in your Claude Code banner — this skill can probably be deleted\n> from gallia. Check the [Claude Code docs on extended context][docs]\n> first.\n>\n> [docs]: https://code.claude.com/docs/en/model-config#extended-context-with-1m\n\n## The problem\n\nClaude Code 2.1.x running inside the VS Code extension defaults to\n**Opus 4.6 with the 1M-context beta** when your account is entitled\nto it. The 1M window is great for massive codebase reads, but:\n\n1. **Every turn costs more.** The 1M-context variant is a separate\n   SKU with premium pricing — you burn through your token budget\n   noticeably faster than the standard 200K Opus 4.6.\n2. **Most sessions don't need it.** A typical Claude Code session\n   (single-file edits, small refactors, debugging one bug) fits\n   comfortably in 200K. Using 1M for those sessions is pure waste.\n3. **There's no obvious toggle in the UI.** The VS Code extension's\n   `Claude Code: Select Model` command lets you pick `opus` or\n   `sonnet`, but the 1M variant is layered on top of \"opus\" via a\n   separate beta opt-in that isn't exposed in the model picker.\n\nResult: users notice their tokens draining faster than they\nexpected and have no obvious way to stop it.\n\n## The fix\n\nSet `CLAUDE_CODE_DISABLE_1M_CONTEXT=1` in the environment Claude\nCode starts with. The Claude Code binary checks this env var at\nsession start and, if set, pins the session to the standard 200K\nOpus context.\n\n**Canonical place to set it:** the VS Code extension's\n`claudeCode.environmentVariables` setting in\n`~/.local/share/code-server/User/settings.json` (code-server) or\n`~/.config/Code/User/settings.json` (VS Code desktop). The\nextension reads that setting on every Claude Code process launch\nand injects the values into the child process env.\n\n## Step-by-step\n\n### 1. Edit the VS Code user settings\n\n```bash\n# code-server (the usual Adom container setup)\n$EDITOR ~/.local/share/code-server/User/settings.json\n\n# VS Code desktop\n$EDITOR ~/.config/Code/User/settings.json\n```\n\nAdd (or merge into) the `claudeCode.environmentVariables` object:\n\n```jsonc\n{\n  // ... your other settings ...\n  \"claudeCode.preferredLocation\": \"panel\",\n  \"claudeCode.selectedModel\": \"opus\",\n\n  // NEW: pin to 200K standard context so sessions don't use the\n  // expensive 1M beta variant.\n  \"claudeCode.environmentVariables\": {\n    \"CLAUDE_CODE_DISABLE_1M_CONTEXT\": \"1\"\n  }\n}\n```\n\nIf there are already other env vars under\n`claudeCode.environmentVariables`, add `CLAUDE_CODE_DISABLE_1M_CONTEXT`\nas another key inside the existing object — don't wipe the others.\n\n### 2. Restart the Claude Code panel\n\nThe env var is only read at Claude Code process launch, so the\ncurrently-running session keeps using whatever it was using. Close\nthe Claude Code panel and reopen it (or Ctrl+Shift+P → `Claude\nCode: Start New Conversation`) for the change to take effect.\n\nYou do **not** need to reload the entire VS Code window — the\nClaude Code process is per-panel, so closing and reopening the\npanel is enough.\n\n### 3. Verify\n\nThe first banner / system message in the fresh session should\nsay `Opus 4.6` **without** the \"with 1M context\" suffix. You can\nalso confirm by asking Claude \"what model are you running\" — it\nshould report `claude-opus-4-6` (no `[1m]` tag).\n\nYou can also grep the running process env:\n\n```bash\nPID=$(pgrep -f 'resources/native-binary/claude' | head -1)\ncat /proc/$PID/environ | tr '\\0' '\\n' | grep DISABLE_1M\n# → CLAUDE_CODE_DISABLE_1M_CONTEXT=1\n```\n\n## To re-enable 1M context\n\nJust remove (or comment out) the `CLAUDE_CODE_DISABLE_1M_CONTEXT`\nentry from `claudeCode.environmentVariables` and restart the\nClaude Code panel. The extension will re-enable the beta on the\nnext session launch (provided your account is still entitled).\n\nIf you want it only sometimes — e.g. for one long session reading\na huge codebase — temporarily override it by launching the\n`claude` binary from a terminal with `CLAUDE_CODE_DISABLE_1M_CONTEXT=`\n(empty string) in front, or remove the setting, open one panel,\nthen put the setting back and restart. The env var is evaluated\nper-process, so panels started under different env can coexist.\n\n## Other Claude Code settings worth knowing about\n\nThese also live under the `claudeCode.*` namespace in the VS Code\nuser settings and are relevant when you're tuning cost/behavior:\n\n| Setting | Effect |\n|---|---|\n| `claudeCode.selectedModel` | `\"opus\"` / `\"sonnet\"` / `\"haiku\"`. Switching to Sonnet is a bigger cost cut than disabling 1M context but trades some reasoning capability. |\n| `claudeCode.environmentVariables` | Arbitrary env vars injected into every Claude Code process. Also useful for `ANTHROPIC_LOG_LEVEL`, proxy settings, etc. |\n| `claudeCode.allowDangerouslySkipPermissions` | Bypass permission prompts on tool calls. Separate from token cost but worth knowing about. |\n| `claudeCode.initialPermissionMode` | `\"bypassPermissions\"` vs `\"default\"`. Affects prompt flow, not cost. |\n\n## Troubleshooting\n\n### \"I restarted the panel but it's still on 1M context\"\n\nDouble-check:\n- Settings file path is correct (code-server vs VS Code desktop\n  use different paths — see Step 1).\n- JSON is syntactically valid after your edit (`jq . < settings.json`\n  should parse cleanly — `code-server` and `code` both tolerate\n  line comments but not trailing commas inside `environmentVariables`).\n- You restarted the **Claude Code panel**, not just opened a new\n  chat in the existing panel. New chats in the same panel reuse\n  the existing process env.\n\n### \"The setting vanishes when I restart\"\n\nVS Code / code-server reads the user settings file fresh on each\nlaunch. If your edit is missing after a restart, either:\n- Another extension is rewriting the file (unlikely, but check\n  git history on the settings file), or\n- You edited workspace settings (`.vscode/settings.json` in a\n  project folder) instead of user settings — workspace settings\n  only apply when that workspace is open. Put the env var in\n  **user settings** for a global pin.\n\n### \"CLAUDE_CODE_DISABLE_1M_CONTEXT doesn't do anything\"\n\nLikely one of:\n- You're on an older Claude Code version that didn't yet ship\n  the kill switch. Update the extension (`code-server\n  --install-extension anthropic.claude-code` or via the\n  Extensions pane) and try again.\n- Anthropic changed the env var name or retired the beta. Check\n  the [extended context docs][docs] and update this skill.\n\n## Why it's in gallia\n\nThis lives in gallia (not just in an individual user's local\nsettings) because every Adom user running Claude Code inside\ntheir container hits the same problem: 1M context on by default,\nno obvious toggle, tokens burning faster than expected. Putting\nthe fix in a gallia skill means any Claude Code session can\ndiscover and apply it via the standard `/adom` skill umbrella.\n\nWhen the Anthropic beta graduates and the default changes back\n(or when Claude Code ships a proper in-UI context-window toggle),\nthis skill becomes obsolete and can be removed.",
  "author": {
    "name": "Kyle Bergstedt",
    "email": "kyle@adom.inc"
  },
  "visibility": {
    "public": true
  },
  "hero": null,
  "sample_prompts": [],
  "discovery_triggers": [],
  "discovery_pitch": null,
  "metadata": {},
  "created_at": "2026-05-28T05:29:56.754Z",
  "updated_at": "2026-05-28T05:29:56.754Z",
  "sub_skills": [],
  "parent_app": null,
  "org": "adom"
}