session-token-log.sh + token-spend.sh мигрированы live → канон
(chezmoi/dot_claude/scripts/, executable_-префикс). Добавлен
SessionEnd-хук в settings.json.tmpl (portable {{.chezmoi.homeDir}},
async, как live). Канон-жнец (7482e48) опирался на эти скрипты через
guard — на новом Mac учёт молча ломался: скриптов нет + хук не проведён.
Оба скрипта чисты ($HOME, ноль хардкода/личного). dry-validate +
smoke зелёные, settings.json рендерится валидным.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
70 lines
1.8 KiB
Cheetah
70 lines
1.8 KiB
Cheetah
{
|
|
"permissions": {
|
|
"deny": [
|
|
"Read(/{{ .chezmoi.homeDir }}/.claude/secrets/**)",
|
|
"Read(/{{ .chezmoi.homeDir }}/.claude/server.env)",
|
|
"Read(/{{ .chezmoi.homeDir }}/.claude/session-env/**)",
|
|
"Read(/{{ .chezmoi.homeDir }}/.ssh/**)",
|
|
"Read(/{{ .chezmoi.homeDir }}/.secrets/**)",
|
|
"Read(/{{ .chezmoi.homeDir }}/.config/gh/**)",
|
|
"Read(/{{ .chezmoi.homeDir }}/.git-credentials)",
|
|
"Read(/{{ .chezmoi.homeDir }}/.claude/mcp.json)",
|
|
"Read(**/.env)",
|
|
"Read(**/.env.*)",
|
|
"Read(**/*secret*)",
|
|
"Read(**/*credential*)",
|
|
"Read(**/id_rsa*)",
|
|
"Read(**/*.pem)",
|
|
"Read(**/.scrapegraphai/**)",
|
|
"Read(**/references/secrets-map.md)",
|
|
"Edit(**/.env)",
|
|
"Write(**/.env)",
|
|
"Edit(**/*secret*)",
|
|
"Write(**/*secret*)"
|
|
]
|
|
},
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Write|Edit|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bash \"{{ .chezmoi.homeDir }}/.claude/hooks/security-guard.sh\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"SessionStart": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bash \"{{ .chezmoi.homeDir }}/.claude/hooks/onboarding-detect.sh\"",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"SessionEnd": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bash \"{{ .chezmoi.homeDir }}/.claude/scripts/session-token-log.sh\"",
|
|
"async": true,
|
|
"timeout": 20,
|
|
"statusMessage": "Token-spend → self-learning..."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"enabledPlugins": {
|
|
"superpowers@superpowers-dev": true,
|
|
"ui-ux-pro-max@ui-ux-pro-max-skill": true,
|
|
"caveman@caveman": true
|
|
}
|
|
}
|