Claude Code Silently Runs Git Reset Every 10 Minutes: How Much Should You Trust AI Coding Tools?

Claude Code Silently Runs Git Reset Every 10 Minutes: How Much Should You Trust AI Coding Tools?

Last weekend, a GitHub issue made a lot of developers nervous.

Someone discovered that Claude Code’s plugin marketplace refresh mechanism runs git fetch origin followed by git reset --hard origin/main every 10 minutes. Under normal conditions, these commands execute in Claude Code’s own plugin cache directory. But when that directory loses its .git folder (which happens more often than you’d think), these git commands drift upward to your current working directory. That means your active project repository.

The consequence? All uncommitted changes get silently wiped every 10 minutes.

This isn’t theoretical. The author of issue #40701 posted a complete git reflog showing over 95 reset: moving to origin/main entries, spaced exactly 10 minutes apart, spanning 4 sessions across 36 hours. They demonstrated real-time reproduction: modify a tracked file, wait 10 minutes, watch the changes vanish. Untracked files survived because git reset --hard only kills tracked content. They even used fswatch to monitor the .git/ directory, capturing lock file operations at the exact moment of each reset, confirming these git commands originated from Claude Code’s Node.js process without even calling the external git binary.

The root cause sounds embarrassingly simple. The plugin marketplace’s refresh function doesn’t pass a cwd parameter when invoking git commands. When the target directory isn’t a valid git repository, the command falls back to the process’s current working directory. One missing parameter transformed user code repositories into plugin update targets.

More Than One Hole

This isn’t Claude Code’s first git operation failure.

Earlier issue #32793 documented another variant of the same problem. Running claude install directly changes your project’s origin remote URL to https://github.com/anthropics/claude-plugins-official.git, while injecting duplicate refspecs into .git/config, causing subsequent git fetch commands to fail outright. The cause matched perfectly: plugin marketplace git operations without specified target paths, landing in user project directories.

Then there’s issue #39859, where a user reported Claude Code executing git reset --hard despite clearly knowing unstaged modifications existed, destroying irrecoverable work. This wasn’t a background mechanism bug but a judgment failure by the AI agent itself. The user’s words were blunt: it should have recognized git reset --hard as a destructive operation, should have run git stash first, should have informed the user before proceeding. Four things it should have done. It did none of them.

Last week brought issue #40714. Claude Code’s auto-update from version 2.1.86 to 2.1.87 silently erased users’ ~/.claude/settings.json, settings.local.json (containing MCP server configurations and permission settings), and all plugin activation states. The irony? Claude Code’s backup mechanism only covers .claude.json, an internal state file. User configuration files never made it into the backup scope. Your MCP configs, permission whitelists, and plugin settings rely entirely on manual reconstruction from memory.

Looking at these issues together, the pattern becomes clear. Claude Code possesses complete operational authority over the filesystem and git, but its permission boundary management suffers from systematic defects at both the background mechanism and AI decision-making levels.

Four Tools, Four Trust Models

Claude Code’s problems aren’t isolated. It represents one extreme in how AI coding tools approach permission design. Comparing four mainstream tools reveals drastically different design philosophies.

Claude Code takes the full delegation route. It runs directly in your terminal with ability to read/write arbitrary files, execute any shell command, and manipulate git. This design’s advantage lies in its capability ceiling. It can run tests, modify configurations, and manage dependencies for you. The cost comes in trust requirements. The permissions you grant it fundamentally equal giving a junior developer sudo access before you leave for lunch. Those bugs caused damage precisely because Claude Code had permission to do these things, and it doesn’t need to ask you when it does them.

Cursor chose the editor sandbox route. AI operations stay confined within VS Code’s editor framework. It can read your code, suggest modifications, even help refactor, but these changes require confirmation in the editor. It won’t directly touch your filesystem or run shell commands on its own. Cursor’s Agent mode does expand permission boundaries by allowing terminal command execution, but the overall architecture remains under editor control. This design sacrifices some automation capability in exchange for a more controllable risk surface. You’re unlikely to encounter scenarios like “the AI secretly reset my repository.”

GitHub Copilot operates with minimal permissions. Its core function centers on code completion and chat, essentially playing a read-only plus suggestions role. Copilot won’t modify your files (unless you accept suggestions), won’t execute commands, won’t touch git. Copilot Workspace and Copilot Agent gradually expand capability boundaries, but GitHub’s strategy clearly leans conservative, with each expansion carrying explicit user confirmation mechanisms. Small permissions mean limited capabilities. You can’t ask Copilot to run your entire CI pipeline, but it also won’t break anything without your knowledge.

