Each provider's preset list ends in "New ... preset...", and the preset
editor gains Duplicate, Rename and Delete. New asks for a name and what to
start from: a copy of one of that provider's presets, or a blank template.
Delete is greyed out, with the reason, on the preset in use, and warns when
it would leave a provider with no preset at all.
CLI:
- preset rename <name> <new>: the new name is hard-linked in, state.json is
repointed, and only then does the old name go.
- preset new <name> --provider <p> [--blank]: with a provider and no source
it copies that provider's own default instead of the OpenRouter-only
`default`; --blank starts from the scaffold.
- valid_preset_name on every preset subcommand: no slash, no leading dot.
`preset show ../../etc/passwd` used to print the file.
- preset rm warns when it removes a provider's last preset.
- preflight refuses a preset with every tier empty. Otherwise a blank preset
would switch cleanly and Claude Code would ask the gateway for its default
Anthropic models, billed at full price on OpenRouter. The panel's blocked
card offers "Edit preset..." for it.
The key helper now reads the active preset in a single open (new cm-json
auth-of) and re-reads state.json once on a miss. Renaming the active preset
could otherwise catch a running session between reading the old name and
opening the file: 1 failure in 51 key fetches in a race test before, 0 in
118 across 60 renames after. It could also briefly hand out the openrouter
key for a preset that uses another.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>