git-large-repo-pack-recovery

Installation
SKILL.md

~/.nexus git repository accumulates runtime state files via auto-sync cron, causing .git dir to grow to 8.7 GB with a 60-commit unpushed backlog whose pack size exceeds GitHub's 2 GiB limit. Push fails with remote: fatal: pack exceeds maximum allowed size (2.00 GiB). Root cause: auto-sync commits rewrite churning state files every few minutes (sentinel heartbeat 53x, alert-history 53x, SENTINEL-HEALTH 51x, mc-prompts 50x, monitoring/*.json 45x), plus the repo tracks large binary artifacts (whisper models 1.5 GB, cli-tools compiled binaries 120 MB, .obsidian/plugins 33 files) that should never be in git.

2026-04-11 session: push to cryptopafi/nexus blocked by 2 GiB pack limit on the 60-commit backlog. 5 whisper blob revisions in unpushed history (~3.5 GB). Auto-sync cron was committing state files every few minutes causing high churn. Applied Step 1 (commit 989572a6d — untracked 72 files across 7 categories) + Step 2 (side branch audit-pro-hardening-20260411 efbb19bde pushed successfully, 16 files +922/-6 lines). Step 3 deferred pending explicit approval.

Solution: Diagnose with size + churn analysis: (a) cd ~/.nexus && du -sh .git to see pack size, (b) python3 -c 'import subprocess, os; files = subprocess.check_output(["git","ls-files"], text=True).strip().split("\n"); sizes = sorted([(os.path.getsize(f), f) for f in files if os.path.exists(f)], reverse=True); [print(f"{s/1024/1024:8.2f} MB {f}") for s, f in sizes[:30]]' to list top tracked files, (c) git log origin/main..HEAD --pretty=format: --name-only | sort | uniq -c | sort -rn | head -20 to find most-churned files in backlog, (d) git rev-list origin/main..HEAD --objects | awk '{print $1}' | sort -u | xargs -I{} git cat-file -s {} | sort -rn | head -5 to find largest blobs in unpushed commits; Classify essential vs not: essential = procedures/, projects/, scripts/, audit/ (plugin source), agents//SOUL.md, v2/ (code only), config/ (non-secret), workspace/drafts/ (plans), intel/raw/morning-report-raw-.md (historical), root docs. Not essential = models/, cli-tools/ binaries (keep TOOL-LIBRARY.md), .obsidian/plugins/, runtime state (monitoring/.json, sentinel heartbeats, mc state, workspace/intel/ messaging, sync/last-notion-sync.ts, events/echelon-.jsonl, .smart-env/event_logs/, intel/monitoring-db.json); Step 1 (non-destructive gitignore cleanup): edit ~/.nexus/.gitignore to add 13 new rules (binary artifacts: models/, cli-tools/ with !TOOL-LIBRARY.md negation, .obsidian/plugins/; runtime state: the 13 patterns from classification). Then git rm --cached each currently-tracked file (use git rm --cached -r models/ for dirs; use git ls-files cli-tools/ | grep -v 'TOOL-LIBRARY.md$' | xargs -I{} git rm --cached {} for selective). All files preserved on disk. Verify with git status --short | head -50 + git diff --cached --stat. Commit with explicit file path staging, NOT git add -A (would stage unrelated TECH edits in flight). Creates 1 cleanup commit on main. Does NOT shrink existing pack history — solves future growth only.

Installs
1
First Seen
Jun 17, 2026
git-large-repo-pack-recovery — cryptopafi/nexusos-skills