fix(toolkit): live .env guard hook and the no-trailers rule (gh-#750, gh-#752) - #760
Merged
Merged
Conversation
… gh-#752) The example hooks read $CLAUDE_FILE_PATHS, which Claude Code never exports, so the .env guard and the formatter had never run. Hook input is JSON on stdin; the guard now reads .tool_input.file_path with jq and exits 2 on *.env files. The formatter hook is dropped: admin-ui has no prettier (CI runs eslint) and per-edit dotnet format is too slow for a builder loop. CLAUDE.md gains the rule that no session trailers, co-author lines, or claude.ai/code links go into commits, PRs, issues, or releases, so every subagent sees it without relying on memory. Refs gh-#750, gh-#752
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 What
.claude/settings.example.json: the PreToolUse.envguard now reads the hook's stdin JSON (.tool_input.file_path) instead of the non-existent$CLAUDE_FILE_PATHS. Tested:.envand.env.demo→ exit 2 (blocked);Program.cs,environment.ts→ exit 0.dotnet formatrestores the whole solution every Write.CLAUDE.md§ Rules: noClaude-Session:trailers,Co-Authored-Bylines, or claude.ai/code links in commits, PRs, issues, or releases.🏠 Personal side (already applied locally, not in this PR)
~/.claude/settings.json→"attribution": {"commit": "", "pr": "", "sessionUrl": false}.claude/settings.local.jsonhooks replaced with the same guard.Closes #750
Closes #752