Let a project turn a globally-enabled Claude Code setting back off

The six boolean settings were plain `bool`s merged with
`if p.x { true } else { g.x }`, so a project could only ever add to the
global set. There was no project value that produced `false` — turning a
switch off at project level simply fell through to the global value and
the control did nothing.

Widen them to `Option<bool>`. `None` means "not set at this level":
inherit the global on a project, leave Claude Code's own default alone
globally. `Some(false)` is a deliberate off and wins outright.

The fingerprint now formats with `{:?}` rather than `{}` — `None` and
`Some(false)` mean different things, and conflating them would leave the
container un-recreated when a project switched from inherit to off.

The project editor grows a third "Global" state per switch; the global
editor has nothing to inherit from, so it stays a plain toggle and keeps
collapsing to null at the default. Its three existing tests passed
unchanged and caught a first attempt that rendered unset as off, which
would have told every user their session recap was disabled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBq2rGum6GX7xXgsas1fDc
This commit is contained in:
2026-08-23 09:05:39 -07:00
co-authored by Claude Opus 5
parent bb41275cea
commit 0a022dfcf0
6 changed files with 268 additions and 73 deletions
@@ -109,9 +109,10 @@ export default function RuntimeSection({
<ConfigGroup
title="Claude Code settings"
description="Per-project CLI behaviour. These override the global defaults in Settings."
description="Per-project CLI behaviour. Anything left on Global follows Settings; Off overrides a global On."
>
<ClaudeCodeSettingsEditor
scope="project"
settings={project.claude_code_settings}
disabled={disabled}
disabledReason={disabledReason}