claude-code - 💡(How to fix) Fix [BUG] v2.1.109 install wiped git-tracked ~/.claude/ contents including .git [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48673Fetched 2026-04-16 06:54:06
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

On 2026-04-15 at 08:52:36 the v2.1.109 binary was installed on my MacBook. Between then and the next CC startup ~1 hour later, all git-tracked content in ~/.claude/ — CLAUDE.md, settings.json, skills/, rules/, plugins/, commands/, channels/, scheduled-tasks/, session-notes/, scripts/, launch.json, .gitignore, AND the .git directory itself — was silently deleted. Everything NOT tracked by my git repo (cache/, chrome/, sessions/, history.jsonl, backups/, session-env/, shell-snapshots/, mcp-needs-auth-cache.json, projects/*.jsonl) was preserved. ~/.claude.json was also untouched.

Forensic evidence tying this to the 2.1.109 install:

New binary mtime: 08:52:36. First observable filesystem damage: 08:53–08:56 (first failed cron run against the now-missing ~/.claude/scripts/auto-push.sh). Deletion pattern matches git ls-tree HEAD + .git + nothing else — pointing at a migration that understood which paths were user-installed vs. CC-managed, but chose to delete user-installed content. officialMarketplaceAutoInstallAttempted: true and officialMarketplaceAutoInstalled: true were set in ~/.claude.json before the event — so the post-wipe re-install step was short-circuited, leaving me with empty dirs and no auto-recovery. No destructive git operations in my repo history (linear: commit 45c16e7 at 08:51 → commit 28f65db at 10:36 after I manually restored from GitHub). No manual rm in shell snapshots. Impact: lost access to every plugin including superpowers, code-review, feature-dev, frontend-design, figma, firecrawl, skill-creator, claude-md-management, telegram, context7, Notion, asana. Restoration required cloning my personal claude-config repo from GitHub, manually running claude plugin marketplace add anthropics/claude-plugins-official, then /reload-plugins.

Happy to share full timeline + file listings if useful. MacBook, macOS, CC installed via ~/.local/bin/claude symlink into ~/.local/share/claude/versions/.

What Should Happen?

Claude shouldn't delete all those files when it updates its version. Seems like a big deal.

Error Messages/Logs

Steps to Reproduce

Reproducer likely: users whose ~/.claude/ is a git-tracked dir with a whitelist .gitignore. Ask: does 2.1.109's install migration rm tracked paths under some branch?

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

v2.1.109

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can likely be mitigated by modifying the .gitignore file in the ~/.claude/ directory to prevent Claude from deleting git-tracked files during the update process.

Guidance

  • Verify that the .gitignore file is correctly configured to exclude important files and directories from being deleted by Claude.
  • Check the Claude documentation for any specific guidelines on configuring the ~/.claude/ directory and .gitignore file for safe updates.
  • Consider creating a backup of the ~/.claude/ directory before updating Claude to prevent data loss in the future.
  • If the issue persists, try resetting the Claude configuration to its default state and re-applying any custom settings.

Example

No code snippet is provided as the issue is related to configuration and file management rather than code.

Notes

The issue seems to be specific to the v2.1.109 version of Claude, and it's unclear if this is a widespread problem or an isolated incident. Further investigation and testing may be necessary to determine the root cause and develop a permanent fix.

Recommendation

Apply a workaround by modifying the .gitignore file and creating regular backups of the ~/.claude/ directory to prevent data loss during updates. This approach is recommended due to the potential for data loss and the uncertainty surrounding the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] v2.1.109 install wiped git-tracked ~/.claude/ contents including .git [1 comments, 2 participants]