anthropics / anthropics/claude-code
Publish an Anthropic-hosted JSON Schema for settings.json, synced with the CLI
- Lenguaje dominante
- Python
- Estrellas
- 145k
- Forks
- 23.1k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
### Summary
The settings documentation points to `https://json.schemastore.org/claude-code-settings.json` as "the published JSON schema" for `settings.json`, but that schema is hosted and maintained by the community SchemaStore project rather than by Anthropic. There is no Anthropic-hosted schema, and none ships in the `@anthropic-ai/claude-code` npm package. The result is that the schema drifts behind the CLI, and the docs acknowledge the drift rather than resolving it.
This request is for an Anthropic-published schema kept in sync with the binary — ideally generated from the same source of truth the CLI already validates against.
### Why this matters
`settings.json` fails silently. The schema sets `additionalProperties: true`, and the CLI does not warn on an unrecognised key, so a typo is indistinguishable from a valid setting at runtime. The only feedback available today is editor validation against a schema that is known to lag, which produces both false negatives (typo accepted) and false positives (valid new key flagged).
Two concrete cases from validating a real config against the published schema, both of them silent until deliberately checked:
1. A permission rule containing parentheses in its argument. The rule grammar is `\([^)]+\)`, so a rule such as `Bash(python3 -c "...json.load(open(...))...")` truncates at the first inner `)` and matches nothing at all. A permission rule that silently matches nothing reads as protection that is not there.
2. A `deniedMcpServers[].serverName` of `claude.ai Asana`, which is illegal under the schema's `^[a-zA-Z0-9_-]+$`. It worked anyway, because the implementation is laxer than the schema — meaning the breakage would surface at some future upgrade, long after the edit that caused it.
Neither was reported by the CLI at any point.
### Current state
- The npm package ships no schema. `@anthropic-ai/claude-code@2.1.270` contains 7 files: `cli-wrapper.cjs`, `install.cjs`, `bin/claude.exe`, `package.json`, `LICENSE.md`, `README.md`, `sdk-tools.d.ts`.
- The SchemaStore entry originated as a community pull request ([SchemaStore/schemastore#4798](https://github.com/SchemaStore/schemastore/pull/4798), merged 2025-06-17) and has been maintained by ~21 contributors since. Anthropic employees are among them, but the schema is not Anthropic-owned or Anthropic-hosted.
- The settings docs state plainly: "The schema can lag behind the newest CLI releases, so a validation warning on a recently documented key doesn't mean your configuration is invalid."
The binary appears to carry its own settings schema already. Keys are declared with zod and carry human-readable descriptions, for example:
```
precomputeCompactionEnabled: z.boolean().optional().describe(
"Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on.")
```
If that is the validation source of truth, exporting it as JSON Schema at release time would close the gap mechanically rather than relying on contributors to notice and backfill each key.
### Evidence of drift
Checked against 2.1.236 with the published schema at 142 properties. Each of these is declared in the binary's own zod settings schema and absent from the published schema:
| Key | Type | Description (from the binary) |
|---|---|---|
| `promptSuggestionEnabled` | boolean | "When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled." |
| `skipWorkflowUsageWarning` | boolean | "@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow." |
| `precomputeCompactionEnabled` | boolean | "Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on." |
| `modelProposedGoals` | enum: `auto`, `alwaysAsk`, `disabled` | "@internal Controls the ProposeGoal tool (model-proposed session goals)." |
I intend to contribute these to SchemaStore regardless. The point is that this backfill should not depend on someone disassembling the binary to find them.
### Related issues
- #11795 — "Link to JSON Schema for settings.json in the official docs". Closed `not_planned` by the stale bot with no maintainer reply, and since locked. The documentation half of that request has since shipped; the hosting and sync half has not.
- #82723 — `teammateDefaultModel` silently ignored while the schema declares it valid. Open. Drift in the opposite direction.
- #88564 — Settings schema validation failures should be fault-tolerant. Open.
### Request
1. Publish an Anthropic-hosted JSON Schema for `settings.json`, generated from the CLI's existing validation source, at a stable URL.
2. Alternatively, or in addition, ship the schema inside the npm package so it versions with the binary.
3. If the SchemaStore copy remains the recommended one, consider automating its update on release so the documented lag stops being expected behaviour.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start by inspecting the files listed in the @anthropic-ai/claude-code package and locating the CLI's existing zod settings validation source. Compare that source with the documented settings schema and determine how release packaging or hosting is handled. Done means a versioned JSON Schema is published or shipped with the CLI and remains synchronized with its validation source.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- json
- Área
- cli, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100