Add .claude/settings.json to configure pre and post tool use hooks for Edit, MultiEdit, and Write operations. These hooks integrate with the but CLI to execute validation and cleanup commands before and after file modifications, and on stop events.
38 lines
637 B
JSON
38 lines
637 B
JSON
{
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Edit|MultiEdit|Write",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "but claude pre-tool"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Edit|MultiEdit|Write",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "but claude post-tool"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"Stop": [
|
|
{
|
|
"matcher": "",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "but claude stop"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|