---
title: "Claude Code v2.1.126: Gateway Model Discovery, Project Purge, and Smarter Auth"
date: 2026-05-07
tags: ["Claude Code","Anthropic","Changelog","MCP","Enterprise","Developer Tools"]
categories: ["AI Tools","Guides"]
summary: "Version 2.1.126 ships four practical upgrades: a /model picker that reads your gateway's model list, a project purge command for clean state management, OAuth paste mode for headless environments, and an Auto mode that tells you when it's stuck."
---


Incremental releases don't get headlines. But v2.1.126 — shipping May 1, 2026 — bundles four quality-of-life changes that will matter to anyone running Claude Code in a non-trivial environment: a gateway-aware `/model` picker, a clean-slate `project purge` command, OAuth paste mode for SSH/WSL users, and a more honest Auto mode spinner. None of these are flashy. All of them fix real friction.

## /model Now Reads Your Gateway

The biggest feature is also the most enterprise-relevant. When `ANTHROPIC_BASE_URL` points at an Anthropic-compatible gateway — LiteLLM, a corporate proxy, a private deployment — the `/model` picker now queries `{base_url}/v1/models` at startup and populates the list with whatever models your gateway exposes, labeled **"From gateway"**.

Before this, running Claude Code behind a custom gateway meant manually specifying model names and hoping the string matched what the proxy expected. Now the picker is self-describing: Claude Code asks the gateway what it has, and shows you exactly that.

One important follow-up: in versions v2.1.126 through v2.1.128 this discovery was automatic. In subsequent releases it became opt-in via `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1`. If you upgraded past 2.1.128 and your gateway models disappeared from the picker, that's why — add the env var.

This matters because the gateway model is increasingly how serious enterprise teams run Claude Code. IT controls the proxy, audit logs flow through a single choke point, and engineers get whatever models have been approved. Until now the UX was manual and error-prone; now it's as smooth as the direct API path.

## `claude project purge`: Delete Project State Without Deleting Code

Claude Code accumulates state per project: transcripts, task lists, file edit history, config entries. Useful in aggregate, but occasionally you want a clean slate — after a major refactor, before handing a project to a colleague, or when a stale task list is confusing the agent.

v2.1.126 adds a dedicated command for this:

```bash
claude project purge [path]
```

Options:
- `--dry-run` — shows exactly what would be deleted without touching anything
- `-y` / `--yes` — skips confirmation prompts
- `-i` / `--interactive` — lets you cherry-pick which state to delete
- `--all` — purges state for every project, not just the current one

Before this command existed, cleaning project state meant hunting through `~/.claude/` and deleting the right directories manually — the kind of thing that worked but wasn't documented anywhere. Having a first-class command with a dry-run option is the right answer.

The use case I'd reach for immediately: before onboarding another engineer to a project, run `claude project purge --dry-run` to audit what's accumulated, then purge the transcript history while leaving CLAUDE.md and skill files intact.

## OAuth Paste Mode for Headless Environments

`claude auth login` now has a fallback for when it can't complete the standard OAuth redirect flow: it prints the authorization URL, lets you open it in a browser wherever you have one, and accepts the resulting OAuth code pasted directly into the terminal.

This is a small change with a large surface area. The people it helps:

- **WSL2 users** — the browser lives on Windows, the terminal lives in Linux; the localhost callback doesn't cross the boundary
- **Remote SSH sessions** — port forwarding is a workaround but it's tedious and often blocked
- **Containers** — no browser, full stop
- **CI pipelines doing initial auth setup** — paste mode turns an interactive GUI flow into something scriptable

The previous workaround was typically device flow, but that required a separate code path and wasn't always documented clearly. Paste mode integrates directly into `claude auth login` — same command, graceful fallback.

## Auto Mode: A Spinner That Tells the Truth

A small but meaningful UX fix in Auto mode: when a permission check stalls — the agent wants to run a tool but is waiting for approval — the spinner now turns **red** instead of continuing to look like active work.

This might sound cosmetic. It isn't. In Auto mode, a frozen spinner previously looked identical whether Claude was thinking hard or waiting for a human to respond to a permission prompt. Users would watch it for 30 seconds before realizing the agent was blocked and needed their input. The red color breaks that ambiguity: active work is normal color, waiting for you is red.

It's the kind of detail that takes five minutes to implement and saves minutes per interrupted session, multiplied across every Auto mode user.

## OpenTelemetry: Skill Invocation Tracking

For teams running Claude Code with enterprise observability, v2.1.126 extends the `claude_code.skill_activated` OpenTelemetry event with a new `invocation_trigger` attribute:

| Value | Meaning |
|---|---|
| `"user-slash"` | User typed a `/skill` command |
| `"claude-proactive"` | Claude invoked the skill autonomously |
| `"nested-skill"` | A skill was called from within another skill |

This closes a gap in attribution: you can now distinguish between skills used on explicit instruction versus skills Claude decided to invoke on its own. In an enterprise context where skills are tied to cost centers or approval workflows, that distinction matters.

## The Pattern

v2.1.126 doesn't change what Claude Code can do — it changes how predictable and portable it is. Gateway model discovery makes enterprise deployments first-class. Project purge makes state management explicit. OAuth paste mode removes a real blocker for headless environments. The Auto mode spinner makes the agent's internal state legible.

None of these features exist in IDE-embedded AI tools, because none of those tools need them. Cursor doesn't have a gateway model picker because it doesn't run in containerized CI. Copilot doesn't have OAuth paste mode because it doesn't run on remote servers. The operational surface area of a terminal-native agent is just different — and the Claude Code team keeps shipping to that surface.

---

*Sources: [Claude Code changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) · [Release v2.1.126](https://github.com/anthropics/claude-code/releases/tag/v2.1.126) · [Claude Code docs](https://code.claude.com/docs/en/changelog) · [LiteLLM gateway discovery issue](https://github.com/BerriAI/litellm/issues/27180)*

