-
-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Description
Problem
Agents frequently modify linter/formatter configs (.eslintrc, biome.json, .prettierrc, .ruff.toml, etc.) to make checks pass instead of fixing the actual code. This is a known failure mode documented in the community but not addressed by any existing hook.
Proposed Solution
A PreToolUse hook on Write|Edit that blocks modifications to linter/formatter config files with a steering message:
#!/bin/bash
set -euo pipefail
FILE_PATH=$(jq -r '.tool_input.file_path // .tool_input.file // empty')
[[ -z "$FILE_PATH" ]] && exit 0
BASENAME=$(basename "$FILE_PATH")
case "$BASENAME" in
.eslintrc*|.prettierrc*|biome.json|.ruff.toml|ruff.toml|\
.shellcheckrc|.stylelintrc*|.markdownlint*)
echo "BLOCKED: Do not modify linter/formatter config to pass checks. Fix the code instead." >&2
exit 2
;;
esac
exit 0This is a common issue across Claude Code setups. We built and tested this hook: buildingopen/blast-radius has the pattern, and it is running in production.
Happy to PR this if there is interest.
Reactions are currently unavailable