fix(cc-config): .claude.json sits BESIDE ~/.claude by default, not inside it

The previous commit routed the read through getClaudeHome(), which appends
/.claude when CLAUDE_HOME is unset — pointing the dashboard at
~/.claude/.claude.json, a file the CLI never writes by default. Verified
against the real binary: with CLAUDE_CONFIG_DIR unset the CLI writes
$HOME/.claude.json; with it set, .claude.json sits flat inside that dir.
Branch on CLAUDE_HOME accordingly.

The test now drives a fake claude that writes where the real one does and
asserts getClaudeJsonPath() names that exact file, under both branches —
the previous test only restated the implementation.
This commit is contained in:
2026-09-09 10:00:05 +07:00
parent 17e4321761
commit c34931c3f5
5 changed files with 68 additions and 26 deletions
+6
View File
@@ -327,6 +327,12 @@ const schemas = {
"Where the definition was found, e.g. `~/.claude.json (top-level)`, `~/.claude.json (projects[<root>])`, or `~/.claude/settings.json`.",
example: "~/.claude.json (top-level)",
},
removable: {
type: "boolean",
description:
"False when no `claude mcp` scope can address this entry (currently only ~/.claude/settings.json-sourced servers), so POST /mcp/remove has no scope that would find it. Absent/true means removable.",
example: true,
},
kind: {
type: "string",
enum: ["http", "stdio", "unknown"],