Skip to content

Commit b7db333

Browse files
feat: claude-code-settings.json: update with latest correct definitions (SchemaStore#4828)
* feat: claude-code-settings.json: update with latest correct definitions - Add extra options: enableAllProjectMcpServers, enabledMcpjsonServers, disabledMcpjsonServers, hooks, learnMode, forceLoginMethod - Remove autoUpdaterStatus, this is no longer supported - Deprecate the single `model` parameter - Add extra permission options: defaultMode, disableBypassPermissionsMode, additionalDirectories * Update tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e985509 commit b7db333

13 files changed

+392
-35
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"extraField": "should not be allowed",
6+
"hooks": [
7+
{
8+
"command": "echo 'test'",
9+
"type": "command",
10+
"unknownProperty": "not allowed"
11+
}
12+
],
13+
"matcher": "Write"
14+
}
15+
]
16+
}
17+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"forceLoginMethod": "github",
3+
"permissions": {
4+
"defaultMode": "invalid-mode"
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"env": {
3+
"HAS SPACES": "should fail",
4+
"has-dashes": "should fail",
5+
"lowercase": "should fail",
6+
"valid_VAR": "ok",
7+
"123STARTS_WITH_NUMBER": "should fail"
8+
}
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"hooks": [
6+
{
7+
"command": "echo 'Invalid type - should be command'",
8+
"type": "script"
9+
}
10+
],
11+
"matcher": "Write"
12+
}
13+
]
14+
}
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"InvalidTool",
5+
"Bash without parentheses",
6+
"Read[wrong-brackets]",
7+
"WebFetch(invalid:syntax"
8+
]
9+
}
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"hooks": [
6+
{
7+
"command": "echo 'test'",
8+
"timeout": 0,
9+
"type": "command"
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command"
8+
}
9+
]
10+
}
11+
]
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"cleanupPeriodDays": "thirty",
3+
"enableAllProjectMcpServers": 1,
4+
"includeCoAuthoredBy": "yes",
5+
"learnMode": "true",
6+
"permissions": {
7+
"additionalDirectories": "should be array",
8+
"allow": "should be array"
9+
}
10+
}

src/schemas/json/claude-code-settings.json

