AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Sep 29, 2026, 10:00 JST

5 Claude Code sessions, 1 git tree: 8 accidents in 3 months

5 Claude Code sessions, 1 git tree: 8 accidents in 3 months

3 Key Points

  1. What happened

    Running Claude Code in one shared working tree produced 8 accidents and near-misses between June and September 2026, including a commit that swallowed 5 files when the author had verified only 3.

  2. Why it matters

    The author, a solo non-engineer, found that verifying with git diff before committing is a snapshot of the past, so the check and the commit can race — any team sharing one working tree appears to face the same gap.

  3. What to watch

    The author's own defenses stayed best-effort; even listing exact file paths still pulls in another session's edits to the same file, so true isolation means per-session worktrees or one writer at a time.

WHO IT HITSSmall teams and solo operators who point several AI coding agents at one repository, such as data and localization staff running parallel translation or scheduled-job edits.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The settings matter here: the author is not an engineer and writes code through AI, and parallel work is simply several terminal windows running claude in the same directory, with no worktree isolation in daily use. A stop hook automatically pushes commits at the end of each turn under conditions including being on main, having commits ahead of the local origin/main, and passing secret checks — so a commit that has swept in another session's work can leave the machine at someone else's turn boundary.

Some of the accidents follow from git's documented behavior rather than from carelessness. Because a pathspec commit records the working tree contents of the listed paths and ignores what is staged for other paths, it avoids other sessions' staged changes but still takes edits made by anyone to the same file. The author reproduces this with a script, and cites git help commit for git 2.54.0.

The clipboard incidents come from the same root: macOS shares one pasteboard across all sessions in the same GUI login. The author stopped routing text through it, now inserts form text directly, and checks the field against the approved text before sending. On session liveness, the author restricts taking over work to explicit handoff, an acknowledged reply, or direct visual confirmation, because a transcript timestamp is only a reference for recent activity — but says even that control is best-effort.

FAQ
Why is git add, then git diff --cached, then git commit not safe?
The three steps race when sessions run side by side, because the check only reflects a past snapshot. In one case the author verified 3 files and the commit that followed recorded 5.
Does the pathspec form of git commit fully protect you?
No. The author says it is nearly the only way to avoid picking up another session's staged changes, but it has three holes: passing a folder pulls in that folder's unstaged edits, a file edited by both sessions goes in whole, and untracked files cannot be specified.
What is the most expensive incident reported?
A translation session hit its usage limit with progress stuck at 1/34. The author took it over and committed, then the session came back and rewrote 29 files with its own translations, leaving a mix of two translations on disk.

Get the latest Large Language Models news every morning

For example, today's edition would include:

  • Anthropic ships Claude Sonnet 5.5, 30%+ faster at same priceITmedia AI+ · 27m ago
  • Dentsu AI clears 99% on 20万件超 approvalsITmedia AI+ · 27m ago
  • Nvidia launches tool to quarantine rogue AI agentsSemafor Tech · 27m ago

AI-summarized, only the topics you pick: one digest a day via Email, LINE, or Slack.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleTiny AI Arena pits AI models in battle game; claude-sonnet-5 leads