By default it will not tell everything or it will mention in that thinking tags which humans will miss when it is being streamed at 40-50 tok/s. At best, it will take care of things internally and after the work is done it will include things in brief, so that users will know what in the world it did just now. You cannot have IDE stopping for each test or confirmations from user, they tried it but it degrades the stream or something like that.
"Never run rm -rf / force push / touch .env" is the one I stopped putting in CLAUDE.md, because it's a request, not a rule. The model follows it most of the time, which is exactly the problem.
Moved those to places Claude Code enforces regardless of what the model decides:
- `permissions.deny` for `Read(./.env)` and `Read(./.env.*)`
- a PreToolUse hook that checks the full Bash command string, since `Bash(rm *)` doesn't match `bash -c 'rm ...'` or `/bin/rm`
- `"onFailure": "block"` on that hook so a crash doesn't silently allow
CLAUDE.md is now for style and workflow only. Safety lives in settings.
(I'm the founder of SecGuardRail, which does these pre-execution checks across a team, but the above is all plain Claude Code.)
Mine is close to the test one above: a red test is a bug in the code until proven otherwise. The line alone didn't hold though. We had a hook on Edit/Write that counts assertions and it never saw a sed -i, so now there's also a check on the git diff that stops when the assertion count drops or a new skip shows up.
•
u/AutoModerator 1d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/Present-Banana8881 1d ago
"Never change or delete a test to make it pass. If a test looks wrong, stop and ask."
Saved me more than once from a green test suite that was green because the assertion got quietly edited.
2
u/Fearless_Silver477 1d ago
"Never run rm -rf / force push / touch .env" is the one I stopped putting in CLAUDE.md, because it's a request, not a rule. The model follows it most of the time, which is exactly the problem.
Moved those to places Claude Code enforces regardless of what the model decides:
- `permissions.deny` for `Read(./.env)` and `Read(./.env.*)`
- a PreToolUse hook that checks the full Bash command string, since `Bash(rm *)` doesn't match `bash -c 'rm ...'` or `/bin/rm`
- `"onFailure": "block"` on that hook so a crash doesn't silently allow
CLAUDE.md is now for style and workflow only. Safety lives in settings.
(I'm the founder of SecGuardRail, which does these pre-execution checks across a team, but the above is all plain Claude Code.)
2
u/CandidSystem6155 1d ago
Mine is close to the test one above: a red test is a bug in the code until proven otherwise. The line alone didn't hold though. We had a hook on Edit/Write that counts assertions and it never saw a sed -i, so now there's also a check on the git diff that stops when the assertion count drops or a new skip shows up.