Lines changed: 131 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,48 @@
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://json.schemastore.org/claude-code-settings.json",
44
"$defs": {
5-
"rule": {
5+
"hookCommand": {
6+
"type": "object",
7+
"description": "Hook command configuration",
8+
"additionalProperties": false,
9+
"required": ["type", "command"],
10+
"properties": {
11+
"type": {
12+
"type": "string",
13+
"description": "Type of hook implementation",
14+
"const": "command"
15+
},
16+
"command": {
17+
"type": "string",
18+
"description": "Shell command to execute"
19+
},
20+
"timeout": {
21+
"type": "number",
22+
"description": "Optional timeout in seconds for this specific command",
23+
"exclusiveMinimum": 0
24+
}
25+
}
26+
},
27+
"hookMatcher": {
28+
"type": "object",
29+
"description": "Hook matcher configuration with multiple hooks",
30+
"additionalProperties": false,
31+
"required": ["hooks"],
32+
"properties": {
33+
"matcher": {
34+
"type": "string",
35+
"description": "String (e.g. Write) to match values related to the hook event, e.g. tool names"
36+
},
37+
"hooks": {
38+
"type": "array",
39+
"description": "Array of hooks to execute",
40+
"items": {
41+
"$ref": "#/$defs/hookCommand"
42+
}
43+
}
44+
}
45+
},
46+
"permissionRule": {
647
"type": "string",
748
"description": "Tool permission rule (e.g., 'Bash(ls:*)', 'Read(~/.zshrc)', 'WebFetch(domain:github.com)')",
849
"pattern": "^(Agent|Bash|Edit|Glob|Grep|LS|MultiEdit|NotebookEdit|NotebookRead|Read|TodoRead|TodoWrite|WebFetch|WebSearch|Write)\\(?|^mcp__"
@@ -21,14 +62,8 @@
2162
"type": "string",
2263
"description": "Custom script path to generate an auth value"
2364
},
24-
"autoUpdaterStatus": {
25-
"type": "string",
26-
"description": "Enable or disable the auto-updater",
27-
"enum": ["enabled", "disabled"],
28-
"default": "enabled"
29-
},
3065
"cleanupPeriodDays": {
31-
"type": "number",
66+
"type": "integer",
3267
"description": "How long to locally retain chat transcripts (in days)",
3368
"default": 30,
3469
"minimum": 0
@@ -52,8 +87,7 @@
5287
},
5388
"model": {
5489
"type": "string",
55-
"description": "Claude model to use",
56-
"enum": ["opus", "sonnet"]
90+
"description": "Deprecated: use env.ANTHROPIC_MODEL and env.ANTHROPIC_SMALL_FAST_MODEL instead. Either \"sonnet\", \"opus\", or a specific Claude model ID (see https://docs.anthropic.com/en/docs/about-claude/models/overview)"
5791
},
5892
"permissions": {
5993
"type": "object",
@@ -62,42 +96,104 @@
6296
"properties": {
6397
"allow": {
6498
"type": "array",
65-
"description": "List of allowed tool rules",
66-
"items": { "$ref": "#/$defs/rule" },
99+
"description": "List of allowed tool permission rules",
100+
"items": { "$ref": "#/$defs/permissionRule" },
67101
"uniqueItems": true
68102
},
69103
"deny": {
70104
"type": "array",
71-
"description": "List of denied tool rules",
72-
"items": { "$ref": "#/$defs/rule" },
105+
"description": "List of denied tool permission rules",
106+
"items": { "$ref": "#/$defs/permissionRule" },
107+
"uniqueItems": true
108+
},
109+
"defaultMode": {
110+
"type": "string",
111+
"description": "Default permission mode for tool execution",
112+
"enum": ["acceptEdits", "bypassPermissions", "default", "plan"]
113+
},
114+
"disableBypassPermissionsMode": {
115+
"type": "string",
116+
"description": "Disable bypass permissions mode",
117+
"const": "disable"
118+
},
119+
"additionalDirectories": {
120+
"type": "array",
121+
"description": "Paths to additional directories Claude can access beyond the working directory",
122+
"items": {
123+
"type": "string"
124+
},
73125
"uniqueItems": true
74126
}
75-
},
76-
"default": {
77-
"allow": [],
78-
"deny": []
79127
}
80128
},
81-
"preferredNotifChannel": {
82-
"type": "string",
83-
"description": "Preferred notification channel",
84-
"enum": [
85-
"iterm2",
86-
"iterm2_with_bell",
87-
"terminal_bell",
88-
"notifications_disabled"
89-
],
90-
"default": "iterm2"
129+
"enableAllProjectMcpServers": {
130+
"type": "boolean",
131+
"description": "Whether to automatically approve all MCP servers in the project"
91132
},
92-
"theme": {
93-
"type": "string",
94-
"description": "UI theme configuration",
95-
"enum": ["dark", "light", "light-daltonized", "dark-daltonized"]
133+
"enabledMcpjsonServers": {
134+
"type": "array",
135+
"description": "List of allowed MCP servers from .mcp.json",
136+
"items": {
137+
"type": "string"
138+
}
139+
},
140+
"disabledMcpjsonServers": {
141+
"type": "array",
142+
"description": "List of denied MCP servers from .mcp.json",
143+
"items": {
144+
"type": "string"
145+
}
146+
},
147+
"hooks": {
148+
"type": "object",
149+
"description": "Hooks configuration for executing commands at specific points in Claude Code's lifecycle",
150+
"additionalProperties": false,
151+
"properties": {
152+
"PreToolUse": {
153+
"type": "array",
154+
"description": "Hooks that run before tool calls",
155+
"items": {
156+
"$ref": "#/$defs/hookMatcher"
157+
}
158+
},
159+
"PostToolUse": {
160+
"type": "array",
161+
"description": "Hooks that run after tool completion",
162+
"items": {
163+
"$ref": "#/$defs/hookMatcher"
164+
}
165+
},
166+
"Notification": {
167+
"type": "array",
168+
"description": "Hooks that trigger on notifications",
169+
"items": {
170+
"$ref": "#/$defs/hookMatcher"
171+
}
172+
},
173+
"Stop": {
174+
"type": "array",
175+
"description": "Hooks that run when agents finish responding",
176+
"items": {
177+
"$ref": "#/$defs/hookMatcher"
178+
}
179+
},
180+
"SubagentStop": {
181+
"type": "array",
182+
"description": "Hooks that run when subagents finish responding",
183+
"items": {
184+
"$ref": "#/$defs/hookMatcher"
185+
}
186+
}
187+
}
96188
},
97-
"verbose": {
189+
"learnMode": {
98190
"type": "boolean",
99-
"description": "Show full bash and command outputs",
100-
"default": false
191+
"description": "Request the model focuses more on educating and co-creating with the user, rather than just completing tasks"
192+
},
193+
"forceLoginMethod": {
194+
"type": "string",
195+
"description": "Force a specific login method, and skip the login method selection screen",
196+
"enum": ["claudeai", "console"]
101197
}
102198
}
103199
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"hooks": {
3+
"Notification": [
4+
{
5+
"hooks": [
6+
{
7+
"command": "osascript -e 'display notification \"Claude task complete\" with title \"Claude Code\"'",
8+
"type": "command"
9+
}
10+
]
11+
}
12+
],
13+
"PostToolUse": [
14+
{
15+
"hooks": [
16+
{
17+
"command": "git diff",
18+
"type": "command"
19+
}
20+
],
21+
"matcher": "Edit"
22+
}
23+
],
24+
"PreToolUse": [
25+
{
26+
"hooks": [
27+
{
28+
"command": "echo 'About to write file' >> /tmp/claude-log.txt",
29+
"type": "command"
30+
}
31+
],
32+
"matcher": "Write"
33+
},
34+
{
35+
"hooks": [
36+
{
37+
"command": "echo 'Running bash command' >> /tmp/claude-log.txt",
38+
"timeout": 5,
39+
"type": "command"
40+
}
41+
],
42+
"matcher": "Bash"
43+
}
44+
],
45+
"Stop": [
46+
{
47+
"hooks": [
48+
{
49+
"command": "echo 'Claude finished' | tee -a /tmp/claude-session.log",
50+
"type": "command"
51+
}
52+
]
53+
}
54+
],
55+
"SubagentStop": [
56+
{
57+
"hooks": [
58+
{
59+
"command": "echo 'Subagent completed' >> /tmp/claude-subagent.log",
60+
"timeout": 2,
61+
"type": "command"
62+
}
63+
],
64+
"matcher": "Agent"
65+
}
66+
]
67+
}
68+
}

0 commit comments

Comments
 (0)