Skip to content

Instantly share code, notes, and snippets.

@bjtitus
Created July 1, 2025 14:54
Show Gist options
  • Save bjtitus/9722630ef2d45a66ede87a51ef58df61 to your computer and use it in GitHub Desktop.
Save bjtitus/9722630ef2d45a66ede87a51ef58df61 to your computer and use it in GitHub Desktop.
Swiftlint autocorrect for Claude Code Hooks
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path' | grep '\\.swift$' && swiftlint --fix \"$(jq -r '.tool_input.file_path')\" || true"
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment