Claude Code bug: automatic git reset destroys uncommitted changes every 10 minutes

Bug Details
Claude Code performs git fetch origin + git reset --hard origin/main on the user's project repository every 10 minutes via programmatic git operations (no external git binary spawned). This silently destroys all uncommitted changes to tracked files. Untracked files survive, and git worktrees are immune to this behavior.
Environment and Evidence
Affected version: Claude Code 2.1.87 (Homebrew cask, compiled Bun binary)
OS: macOS 15.4 (Darwin 25.3.0, arm64)
Evidence from investigation:
- Git reflog shows 95+ entries at exact 10-minute intervals with entries like
reset: moving to origin/main - Live reproduction confirmed modified tracked files are silently reverted at the 10-minute mark
fswatchcaptured the file operations pattern matching git fetch + reset- Only the Claude Code CLI process (PID 70111,
claude --dangerously-skip-permissions) was found with CWD in the affected repo - No external git processes spawned - operations are programmatic within Claude Code (likely libgit2)
Technical Analysis
Binary analysis of the compiled binary at /opt/homebrew/Caskroom/claude-code/2.1.87/claude revealed:
hg1()function does["fetch","origin"]viat_(C8(), _)without explicit CWD, defaulting toprocess.cwd()io1()function is a git pull wrapper logginggit pull: cwd=${H} ref=${_??"default"}fileHistorystate tracks{snapshots: [], trackedFiles: new Set, snapshotSequence: 0}
What Was Ruled Out
The investigation eliminated: git hooks, Claude Code user hooks, plugin marketplace updater, macOS cloud sync (iCloud, Dropbox, Syncthing, Synology, Google Drive), cron/LaunchAgents, Vite/SvelteKit dev servers, IDEs/editors, Time Machine, and external file watchers.
📖 Read the full source: HN AI Agents
👀 See Also

OpenClaw's New Release: A Simple Name Change or a Major Upgrade?
OpenClaw, previously known as ClawDBot, has undergone a transformation. Read on to find out whether this change is merely cosmetic or introduces new features and improved stability.

Constraint Decay: Why LLM Agents Fail at Structured Backend Code
New research introduces 'constraint decay': as structural requirements accumulate, LLM agent performance drops drastically — capable agents lose 30 points in assertion pass rates, weaker ones approach zero. Actionable insights for anyone using AI coding agents.

Claude.ai Experiencing Elevated Errors and Login Issues for Claude Code
Claude.ai is experiencing elevated errors including login issues for Claude Code as of March 11, 2026. The incident was automatically reported within 2 minutes of an official system status update.

Weekly Multimodal AI Roundup: Holotron-12B, Nemotron Omni, GlyphPrinter, and More
This week's multimodal AI highlights include Holotron-12B for computer-use tasks, NVIDIA's Nemotron Omni models integrating language+vision+voice, GlyphPrinter for accurate text rendering in image generation, and several open-source projects for video enhancement, 3D segmentation, and multi-agent systems.