feat(claude-code-settings): add missing top-level keys - #6309
Open
zachmayer wants to merge 1 commit into
Open
Conversation
Five settings that Claude Code reads are absent from the schema. Because the top-level `additionalProperties` is `true` they validate silently, so editors offer no completion for them and strict validation is impossible. - autoContinueAtUsageLimit (boolean, default true) - crossSessionInbound (string enum: accept, hold, refuse) - enableWorkflows (boolean) - promptSuggestionEnabled (boolean, default true) - switchModelsOnFlag (boolean, default true) All five are documented in the Claude Code settings reference and present in the Claude Code 2.1.261 binary. Descriptions follow the existing style in this file: enum values explained inline, plus a docs URL. Positive tests cover the new keys in modern-complete-config.json, all three crossSessionInbound values across enum-coverage.json, managed-settings.json and modern-complete-config.json; negative tests cover a bad enum value and wrong types for each boolean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BWZwpQFkxFBNJPikDWmos1
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five settings that Claude Code reads are missing from
claude-code-settings.json. The schema's top-leveladditionalPropertiesistrue, so today they validate silently: editors offer no completion for them, and strict validation can't be turned on for a settings file that uses them.All five are documented in the Claude Code settings reference and are referenced by the Claude Code 2.1.261 binary.
autoContinueAtUsageLimittruecrossSessionInboundaccept,hold,refuseenableWorkflowspromptSuggestionEnabledtrueswitchModelsOnFlagtrueThe
crossSessionInboundvalues come from https://code.claude.com/docs/en/cross-session-messaging#control-inbound-messages.Descriptions follow the conventions already in this file: enum values explained inline in the
description(as inautoUpdatesChannel) rather than via non-standardenumDescriptions, with a trailing docs URL.defaultis set only where the docs state one;enableWorkflowsandcrossSessionInboundare documented as unset by default, so neither gets adefault.Tests
src/test/claude-code-settings/modern-complete-config.json— all five keyssrc/test/claude-code-settings/enum-coverage.json—crossSessionInbound: "hold"src/test/claude-code-settings/managed-settings.json—crossSessionInbound: "refuse", matching the managed-settings example in the docsTogether with
"accept"inmodern-complete-config.json, all three enum values are exercised.Negative tests:
src/negative_test/claude-code-settings/invalid-enum-values.json—crossSessionInbound: "maybe"src/negative_test/claude-code-settings/wrong-property-types.json— a non-boolean for each of the four booleansChecks run
I also compiled the schema with Ajv directly and asserted each new constraint bites: the three valid
crossSessionInboundvalues validate,"maybe"does not, and each boolean rejects a non-boolean. 12/12 as expected.pre-commitwas not run locally; the only hooks are Prettier (run above vianpm run prettier) and codespell, which I ran over the changed files with no findings.