claude-code 設定ファイルのスキーマ
claude-code
.claude.json の projects に関するスキーマはコード中になさそう
まあ mcpServers とかも色々ない
発見いろいろ
settings.json
.permissions.additionalDirectories、グローバルに追加ディレクトリ設定できる? --add-dir 相当?
自作プロンプト集やフレームワークの instruction 置き場とかを通しておくと参照時にいちいちプロジェクト外参照にならないのかな? → そうっぽい
@ での補完に出るわけではないから面倒だけど pokutuna/coding-instructions を指しておく
.permissions.defaultMode
起動時のモード選べる、["acceptEdits", "bypassPermissions", "default", "plan"]
accepsEdits にしておくとちょっと便利
.hooks is 何
ツール呼び出しの前後に処理を挟めるぽいが隠されている? まだ動かない感じかな
→ 2025/7/1 出た Hooks - Anthropic
["PreToolUse", "PostToolUse", "Notification", "Stop"] に処理を挟めそう
JSON が標準入力に渡ってくる?
code:動かない.json
"hooks": {
"PreToolUse": {
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/Users/pokutuna/tmp/2025/06/29.claude.ihZ8Lg/log.sh"
}
]
}
}
そのうち特定の拡張子のファイルを保存したらフォーマッタ実行させたりできそうだな
別の話題: .env.OTEL_LOGS_EXPORTER=console にすると送られる内容が claude の出力として流れてくるね
OTEL_LOGS_USER_PROTMP=1
.claude.json
diffTool これは単に diff 出すもの? Edit 時の差分見て編集する際のやつかわからんな
autoConnectIde 既に vscode で同じプロジェクト開いていたら terminal からも接続する?
code:settings.schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "settings.json schema",
"type": "object",
"properties": {
"apiKeyHelper": {
"type": "string"
},
"cleanupPeriodDays": {
"type": "integer",
"minimum": 0
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"includeCoAuthoredBy": {
"type": "boolean"
},
"permissions": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
},
"deny": {
"type": "array",
"items": {
"type": "string"
}
},
"defaultMode": {
"type": "string",
"enum": [
"acceptEdits",
"bypassPermissions",
"default",
"plan"
]
},
"disableBypassPermissionsMode": {
"type": "string",
"enum": [
"disable"
]
},
"additionalDirectories": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": true
},
"model": {
"type": "string"
},
"enableAllProjectMcpServers": {
"type": "boolean"
},
"enabledMcpjsonServers": {
"type": "array",
"items": {
"type": "string"
}
},
"disabledMcpjsonServers": {
"type": "array",
"items": {
"type": "string"
}
},
"hooks": {
"type": "object",
"description": "Run custom commands at different points in the application lifecycle.",
"properties": {
"PreToolUse": {
"type": "array",
"description": "Before tool execution. Input to command is JSON of tool call arguments. Exit code 0: Stdout/stderr not shown. Exit code 2: show stderr to model and block tool call. Other exit codes: show stderr to user only but continue with tool call",
"items": {
"$ref": "#/definitions/hook"
}
},
"PostToolUse": {
"type": "array",
"description": "After tool execution. Input to command is JSON with fields \"inputs\" (tool call arguments) and \"response\" (tool call response). Exit code 0: Stdout shown in transcript mode (Ctrl-R). Exit code 2: show stderr to model immediately. Other exit codes: show stderr to user only",
"items": {
"$ref": "#/definitions/hook"
}
},
"Notification": {
"type": "array",
"description": "When notifications are sent",
"items": {
"$ref": "#/definitions/hook"
}
},
"Stop": {
"type": "array",
"description": "When the application stops",
"items": {
"$ref": "#/definitions/hook"
}
}
}
},
"learnMode": {
"type": "boolean"
},
"forceLoginMethod": {
"type": "string",
"enum": [
"claudeai",
"console"
]
}
},
"additionalProperties": true,
"definitions": {
"hook": {
"type": "object",
"properties": {
"matcher": {
"type": "string",
"description": "A regex to match against the tool name (for PreToolUse/PostToolUse) or notification content."
},
"hooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "command"
},
"command": {
"type": "string"
}
},
"required": [
"type",
"command"
]
}
}
},
"required": [
"hooks"
]
}
}
}
code:.claude.schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": ".claude.json schema",
"type": "object",
"properties": {
"numStartups": {
"type": "number",
"default": 0
},
"installMethod": {
"type": [
"string",
"null"
],
"default": null
},
"autoUpdates": {
"type": [
"boolean",
"null"
],
"default": null
},
"theme": {
"type": "string",
"default": "dark"
},
"preferredNotifChannel": {
"type": "string",
"default": "auto"
},
"verbose": {
"type": "boolean",
"default": false
},
"editorMode": {
"type": "string",
"default": "normal"
},
"autoCompactEnabled": {
"type": "boolean",
"default": true
},
"hasSeenTasksHint": {
"type": "boolean",
"default": false
},
"queuedCommandUpHintCount": {
"type": "number",
"default": 0
},
"diffTool": {
"type": "string",
"default": "auto"
},
"customApiKeyResponses": {
"type": "object",
"properties": {
"approved": {
"type": "array",
"items": {}
},
"rejected": {
"type": "array",
"items": {}
}
},
"default": {
"approved": [],
"rejected": []
}
},
"env": {
"type": "object",
"default": {}
},
"tipsHistory": {
"type": "object",
"default": {}
},
"memoryUsageCount": {
"type": "number",
"default": 0
},
"parallelTasksCount": {
"type": "number",
"default": 1
},
"promptQueueUseCount": {
"type": "number",
"default": 0
},
"todoFeatureEnabled": {
"type": "boolean",
"default": true
},
"messageIdleNotifThresholdMs": {
"type": "number",
"default": 60000
},
"autoConnectIde": {
"type": "boolean",
"default": false
}
}
}