Skip to content
Tech News
← Back to articles

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

read original get Git Command Cheat Sheet → more articles
Why This Matters

Claude Code's automated git reset --hard origin/main every 10 minutes can lead to significant data loss for users by silently discarding uncommitted changes, impacting developer workflows and productivity. This behavior highlights the importance of understanding automated version control operations within development environments and their potential risks.

Key Takeaways

Summary

Claude Code performs git fetch origin + git reset --hard origin/main on the user's project repo every 10 minutes via programmatic git operations (no external git binary spawned). This silently destroys all uncommitted changes to tracked files. Untracked files survive. Git worktrees are immune.

Environment

Claude Code version: 2.1.87 (Homebrew cask, compiled Bun binary)

2.1.87 (Homebrew cask, compiled Bun binary) OS: macOS 15.4 (Darwin 25.3.0, arm64)

macOS 15.4 (Darwin 25.3.0, arm64) Shell: zsh

Evidence

1. Git reflog: 95+ entries at exact 10-minute intervals

e8ea2c9 HEAD@{2026-03-29 22:19:09 +0200}: reset: moving to origin/main e8ea2c9 HEAD@{2026-03-29 22:09:09 +0200}: reset: moving to origin/main e8ea2c9 HEAD@{2026-03-29 21:59:09 +0200}: reset: moving to origin/main e8ea2c9 HEAD@{2026-03-29 21:49:09 +0200}: reset: moving to origin/main ... 8792b6c HEAD@{2026-03-29 16:55:41 +0200}: reset: moving to origin/main 8792b6c HEAD@{2026-03-29 16:45:41 +0200}: reset: moving to origin/main ... 32aa7c7 HEAD@{2026-03-28 15:47:36 +0100}: reset: moving to origin/main 32aa7c7 HEAD@{2026-03-28 15:37:36 +0100}: reset: moving to origin/main

The second offset is consistent within each session but varies between sessions ( :08 , :36 , :41 , :09 ), confirming a timer tied to session start time with a 600-second interval. 95+ entries observed across 4 sessions over ~36 hours.

... continue reading