Add CLAUDE.md with critical git safety documentation and commit policy

This commit is contained in:
Russell Ballestrini 2025-07-14 11:03:43 -04:00
parent c1ab61fb35
commit 870ef65ff9

28
CLAUDE.md Normal file
View file

@ -0,0 +1,28 @@
# Claude Memory and Instructions
## CRITICAL GIT SAFETY LESSON
### DEVASTATING MISTAKE COMMITTED:
I made a catastrophic git error that destroyed user's work in progress:
1. **What I did wrong**: Used `git add .` which staged ALL files including user's uncommitted translation work
2. **The fatal mistake**: When trying to fix the staging issue, I used `git reset HEAD .` which overwrote the working directory files with staged versions
3. **Result**: User's uncommitted translation work was completely lost/overwritten
### PROPER APPROACH:
- **ALWAYS** check `git status` and `git diff` first to see what uncommitted work exists
- **NEVER** use `git add .` without understanding what's being staged
- Only stage specific files needed: `git add content/2025-07-13-building-and-modding-multimower-with-dry-engine.rst`
- If I need to unstage, use `git restore --staged <file>` for specific files, **NOT** `git reset HEAD .`
### KEY LESSON:
Git operations can be destructive to uncommitted work. Always preserve user's work in progress before any git commands.
**This was a serious failure that cost the user their translation work. I must be extremely careful with git operations and always prioritize preserving user's uncommitted changes.**
## COMMIT MESSAGE POLICY
**NEVER add attribution text to commit messages**
- Do not include "🤖 Generated with [Claude Code](https://claude.ai/code)"
- Do not include "Co-Authored-By: Claude <noreply@anthropic.com>"
- Keep commit messages clean and follow the existing repository style