Skip to content

feat(claude-code-settings): add four undocumented settings keys - #6352

Open
johnjspiteri wants to merge 2 commits into
SchemaStore:masterfrom
johnjspiteri:add-claude-code-undocumented-settings
Open

johnjspiteri wants to merge 2 commits into
SchemaStore:masterfrom
johnjspiteri:add-claude-code-undocumented-settings

Conversation

@johnjspiteri

Copy link
Copy Markdown

Adds four settings keys that the Claude Code CLI reads but this schema does not declare.

Verified against Claude Code 2.1.236. Each key is declared in the binary's own embedded zod settings schema with a .describe() string, and the descriptions below are taken from there rather than inferred from usage:

Key Type Source
promptSuggestionEnabled boolean promptSuggestionEnabled: z.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.")
skipWorkflowUsageWarning boolean skipWorkflowUsageWarning: z.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow.")
precomputeCompactionEnabled boolean precomputeCompactionEnabled: z.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on.")
modelProposedGoals enum modelProposedGoals: z.enum(["auto", "alwaysAsk", "disabled"]).optional().catch(undefined).describe("@internal Controls the ProposeGoal tool ...")

None of the four appears on https://code.claude.com/docs/en/settings, so each description carries the UNDOCUMENTED. prefix per the Undocumented Features section of CONTRIBUTING.md.

A note on the two @internal keys: they are marked internal in the binary, but both are user-facing in practice. precomputeCompactionEnabled is exposed in /config under Experimental, and skipWorkflowUsageWarning is persisted to settings.json when a user accepts the workflow warning dialog — so both show up in real config files and currently validate as unknown keys.

I deliberately excluded a fifth candidate, copyOnSelect. It is read as copyOnSelect ?? true and appears in the /config UI, but I could not find a zod declaration for it in the settings schema, so I could not confirm it is a settings key rather than state held elsewhere. Happy to add it in a follow-up if a maintainer can confirm.

Validation:

  • node ./cli.js check --schema-name=claude-code-settings.json passes (pre-checks and Ajv).
  • npx prettier --check passes.

Context: the Claude Code settings documentation points to this schema as "the published JSON schema" while noting that it "can lag behind the newest CLI releases". I have opened anthropics/claude-code#94232 upstream asking Anthropic to publish a schema generated from the CLI's own validation source, which would make this kind of manual backfill unnecessary.

Add promptSuggestionEnabled, skipWorkflowUsageWarning,
precomputeCompactionEnabled and modelProposedGoals.

All four are read by the Claude Code CLI but absent from this schema. None
appear in the published settings documentation, so each carries the
UNDOCUMENTED. description prefix per CONTRIBUTING.md.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR!

This section of the codebase is owned by @domdomegg, @bogini, @sarahdeaton, and @ant-kurt - if they write a comment saying "LGTM" then it will be merged.

`node ./cli.js coverage` requires every property to appear in a positive test,
every enum value to be exercised, a non-default value tested alongside the
default, and a negative test for invalid enum input.

Covers all three modelProposedGoals values across basic-config (auto),
enum-coverage (alwaysAsk) and complete-config (disabled), with "sometimes" added
to the negative enum test. Booleans are tested at both values.
@johnjspiteri

Copy link
Copy Markdown
Author

Pushed a follow-up commit adding test coverage for the four keys.

I had initially only run node ./cli.js check as described under How to edit an existing JSON Schema, which passed, and missed that CI also runs node ./cli.js coverage. That flagged three real gaps in my change: test completeness, enum coverage and default value coverage.

Now covered:

  • All three modelProposedGoals values across basic-config.json (auto), enum-coverage.json (alwaysAsk) and complete-config.json (disabled).
  • "sometimes" added to invalid-enum-values.json as a negative test.
  • Each boolean tested at both values, so the non-default case is exercised rather than only the default.

node ./cli.js coverage --schema-name=claude-code-settings.json now reports 8 passed, 0 failed.

One note in case it is useful for other contributors: the two pre-existing prettier warnings under src/test/prettierrc/ are untouched by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant