# Shai-Hulud Cleanup

Personal toolkit of shell scripts with a bundled Claude Code skill. It finds and removes the damage a supply-chain worm in JavaScript packages does to Git repositories (forged commits, obfuscated build configs, editor tasks that run on folder open) and guards against a repeat, locally and on the server side.

- **Facts:** 2026, Personal project, Completed, role: Sole developer
- **What I did:** I designed and wrote the whole toolkit alone, from the detection library to the guards, the cleanup scripts and the Claude Code skill.
- **Scope:** devops
- **Domain:** security
- **Stack:** Git, GitHub Actions, Claude Code, Husky, Python, Cron jobs
- **Page:** https://sergey-petrinich.vercel.app/work/shai-hulud-cleanup

Capabilities:

- Three signature tiers, with infection decided on the current tree of every branch and tag
- Bulk scan of a code root and a deep per-repository report with a suggested action
- No-clone scan through the GitHub API for one repository, a list, or every repository an account can push to
- Five scripts for five repository states, chosen by a decision matrix
- Surgical recovery that keeps legitimate changes from a poisoned branch and drops payload folders
- Batch orchestrator that plans first and acts only with an explicit flag, and a remote reset with a dry-run plan and a lease on every branch
- Five global Git hooks, including one that aborts a fetch or clone whose remote tip carries a payload
- Machine installer with optional steps and a verifier, plus a daily scheduled scan with desktop notification
- Server-side rulesets and a GitHub Actions workflow that resets a branch on a hit
- Audit that finds repositories whose own hook path switches the global guard off
- Bundled skill with a playbook, a decision tree and reference notes
- Command guard that blocks one-shot package runners and global installs, with 30+ self-test checks for the hooks

Back to the [work archive](https://sergey-petrinich.vercel.app/work.md) · [CV](https://sergey-petrinich.vercel.app/cv.md) · [all of it in one file](https://sergey-petrinich.vercel.app/llms-full.txt)
