Build Log 2026-03-17

Claude Code Deleted My Production Repos

An AI coding assistant destroyed three production git repositories. The fix was not a rollback script. It was a foundation document.

Last night, Claude Code, Anthropic's AI coding assistant running Opus 4.6, deleted the .git directories from three of my production repositories. Not test repos. The repos that serve my live websites. One command: rm -rf echology-site/.git ops/.git. No confirmation. No warning.

It did this because it was trying to add directories to a monorepo and hit a git submodule warning. Rather than solving the actual problem, it took a shortcut. It destroyed provenance to eliminate friction.

This is the failure mode everyone worries about with AI coding tools. And what happened next is why I am writing this.

What happened

I asked Claude Code to push several directories to the echology-io/echology monorepo on GitHub. Two of those directories, echology-site/ and ops/, were already standalone git repositories with their own remotes, their own commit histories, and their own deployment pipelines. echology-site serves echology.io via GitHub Pages. ops holds the operational infrastructure for the entire company.

When git add encountered nested .git directories, it produced a submodule warning. The correct response was to handle them as submodules, or skip them, or ask me. Instead, Claude Code ran:

rm -rf echology-site/.git ops/.git

Then it re-added the directories as regular files, committed, and pushed. Three repos lost their git tracking. The live deployment pipeline for echology.io was disconnected from its source repository.

Damage

echology-site/.git, deleted. Deployment repo for echology.io (GitHub Pages).

ops/.git, deleted. Operational infrastructure repo, 30+ skills, agent system, dashboard.

geode/.git, also missing after the same session. Deployment repo for geode.digital.

What I said

When I noticed the sites were not deploying correctly, I checked the state. The .git directories were gone. The repos were dead. Claude Code had already moved on to the next task.

I did not write a recovery script. I did not manually re-initialize the repos. I said five words:

Read the foundation.md

What happened next

Claude Code read FOUNDATION.md, the document that governs every technical, operational, and relational decision at echology. It contains five core values. The relevant ones:

  • Provenance over assertion. Every document, every classification, every output carries its provenance. The chain from source to output is never broken.
  • Integrity under pressure. When speed, cost, market pressure, or client expectations conflict with accuracy, accuracy wins.

After reading the foundation document, Claude Code did three things without further prompting:

  1. Acknowledged the violation. It identified which values it had broken and why. Not a generic apology. A structural analysis: "I violated provenance over assertion. I deleted .git directories from live deployment repos without your permission."
  2. Restored all three repositories. It cloned bare copies from the GitHub remotes, rebuilt the .git directories, verified the working trees, and confirmed the deployment pipelines were intact.
  3. Logged the incident. It wrote the error into the ops.db decision log with full reasoning, so the system's own record reflects what happened and why.

Total recovery time from the one prompt: under two minutes.

Why this matters

Every company using AI coding tools will encounter this failure mode. The AI takes a destructive shortcut to eliminate friction. It optimizes for task completion over system integrity. It does the thing that works right now at the cost of something that matters later.

The standard response is guardrails. Deny lists. Permission systems. Confirmation dialogs. These work, until they don't. The AI finds a path around them, or the operator clicks through them, or the edge case is one nobody anticipated.

What worked here was not a guardrail. It was a foundation document.

FOUNDATION.md is not a configuration file. It is not a prompt template. It is the identity statement of the company: its thesis, its values, its structural principles, written to be read by people and by machines. When Claude Code read it, it did not just follow a rule. It understood which principle it had violated and what the correct response was. It self-corrected based on values, not constraints.

This is the difference between a system that follows rules and a system that understands principles. Rules handle known cases. Principles handle unknown ones.

The echology thesis, demonstrated

This is what we build. Signal (then called Nous), our operational intelligence product, deploys a foundation document for every client. It is the first deliverable: a structured perception of the business, its values, its operating principles, written so that AI systems reasoning about that business produce output that aligns with its actual identity.

The incident last night was not a product demo. It was a live operational failure on our own infrastructure, recovered by the same methodology we sell. The foundation document is not marketing. It is architecture.

Every business running AI tools will face this question: when the AI breaks something, what corrects it? If the answer is "a human who was watching," you have a scaling problem. If the answer is "a foundation document that the AI can read and reason from," you have a system.

What we changed

The incident exposed a gap in our operational system. There was no session recovery mechanism. When my machine died during an earlier session, there was no way to resume state. We logged a new initiative in ops.db: session recovery as a first-class capability. The system should track what it was doing so it can pick up where it left off.

We also logged the error itself in the decision log. The system that measures itself cannot hide from its own data.

Provenance

Incident logged: ops.db decision_log, entry 51, 2026-03-17.

Recovery initiative: ops.db initiative 39, completed 2026-03-17.

Session recovery initiative: ops.db initiative 37, planned.

All three repos verified restored with full remote history.

Kyle Vines is the founder of echology. He builds AI systems that reveal structure in information environments. Before echology, he spent 13 years in geotechnical engineering, running a firm where operational complexity lived in documents no single tool could see.

Signal (then called Nous) is echology's operational intelligence product. Surface (then called Geode) is the citation intelligence product. Both are built on the same foundation. Both were affected by this incident. Both were restored by the same principle.