From 73c86010b492af703da70c3023cca36df2f0737f Mon Sep 17 00:00:00 2001 From: Mitesh Ashar Date: Sun, 10 May 2026 11:05:28 +0530 Subject: [PATCH] feat(claude-code-settings): sync to Claude Code v2.1.138 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Schema: - Add `worktree.baseRef` enum [fresh, head] to control worktree branch source (v2.1.133) - Add `sandbox.bwrapPath` and `sandbox.socatPath` managed-only paths for custom sandbox binaries (v2.1.133) - Add `parentSettingsBehavior` admin-tier setting to control SDK managedSettings merge behavior (v2.1.133) - Add `autoMode.hard_deny` array for unconditional-block classifier rules (v2.1.136) - Add `skillOverrides` object for per-skill visibility control with enum [on, name-only, user-invocable-only, off] (v2.1.129) - Add 5 missing environment variables: CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN, CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL, CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY, CLAUDE_CODE_FORCE_SYNC_OUTPUT, CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE (v2.1.129–v2.1.136) Tests: - Update modern-complete-config.json: add all new properties with valid examples - Update edge-cases.json: add default enum values for worktree.baseRef (fresh), parentSettingsBehavior (first-wins), and all 5 env vars with "0" value Negative tests: - Update invalid-enum-values.json: add invalid enum values for worktree.baseRef, parentSettingsBehavior, skillOverrides, and 5 env vars All 8 coverage checks passing. Changes verified against documentation and schemas. Co-Authored-By: Claude Sonnet 4.6 --- .../invalid-enum-values.json | 14 ++++- src/schemas/json/claude-code-settings.json | 63 +++++++++++++++++++ src/test/claude-code-settings/edge-cases.json | 16 ++++- .../modern-complete-config.json | 17 ++++- 4 files changed, 106 insertions(+), 4 deletions(-) diff --git a/src/negative_test/claude-code-settings/invalid-enum-values.json b/src/negative_test/claude-code-settings/invalid-enum-values.json index 2b734919edb..3013110cbb8 100644 --- a/src/negative_test/claude-code-settings/invalid-enum-values.json +++ b/src/negative_test/claude-code-settings/invalid-enum-values.json @@ -17,6 +17,7 @@ "CLAUDE_CODE_DEBUG_LOG_LEVEL": "trace", "CLAUDE_CODE_DISABLE_1M_CONTEXT": "yes", "CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING": "true", + "CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN": "yes", "CLAUDE_CODE_DISABLE_ATTACHMENTS": "off", "CLAUDE_CODE_DISABLE_AUTO_MEMORY": "yes", "CLAUDE_CODE_DISABLE_BACKGROUND_TASKS": "true", @@ -39,11 +40,14 @@ "CLAUDE_CODE_EFFORT_LEVEL": "extreme", "CLAUDE_CODE_ENABLE_AWAY_SUMMARY": "yes", "CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH": "on", + "CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL": "enabled", "CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING": "enable", + "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "yes", "CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION": "1", "CLAUDE_CODE_ENABLE_TASKS": "enable", "CLAUDE_CODE_ENABLE_TELEMETRY": "yes", "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "enable", + "CLAUDE_CODE_FORCE_SYNC_OUTPUT": "enabled", "CLAUDE_CODE_FORK_SUBAGENT": "true", "CLAUDE_CODE_GLOB_HIDDEN": "1", "CLAUDE_CODE_GLOB_NO_IGNORE": "yes", @@ -53,6 +57,7 @@ "CLAUDE_CODE_MCP_ALLOWLIST_ENV": "all", "CLAUDE_CODE_NEW_INIT": "start", "CLAUDE_CODE_NO_FLICKER": "maybe", + "CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE": "auto", "CLAUDE_CODE_PERFORCE_MODE": "on", "CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE": "always", "CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST": "true", @@ -80,16 +85,23 @@ "USE_BUILTIN_RIPGREP": "always" }, "forceLoginMethod": "github", + "parentSettingsBehavior": "invalid-mode", "permissions": { "defaultMode": "invalid-mode", "disableAutoMode": "enabled", "disableBypassPermissionsMode": "enabled" }, + "skillOverrides": { + "test-skill": "invalid-mode" + }, "spinnerVerbs": { "mode": "merge", "verbs": ["Analyzing"] }, "teammateMode": "split", "tui": "mini", - "viewMode": "list" + "viewMode": "list", + "worktree": { + "baseRef": "invalid-ref" + } } diff --git a/src/schemas/json/claude-code-settings.json b/src/schemas/json/claude-code-settings.json index 9e7ecf2cf02..47e66277d3d 100644 --- a/src/schemas/json/claude-code-settings.json +++ b/src/schemas/json/claude-code-settings.json @@ -974,6 +974,31 @@ "type": "string", "description": "Use the bundled ripgrep binary instead of system ripgrep", "enum": ["0", "1"] + }, + "CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN": { + "type": "string", + "description": "Disable alternate screen buffer rendering. When set to 1, keeps conversation in native scrollback instead of fullscreen renderer", + "enum": ["0", "1"] + }, + "CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL": { + "type": "string", + "description": "Enable feedback survey collection via OpenTelemetry for enterprises", + "enum": ["0", "1"] + }, + "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": { + "type": "string", + "description": "Enable model discovery from LLM gateway /v1/models endpoint when ANTHROPIC_BASE_URL points at an Anthropic-compatible gateway", + "enum": ["0", "1"] + }, + "CLAUDE_CODE_FORCE_SYNC_OUTPUT": { + "type": "string", + "description": "Force synchronous output flushing. When set to 1, forces synchronized output on terminals that auto-detection misses (e.g., Emacs eat)", + "enum": ["0", "1"] + }, + "CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE": { + "type": "string", + "description": "Enable automatic package manager updates. When set, Claude Code runs the upgrade command in background on Homebrew/WinGet and prompts to restart", + "enum": ["0", "1"] } }, "propertyNames": { @@ -2137,6 +2162,16 @@ "description": "Additional arguments to pass to the ripgrep binary" } } + }, + "bwrapPath": { + "type": "string", + "minLength": 1, + "description": "(Managed setting only) Path to custom bubblewrap (bwrap) binary for Linux/WSL sandbox. Overrides default. See https://code.claude.com/docs/en/server-managed-settings" + }, + "socatPath": { + "type": "string", + "minLength": 1, + "description": "(Managed setting only) Path to custom socat binary for Linux/WSL network proxying. Overrides default. See https://code.claude.com/docs/en/server-managed-settings" } }, "additionalProperties": false @@ -2200,6 +2235,15 @@ "description": "Show turn duration messages after responses (e.g., \"Cooked for 1m 6s\"). Set to false to hide these messages (default: true)", "default": true }, + "skillOverrides": { + "type": "object", + "additionalProperties": { + "type": "string", + "enum": ["on", "name-only", "user-invocable-only", "off"] + }, + "description": "Per-skill visibility overrides. Controls whether skills appear to Claude and in the / picker. Values: 'on' (name and description shown, default), 'name-only' (name only), 'user-invocable-only' (hidden from Claude, visible in /), 'off' (hidden everywhere). Plugin skills are not affected by this setting. See https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings", + "examples": [{ "legacy-context": "name-only", "deploy": "off" }] + }, "prefersReducedMotion": { "type": "boolean", "description": "Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility", @@ -2241,9 +2285,21 @@ }, "description": "Directories to check out in each worktree via git sparse-checkout (cone mode). Only the listed paths are written to disk, which is faster in large monorepos. See https://code.claude.com/docs/en/settings#worktree-settings", "examples": [["packages/my-app", "shared/utils"]] + }, + "baseRef": { + "type": "string", + "enum": ["fresh", "head"], + "default": "fresh", + "description": "Whether to branch worktrees from origin/ (fresh) or local HEAD (head). Default: fresh. Set to 'head' to preserve unpushed commits in new worktrees. See https://code.claude.com/docs/en/settings#worktree-settings" } } }, + "parentSettingsBehavior": { + "type": "string", + "enum": ["first-wins", "merge"], + "default": "first-wins", + "description": "(Admin/managed settings only) Controls how SDK managedSettings (parent tier) merge with inherited settings. 'first-wins': first non-empty value applies (default). 'merge': merge arrays and objects. See https://code.claude.com/docs/en/server-managed-settings" + }, "pluginTrustMessage": { "type": "string", "description": "(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings", @@ -2508,6 +2564,13 @@ "type": "string" }, "description": "Entries for the auto mode classifier environment section. Replaces the built-in environment context entirely unless the literal string \"$defaults\" is included as an entry, which splices the built-in defaults in at that position." + }, + "hard_deny": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Rules for the auto mode classifier hard-deny section. Hard-deny rules block unconditionally regardless of user intent. Replaces the built-in hard-deny rules entirely unless the literal string \"$defaults\" is included as an entry, which splices the built-in defaults in at that position. See https://code.claude.com/docs/en/permissions" } } }, diff --git a/src/test/claude-code-settings/edge-cases.json b/src/test/claude-code-settings/edge-cases.json index dfdba3584c1..e012806bd9a 100644 --- a/src/test/claude-code-settings/edge-cases.json +++ b/src/test/claude-code-settings/edge-cases.json @@ -4,12 +4,18 @@ "effortLevel": "low", "env": { "CLAUDE_CODE_DEBUG_LOG_LEVEL": "info", + "CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN": "0", "CLAUDE_CODE_DISABLE_ATTACHMENTS": "0", "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "0", - "CLAUDE_CODE_EFFORT_LEVEL": "max" + "CLAUDE_CODE_EFFORT_LEVEL": "max", + "CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL": "0", + "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "0", + "CLAUDE_CODE_FORCE_SYNC_OUTPUT": "0", + "CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE": "0" }, "fastMode": false, "forceLoginMethod": "claudeai", + "parentSettingsBehavior": "first-wins", "permissions": { "allow": [], "ask": [], @@ -19,11 +25,17 @@ "prefersReducedMotion": false, "respectGitignore": true, "showTurnDuration": true, + "skillOverrides": { + "custom-skill": "on" + }, "spinnerTipsEnabled": true, "spinnerVerbs": { "mode": "append", "verbs": ["Thinking"] }, "teammateMode": "in-process", - "terminalProgressBarEnabled": true + "terminalProgressBarEnabled": true, + "worktree": { + "baseRef": "fresh" + } } diff --git a/src/test/claude-code-settings/modern-complete-config.json b/src/test/claude-code-settings/modern-complete-config.json index c65532108d2..38c6ebed9c3 100644 --- a/src/test/claude-code-settings/modern-complete-config.json +++ b/src/test/claude-code-settings/modern-complete-config.json @@ -16,6 +16,7 @@ "autoMode": { "allow": ["$defaults", "All read-only operations"], "environment": ["$defaults", "WSL2 on Windows"], + "hard_deny": ["Running executable files", "Writing to system directories"], "soft_deny": ["$defaults", "Deleting files"] }, "autoUpdatesChannel": "latest", @@ -49,9 +50,14 @@ "ANTHROPIC_BEDROCK_SERVICE_TIER": "priority", "ANTHROPIC_MODEL": "claude-3-5-sonnet-20241022", "ANTHROPIC_SMALL_FAST_MODEL": "claude-3-5-haiku-20241022", + "CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN": "1", "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1", + "CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL": "1", + "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1", + "CLAUDE_CODE_FORCE_SYNC_OUTPUT": "1", "CLAUDE_CODE_FORK_SUBAGENT": "1", "CLAUDE_CODE_HIDE_CWD": "1", + "CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE": "1", "CLAUDE_LOG_LEVEL": "debug", "PROJECT_ROOT": "/home/user/projects" }, @@ -241,6 +247,7 @@ }, "otelHeadersHelper": "/usr/local/bin/otel-headers.sh", "outputStyle": "Explanatory", + "parentSettingsBehavior": "merge", "permissions": { "additionalDirectories": ["~/Documents/reference", "~/.config/claude-code"], "allow": [ @@ -289,6 +296,7 @@ "sandbox": { "allowUnsandboxedCommands": false, "autoAllowBashIfSandboxed": false, + "bwrapPath": "/usr/bin/bwrap", "enableWeakerNestedSandbox": false, "enableWeakerNetworkIsolation": true, "enabled": true, @@ -314,11 +322,17 @@ "ripgrep": { "args": ["--hidden"], "command": "/usr/bin/rg" - } + }, + "socatPath": "/usr/bin/socat" }, "showClearContextOnPlanAccept": true, "showThinkingSummaries": true, "showTurnDuration": false, + "skillOverrides": { + "deploy": "off", + "internal-tool": "user-invocable-only", + "legacy-context": "name-only" + }, "skipDangerousModePermissionPrompt": true, "skipWebFetchPreflight": false, "skippedMarketplaces": ["untrusted-marketplace"], @@ -346,6 +360,7 @@ "viewMode": "focus", "voiceEnabled": true, "worktree": { + "baseRef": "head", "sparsePaths": ["packages/my-app", "shared/utils"] }, "wslInheritsWindowsSettings": false