Claude Code · SettingsHooks
black-on-save
Formats each edited Python file with Black.
by Prompt Studio
hooks
License: MITView original
Contents
Where it goes: .claude/settings.json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *.py) black -q \"$f\" >/dev/null 2>&1;; esac; true"
}
]
}
]
}
}
More in Settings
Read-only mode
Allows reading and searching, but asks before editing or running commands.
Protect secrets
Blocks reading .env files, keys and local credentials.
Node.js project
Allows npm run, tests and git status without asking; blocks publishing packages.
CI environment
Disables telemetry and auto-updates for running in pipelines.
Git branch statusline
Shows the model, folder and current branch in the status bar.
Short history
Deletes local transcripts after 7 days.