OpenAI’s Codex takes a middle path. The cloud version (Codex Web) runs in completely isolated sandbox environments, with each task getting an independent container preloaded with a copy of your codebase. It can read/write files, run commands, and execute tests, but all operations occur in the sandbox without affecting your local environment. After task completion, you review results and decide whether to merge. The local version (Codex CLI) also offers sandbox mode, controlling risks through network isolation and directory restrictions. This design philosophy gives AI sufficient capability to complete complex tasks while leaving the “commit” decision with humans.

These four models form a spectrum. Copilot (read-only suggestions) leads to Cursor (editor sandbox) to Codex (isolated sandbox) to Claude Code (full access). From left to right, capability increases and risk increases. No position on this spectrum holds absolute correctness, but you need clarity on where your tool sits and whether you’re prepared to shoulder the corresponding risks.

The Real Trust Problem

At this point, it’s tempting to conclude “Claude Code is unsafe, avoid it.” But that misses the point.

The real issue is this: we’re entering an era where AI agents need increasing system permissions, yet the industry hasn’t established mature trust frameworks.

Those Claude Code bugs aren’t technically complex. A missing cwd parameter, auto-update without configuration migration, AI decision-making that failed to identify destructive operations. These are engineering quality problems that will get fixed. But the deeper question persists: when we grant AI tools expanding permissions, what are our security assumptions?

Traditional software permission models build on determinism. A program either has permission to do something or it doesn’t. You can audit its code and predict its behavior. But AI agent behavior is probabilistic. Identical inputs with different contexts may produce completely different operation sequences. Claude Code’s system prompt contains “measure twice, cut once,” requiring confirmation before destructive operations. Yet issue #39859 proves such prompt-based constraints are fragile. AI can “know” rules but “forget” to follow them in specific contexts.

This is the core contradiction of trust. We need AI agents to have sufficient permissions to provide real help, but we lack reliable mechanisms to ensure they correctly use these permissions in all situations.

Anthropic clearly recognizes this problem. Claude Code has a permission prompt mechanism requesting user confirmation the first time it executes certain operation types. But once you click “allow,” subsequent similar operations no longer ask. This represents a practical compromise, but also means one authorization might cover scenarios you didn’t anticipate.

OpenAI’s Codex solves part of the problem with sandboxes, but sandboxes carry costs. Complete isolation means AI cannot interact with your real development environment, cannot access local services, databases, or private registries. For many actual development scenarios, this represents a hard limitation.

No perfect answer exists yet. But several directions merit attention: layered permissions (separating read/write/execute authorizations), operation auditing (all AI operations traceable), hard stops for destructive operations (not relying on AI’s own judgment), and rollback-capable execution environments. These aren’t new concepts. Operating systems and database domains have mature practices, just not yet systematically applied to AI coding tools.

What You Can Do Right Now

Waiting for tool vendors to perfect trust mechanisms might take a while. As developers, you can take immediate protective measures.

Git branch strategy forms the most basic defense line. Never let AI operate directly on your main branch. Create dedicated work branches where all AI modifications occur, with human review before merging. Even if AI messes up, your main branch stays safe. If you use Claude Code, the author of issue #40701 discovered git worktrees remain unaffected by that 10-minute reset bug, making this approach worth considering.

Commit frequently. This sounds obvious, but many people using AI coding tools enter a “let it run” state, going 30 minutes or even an hour without committing. In a world where AI might reset your repository at any moment, this amounts to gambling. Commit after completing each meaningful change, even if your commit messages feel casual.

Back up configurations. Claude Code’s issue #40714 teaches us that a tool’s own backup mechanisms don’t necessarily cover files you care about. Back up your settings.json, MCP configurations, and plugin lists separately, or better yet, manage them with a dotfiles repository. Getting wiped once with recovery capability is manageable. Getting wiped once without knowing your original configuration becomes a real problem.

Understand your tool’s permission model. This doesn’t mean reading all documentation, but rather clarifying several key questions. Can it execute shell commands? Can it modify git? Do its operations run in a sandbox or directly on your filesystem? Does it have background processes doing things you don’t know about? Claude Code’s plugin marketplace refresh exemplifies “background processes doing things you don’t know about.”

The final point, also the most easily overlooked: maintain skepticism. AI coding tool marketing language emphasizes “let AI write code for you” and “10x efficiency gains.” These claims might hold truth, but efficiency gains shouldn’t require surrendering control. You can trust AI’s code suggestions without trusting its unsupervised filesystem access.

This industry remains in early stages. Tools will improve, trust mechanisms will mature, permission models will refine. But until then, treating AI coding tools like highly capable interns who occasionally make rookie mistakes represents the most pragmatic attitude. Give them adequate space to contribute, but don’t hand over the root password.

The question isn’t whether to trust AI coding tools. It’s understanding exactly what you’re trusting them with, and whether your safeguards match that trust level. Claude Code’s 10-minute git reset bug serves as a reminder: the most dangerous failures aren’t the spectacular crashes you immediately notice, but the silent operations that erase your work while you’re not looking.

