Claude Code runs Git reset –hard origin/main against project repo every 10 mins

github.com
March 29, 2026
4 min read
🔥🔥🔥🔥🔥
60/100
Summary
A tool built by a user was identified as the cause of automatic git resets every 10 minutes, utilizing GitPython to hard-reset the working directory on a polling cycle. The issue was mistakenly attributed to Claude Code, but it was a result of the user's local setup affecting the same current working directory.
Key Takeaways
- The tool running git reset --hard origin/main every 10 minutes was identified as a locally built tool using GitPython, not a bug in Claude Code.
- The resets caused all uncommitted changes to tracked files to be lost, while untracked files remained intact.
- The issue was reproducible, with evidence showing consistent resets at 10-minute intervals across multiple sessions.
- The Claude Code process was confirmed as the only active process affecting the repository, with no external git processes involved.
Coverage & discussions
Hacker News · github.com
Community discussions
Community Sentiment
Concerns
- The reliance on `--dangerously-skip-permissions` indicates a lack of caution, which can lead to unpredictable behavior in AI applications.
- The initial characterization of the issue suggests a misunderstanding of the context, potentially misleading the community about the reliability of Claude Code.




