Skip to content

Commit be0d8f0

Browse files
authored
Merge pull request #5332 from kanghyojun/claude-code-2129
Update Claude Code settings schema for v2.1.29 with hostPattern/async and test coverage
2 parents f17816b + 77533a4 commit be0d8f0

File tree

7 files changed

+159
-1
lines changed

7 files changed

+159
-1
lines changed

src/negative_test/claude-code-settings/invalid-enum-values.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"forceLoginMethod": "github",
33
"permissions": {
44
"defaultMode": "invalid-mode"
5+
},
6+
"spinnerVerbs": {
7+
"mode": "merge",
8+
"verbs": ["Analyzing"]
59
}
610
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extraKnownMarketplaces": {
3+
"internal-git": {
4+
"source": {
5+
"source": "hostPattern"
6+
}
7+
}
8+
},
9+
"strictKnownMarketplaces": [
10+
{
11+
"hostPattern": 123,
12+
"source": "hostPattern"
13+
}
14+
]
15+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
{
22
"cleanupPeriodDays": "thirty",
33
"enableAllProjectMcpServers": 1,
4+
"hooks": {
5+
"PreToolUse": [
6+
{
7+
"hooks": [
8+
{
9+
"async": "true",
10+
"command": "echo test",
11+
"type": "command"
12+
}
13+
]
14+
}
15+
]
16+
},
417
"includeCoAuthoredBy": "yes",
518
"permissions": {
619
"additionalDirectories": "should be array",
720
"allow": "should be array",
821
"ask": "should be array"
22+
},
23+
"sandbox": {
24+
"network": {
25+
"allowAllUnixSockets": "yes",
26+
"allowedDomains": "api.anthropic.com"
27+
}
928
}
1029
}

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

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"permissionRule": {
66
"type": "string",
77
"description": "Tool permission rule. See https://code.claude.com/docs/en/settings#permission-rule-syntax",
8-
"pattern": "^((Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|NotebookEdit|Read|Skill|Task|TodoWrite|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",
8+
"pattern": "^((Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LS|MultiEdit|NotebookEdit|NotebookRead|Read|Skill|SlashCommand|Task|TodoWrite|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",
99
"examples": [
1010
"Bash",
1111
"Bash(npm run build)",
@@ -14,11 +14,13 @@
1414
"Bash(ls*)",
1515
"Bash(git * main)",
1616
"Edit",
17+
"MultiEdit",
1718
"Edit(/src/**/*.ts)",
1819
"Read(./.env)",
1920
"Read(./secrets/**)",
2021
"Read(/Users/alice/secrets/**)",
2122
"Read(~/Documents/*.pdf)",
23+
"SlashCommand(/clear)",
2224
"WebFetch",
2325
"WebFetch(domain:example.com)",
2426
"mcp__github__search_repositories"
@@ -46,6 +48,10 @@
4648
"type": "number",
4749
"description": "Optional timeout in seconds",
4850
"exclusiveMinimum": 0
51+
},
52+
"async": {
53+
"type": "boolean",
54+
"description": "Run this hook asynchronously without blocking Claude Code"
4955
}
5056
}
5157
},
@@ -69,6 +75,10 @@
6975
"type": "number",
7076
"description": "Optional timeout in seconds",
7177
"exclusiveMinimum": 0
78+
},
79+
"async": {
80+
"type": "boolean",
81+
"description": "Run this hook asynchronously without blocking Claude Code"
7282
}
7383
}
7484
}
@@ -517,6 +527,21 @@
517527
"required": ["source", "url"],
518528
"additionalProperties": false
519529
},
530+
{
531+
"type": "object",
532+
"properties": {
533+
"source": {
534+
"type": "string",
535+
"const": "hostPattern"
536+
},
537+
"hostPattern": {
538+
"type": "string",
539+
"description": "Git host pattern to trust for repositories in source specifications"
540+
}
541+
},
542+
"required": ["source", "hostPattern"],
543+
"additionalProperties": false
544+
},
520545
{
521546
"type": "object",
522547
"properties": {
@@ -627,6 +652,21 @@
627652
"description": "(Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Uses exact matching for source specifications. See https://code.claude.com/docs/en/settings#strictknownmarketplaces",
628653
"items": {
629654
"anyOf": [
655+
{
656+
"type": "object",
657+
"properties": {
658+
"source": {
659+
"type": "string",
660+
"const": "hostPattern"
661+
},
662+
"hostPattern": {
663+
"type": "string",
664+
"description": "Git host pattern to trust for repositories in source specifications"
665+
}
666+
},
667+
"required": ["source", "hostPattern"],
668+
"additionalProperties": false
669+
},
630670
{
631671
"type": "object",
632672
"properties": {
@@ -822,6 +862,26 @@
822862
"minimum": 1,
823863
"maximum": 65535,
824864
"description": "SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically"
865+
},
866+
"allowAllUnixSockets": {
867+
"type": "boolean",
868+
"description": "Allow all Unix domain socket connections. If true, this overrides allowUnixSockets"
869+
},
870+
"allowedDomains": {
871+
"type": "array",
872+
"items": {
873+
"type": "string",
874+
"minLength": 1
875+
},
876+
"description": "Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com"
877+
},
878+
"deniedDomains": {
879+
"type": "array",
880+
"items": {
881+
"type": "string",
882+
"minLength": 1
883+
},
884+
"description": "Denylist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com"
825885
}
826886
},
827887
"additionalProperties": false
@@ -863,6 +923,28 @@
863923
},
864924
"additionalProperties": false
865925
},
926+
"spinnerVerbs": {
927+
"type": "object",
928+
"description": "Customize the verbs shown in spinner progress messages",
929+
"properties": {
930+
"mode": {
931+
"type": "string",
932+
"enum": ["append", "replace"],
933+
"description": "How custom verbs should be combined with the default spinner verbs"
934+
},
935+
"verbs": {
936+
"type": "array",
937+
"items": {
938+
"type": "string",
939+
"minLength": 1
940+
},
941+
"minItems": 1,
942+
"description": "Custom verbs used in spinner progress text"
943+
}
944+
},
945+
"required": ["verbs"],
946+
"additionalProperties": false
947+
},
866948
"spinnerTipsEnabled": {
867949
"type": "boolean",
868950
"description": "Show tips in the spinner while Claude is working. Set to false to disable tips (default: true)",

src/test/claude-code-settings/hooks-complete.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
{
4545
"hooks": [
4646
{
47+
"async": true,
4748
"command": "echo 'Running bash command' >> /tmp/claude-log.txt",
4849
"timeout": 5,
4950
"type": "command"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extraKnownMarketplaces": {
3+
"internal-git": {
4+
"source": {
5+
"hostPattern": "git.internal.example.com",
6+
"source": "hostPattern"
7+
}
8+
}
9+
},
10+
"strictKnownMarketplaces": [
11+
{
12+
"hostPattern": "*.corp.example",
13+
"source": "hostPattern"
14+
}
15+
]
16+
}

src/test/claude-code-settings/modern-complete-config.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
"CLAUDE_LOG_LEVEL": "debug",
1616
"PROJECT_ROOT": "/home/user/projects"
1717
},
18+
"extraKnownMarketplaces": {
19+
"corp-git-host": {
20+
"source": {
21+
"hostPattern": "git.corp.example",
22+
"source": "hostPattern"
23+
}
24+
}
25+
},
1826
"fileSuggestion": {
1927
"command": "~/.claude/file-suggestion.sh",
2028
"type": "command"
@@ -74,6 +82,19 @@
7482
},
7583
"plansDirectory": "./plans",
7684
"respectGitignore": true,
85+
"sandbox": {
86+
"network": {
87+
"allowAllUnixSockets": false,
88+
"allowLocalBinding": true,
89+
"allowedDomains": ["api.anthropic.com", "*.example.com"],
90+
"deniedDomains": ["malware.example"],
91+
"socksProxyPort": 11080
92+
}
93+
},
7794
"showTurnDuration": true,
95+
"spinnerVerbs": {
96+
"mode": "append",
97+
"verbs": ["Analyzing", "Building"]
98+
},
7899
"terminalProgressBarEnabled": true
79100
}

0 commit comments

Comments
 (0)