Every AI coding tool makes different tradeoffs between capability and safety. Copilot plays it safe with minimal permissions but offers limited autonomy. Cursor balances control with useful automation inside editor boundaries. Codex gives substantial power but isolates consequences. Claude Code offers maximum capability at the cost of maximum risk exposure. None of these approaches is inherently wrong, but each demands different vigilance levels from users.

The developers who lost work to that 10-minute reset bug weren’t careless. They were using a tool that claimed to help them code faster, under reasonable assumptions about how it would behave. The tool violated those assumptions not through malicious intent but through incomplete engineering. This distinction matters because it reveals the challenge facing the entire AI coding tool category.

When you install traditional development tools, you understand their scope. Your compiler won’t modify unrelated files. Your linter won’t rewrite your git history. Your IDE won’t silently change configuration files. These tools operate within predictable boundaries because humans designed them with specific, limited purposes.

AI coding agents break this model. Their purpose is deliberately broad: help with whatever coding task you’re facing. This breadth requires wider permissions, but the mechanisms for safely managing those permissions lag behind the capabilities they enable. We’re essentially running beta-quality permission systems for production-critical development work.

Consider what happened in issue #39859. The AI agent knew a destructive operation was about to occur. The knowledge existed somewhere in its context window. Yet it proceeded anyway. This failure mode doesn’t exist in traditional tools. Your compiler can’t “forget” to check syntax. Your version control system can’t “decide” to skip safety checks. But AI agents operate through probabilistic inference, meaning every decision carries some non-zero risk of the wrong choice, regardless of how well-designed the system prompt might be.

The plugin marketplace bug reveals another dimension of the trust problem. That 10-minute timer wasn’t something users explicitly enabled. It ran silently in the background, part of keeping the plugin system updated. Background automation is valuable, but when it has git permissions and lacks proper isolation, it transforms from convenience into liability. Users didn’t know they needed to protect against this failure mode because they didn’t know the mechanism existed.

This gets at a fundamental asymmetry in the relationship between users and AI coding tools. The tool knows what permissions it has and what operations it might perform. Users typically don’t, beyond whatever the documentation mentions. And documentation rarely covers failure modes, especially bugs that haven’t been discovered yet. You’re trusting not just the tool’s intended behavior but also its resilience against the infinite variety of edge cases that emerge in real-world use.

Branch protection strategies help, but they’re reactive measures. They limit damage after something goes wrong rather than preventing the problem. Frequent commits similarly treat symptoms rather than causes. These practices are valuable and necessary, but they also represent accommodations to tools that haven’t earned complete trust yet.

The path forward probably requires both technical and cultural shifts. Technically, AI coding tools need permission systems that match their operational scope. Instead of binary allow/deny decisions, granular controls over file access, command execution, and git operations. Audit logs that capture every operation for later review. Confirmation requirements for any action that can’t be trivially undone. These features exist in other domains and could be adapted.

Culturally, both tool makers and users need recalibrated expectations. Tool makers should stop marketing AI coding assistants as if they’re infallible pair programmers. Users should stop treating them as such. The technology delivers remarkable capabilities but hasn’t achieved the reliability levels that would justify unrestricted filesystem access.

Claude Code will fix the 10-minute reset bug. GitHub will continue carefully expanding Copilot’s capabilities. Cursor and Codex will refine their sandbox approaches. But individual bug fixes don’t solve the systemic challenge of building AI agents that safely operate with system-level permissions. That requires sustained attention to security architecture, not just patching holes as they appear.

The developers who depend on these tools deserve better than post-incident debugging. They deserve permission models designed with failure modes in mind, where a missing cwd parameter can’t cascade into data loss. They deserve transparency about what background operations run and what permissions those operations hold. They deserve tooling that makes it easy, not burdensome, to maintain oversight over AI actions in their development environment.

Until that maturity arrives, the practical advice remains straightforward. Use AI coding tools for their strengths: generating boilerplate, exploring implementation approaches, catching obvious mistakes. But keep the important stuff under version control, commit early and often, maintain backups of critical configurations, and never assume the AI will protect you from the AI. Trust, but verify. And when verification reveals problems like that 10-minute reset, speak up. The issues that get filed and discussed publicly are the ones that get fixed and drive systemic improvements.

The promise of AI coding tools is real. They accelerate development, lower barriers to entry, and make previously tedious tasks manageable. But promise and readiness aren’t the same thing. Claude Code’s permission system clearly wasn’t ready for that plugin marketplace refresh mechanism. The question every developer needs to answer for themselves is: what parts of my development workflow am I willing to delegate to tools that are still figuring out their own boundaries?

Stay updated with our latest AI insights

Follow FuturePicker on Google
Scroll to Top