Back to List
Claude Code Bug Report: Automated Git Hard Resets Every Ten Minutes Cause Data Loss
Industry NewsClaude CodeGitAnthropic

Claude Code Bug Report: Automated Git Hard Resets Every Ten Minutes Cause Data Loss

A critical bug has been reported in Anthropic's Claude Code (version 2.1.87) where the tool automatically executes a 'git reset --hard origin/main' command every 10 minutes. This behavior, documented in GitHub issue #40710, occurs silently via programmatic Git operations rather than external binaries. The issue results in the permanent loss of all uncommitted changes to tracked files within the project repository. While untracked files and Git worktrees remain unaffected, the bug has been confirmed on macOS 15.4. Evidence from Git reflogs shows a consistent pattern of resets occurring at exact ten-minute intervals, posing a significant risk to developer productivity and data integrity.

Hacker News

Key Takeaways

  • Automated Data Loss: Claude Code version 2.1.87 performs a silent git fetch and git reset --hard origin/main every 10 minutes.
  • Scope of Impact: The bug destroys all uncommitted changes to tracked files; however, untracked files and Git worktrees are not affected.
  • Platform Specificity: The issue has been specifically reported and reproduced on macOS 15.4 using the Homebrew cask version of Claude Code.
  • Programmatic Execution: The resets are triggered via programmatic Git operations rather than spawning an external Git binary, making them harder to detect during execution.
  • Documented Evidence: Git reflogs show a precise 10-minute cadence of resets, confirming the automated nature of the bug.

In-Depth Analysis

Technical Mechanism of the Reset Bug

According to the GitHub issue report #40710, the core of the problem lies in how Claude Code interacts with the local repository's Git state. The tool appears to be programmed to synchronize with the remote origin/main branch on a fixed schedule. Specifically, it executes a git fetch origin followed by a git reset --hard origin/main. Because this is handled through programmatic Git operations—meaning it does not call the standard git command-line interface—users may not see active processes in their terminal or process monitor that indicate a reset is occurring. This silent execution is what leads to the unexpected loss of work, as any modifications to tracked files that have not been committed are overwritten by the state of the remote main branch.

Reproduction and Environment Details

The bug was identified by user johnmathews on March 29, 2026, running Claude Code version 2.1.87 on macOS 15.4 (Darwin 25.3.0, arm64). The environment utilized a compiled Bun binary installed via Homebrew. The evidence provided includes a Git reflog showing over 95 entries where the HEAD was moved to origin/main at exact intervals, such as 21:49:09, 21:59:09, and 22:09:09. This rhythmic pattern confirms that the behavior is not a one-time error but a recurring background task within the Claude Code core logic. The issue has been labeled with 'area:core', 'bug', 'data-loss', and 'has repro', indicating a high-priority technical flaw that directly impacts user data.

Industry Impact

The discovery of a data-loss bug in a major AI coding assistant like Claude Code highlights the risks associated with granting AI tools deep integration into local development environments. For the AI industry, this incident serves as a cautionary tale regarding the implementation of automated synchronization features. While the intent may be to keep the AI's context aligned with the latest remote code, the lack of user confirmation for destructive actions like a 'hard reset' violates standard version control safety protocols. This event may lead to increased scrutiny of how AI agents manage local file systems and repository states, potentially driving a shift toward more conservative, 'read-only' default behaviors or mandatory user prompts for state-changing Git commands.

Frequently Asked Questions

Question: What files are at risk when using the affected version of Claude Code?

All uncommitted changes to files currently tracked by Git are at risk of being deleted. However, the bug report specifies that untracked files survive the reset, and users working within Git worktrees are immune to this specific issue.

Question: How can I verify if my repository has been affected by this bug?

Users can check their Git reflog by running git reflog in their terminal. If the repository is affected, the log will show multiple entries labeled "reset: moving to origin/main" occurring at consistent 10-minute intervals.

Question: Is this issue limited to a specific operating system?

Based on the current bug report, the issue specifically occurs on macOS (tested on version 15.4). It is currently labeled as a platform-specific bug for macOS within the Anthropic repository.

Related News

The Quantification of Integrity: How AI Linguistic Patterns and Detection Tools are Transforming Modern Writing
Industry News

The Quantification of Integrity: How AI Linguistic Patterns and Detection Tools are Transforming Modern Writing

This analysis examines the phenomenon of "negative parallelism" and other linguistic markers that have become synonymous with Large Language Model (LLM) output. As AI-generated content proliferates, tools designed to detect machine-written text are increasingly flagging legitimate rhetorical devices, such as em-dashes and specific adverbs like "delve" or "genuinely." The article highlights a growing "witch hunt" where writers use tools like Grammarly to "humanize" their work, often resulting in prose that lacks rhythm and intent. By analyzing the author's critique of how we measure language integrity, this piece explores the tension between automated language production and the preservation of human stylistic expression, using examples ranging from JFK’s speeches to modern social media trends and the counter-intuitive suggestions provided by automated grammar checkers.

Apple’s Smart Glasses Strategy: Replicating the Apple Watch Playbook to Disrupt the Global Eyewear Industry
Industry News

Apple’s Smart Glasses Strategy: Replicating the Apple Watch Playbook to Disrupt the Global Eyewear Industry

Apple is reportedly preparing to enter the smart glasses market using a strategic blueprint identical to the one used for the Apple Watch. According to insights from Bloomberg’s Mark Gurman, Apple’s ambitions extend far beyond competing with tech giants like Meta. Instead, the company aims to disrupt the traditional eyewear industry in its entirety. This approach mirrors the 2015 launch of the Apple Watch, which targeted both tech-centric competitors like Pebble and Motorola and established traditional watchmakers such as Swatch, Fossil, and Seiko. By positioning smart glasses as a replacement for traditional eyewear, Apple seeks to transform a legacy industry through technological integration, moving the product category from a niche gadget to a universal lifestyle essential.

Erin Brockovich Launches New Mission to Challenge Secrecy Within the Data Center Industry
Industry News

Erin Brockovich Launches New Mission to Challenge Secrecy Within the Data Center Industry

Renowned environmental activist Erin Brockovich has officially embarked on a new mission, this time focusing her advocacy efforts on the data center industry. According to reports, Brockovich is specifically taking aim at the "secrecy" that surrounds these massive infrastructure projects. As data centers become the backbone of the modern digital economy and the burgeoning artificial intelligence sector, their environmental and operational transparency has come under increased scrutiny. Brockovich’s involvement signals a high-profile shift in how the public and environmental advocates may interact with tech giants moving forward. While specific details of the mission's initial steps remain limited, the focus on industry secrecy suggests a push for greater corporate accountability and public disclosure regarding the impact of these facilities.