Lily
Posted on Jul 12
• Originally published at dev.to
This is part of my "Claude Code environment" series. Last time I wrote about getting Claude and Codex to collaborate on a single machine. This time we're at the exit point of that setup: stopping accidents at the machine level when you let an AI drive git.
Handing commit and push over to an AI agent is convenient, but two things are scary. (1) It carelessly sweeps up an API key or .env, and (2) it pushes to the wrong repository. Neither can be prevented by "being careful," so I block them mechanically with a PreToolUse hook.







