[Bug] Git commit workflow bypasses CLAUDE.md pre-commit instructions due to missing entry-point hook

Resolved 💬 3 comments Opened Apr 15, 2026 by jdutton Closed Apr 19, 2026

Bug Description
Issue: CLAUDE.md pre-commit instructions are bypassed because the built-in git commit workflow has no entry-point hook

What happens: CLAUDE.md says "Before committing, always run [validation command]." Claude interprets this as "before the git commit command" — which is step 6 of a multi-step workflow already in progress. The built-in system prompt commit workflow (git status → git diff → git log → analyze → git add → git commit) starts executing before Claude checks for project-specific pre-commit requirements.

Why it's subtle: "Before committing" is ambiguous. It can mean "before the git commit command" or "before you start the commit process." Claude confidently follows the first interpretation and doesn't realize it's wrong. Even when explicitly told about this problem, Claude initially tried to add MORE tooling rather than recognizing it was misunderstanding the instruction. The ambiguity is invisible to the model.

The user's workaround: Rewriting CLAUDE.md to say "Before you start the git commit workflow (before git status, git diff, git log, or any commit preparation)" — explicitly naming the steps to intercept before. This works but the user shouldn't need to reverse-engineer the system prompt to write effective CLAUDE.md instructions.

Suggested fix: The built-in git commit workflow should include an explicit first step: "Check CLAUDE.md and project instructions for any pre-commit validation requirements and run them before proceeding." This gives CLAUDE.md a natural injection point at the start of the workflow rather than competing against a procedural sequence already in flight.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.85
  • Feedback ID: bf60d8d5-e961-426a-9e4a-e6496146a823

Errors

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server terraform invalid: Missing environment variables: TFE_TOKEN\n    at RzH (/$bunfs/root/src/entrypoints/cli.js:2611:23646)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T00:54:26.079Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server terraform invalid: Missing environment variables: TFE_TOKEN\n    at RzH (/$bunfs/root/src/entrypoints/cli.js:2611:23646)\n    at async Z (/$bunfs/root/src/entrypoints/cli.js:5573:11056)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T00:54:26.622Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server terraform invalid: Missing environment variables: TFE_TOKEN\n    at RzH (/$bunfs/root/src/entrypoints/cli.js:2611:23646)\n    at async G (/$bunfs/root/src/entrypoints/cli.js:5573:10286)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T00:54:26.622Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server terraform invalid: Missing environment variables: TFE_TOKEN\n    at RzH (/$bunfs/root/src/entrypoints/cli.js:2611:23646)\n    at async G (/$bunfs/root/src/entrypoints/cli.js:5573:10286)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T12:30:25.618Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server terraform invalid: Missing environment variables: TFE_TOKEN\n    at RzH (/$bunfs/root/src/entrypoints/cli.js:2611:23646)\n    at async Z (/$bunfs/root/src/entrypoints/cli.js:5573:11056)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T12:30:25.619Z"},{"error":"MaxFileReadTokenExceededError: File content (12163 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at C59 (/$bunfs/root/src/entrypoints/cli.js:4537:23271)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T12:50:59.370Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/jeffdutton/Workspaces/avonrisk-sdlc.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4546:6176)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T13:18:48.097Z"},{"error":"Error: Request was aborted.\n    at WV_ (/$bunfs/root/src/entrypoints/cli.js:1957:8412)\n    at next (native:1:11)\n    at aN9 (/$bunfs/root/src/entrypoints/cli.js:7557:7795)\n    at next (native:1:11)\n    at eN9 (/$bunfs/root/src/entrypoints/cli.js:7562:10609)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T13:21:06.899Z"},{"error":"Error: Request was aborted.\n    at WV_ (/$bunfs/root/src/entrypoints/cli.js:1957:8412)\n    at next (native:1:11)\n    at aN9 (/$bunfs/root/src/entrypoints/cli.js:7557:7795)\n    at next (native:1:11)\n    at eN9 (/$bunfs/root/src/entrypoints/cli.js:7562:10609)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T13:22:21.061Z"}]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