FinOps ยท Dead-Code Exorcist
Phantom.js โ The Ghost Hunter
Paste a GitHub repo. The Hunter flags zombie code and vampire dependencies, the Skeptic tries to disprove every flag, a sandbox verifies the build still compiles, and Phantom opens a PR with projected cloud savings.
Try ./sample-repo (when on localhost) or any public repo URL. Read-only by default.
Capabilities
AST Zombie Detection
Whole-repo, comment-aware AST reachability. The Hunter flags functions with zero static references โ not grep, so comments and substrings don't trigger false positives.
Vampire Dependency FinOps
Dead code and bloated deps map to bundle size, cold starts, and build minutes โ turned into a projected $/mo cloud-savings line item on every PR.
Multi-Agent Skeptic Verification
A second agent tries to disprove every flag via dynamic imports, barrel re-exports, string reflection, and test usage โ eliminating false positives before they ship.
Sandboxed Build Testing
Proposed removals are type-checked (tsc --noEmit) and test-run in an isolated sandbox (Docker/E2B) before approval. The agent self-corrects on compiler errors.
Continuous GitHub Haunting
A GitHub Action comments on every PR with AST evidence and bundle/compute impact before merge โ exorcisms run continuously, not just on demand.
AI Cost Observability
Track LLM token spend vs. cloud savings against FOCUS billing exports. Every scan shows ROI: did the agent save more than it cost to run?
How It Works
The Summoning
Paste a repo URL or path. Phantom fetches the tree (GitHub tarball or local disk) into an in-memory RepoSource.
The Hunt โ MCP + AST
An in-memory MCP server exposes read-only AST tools. The agent calls them to extract declarations and references โ never touching files directly.
The Trial โ Skeptic + Sandbox
The Skeptic tries to disprove each flag; a sandbox type-checks proposed removals. No PR unless the build still compiles.
The Exorcism โ Verified PR
Approved removals become a branch + PR with the FinOps delta and the full Chain-of-Thought, logged to Supabase for audit.
Reasoning and tool execution are separate. The model only sees a finite read-only tool surface.
No write/exec tool exists. Mutation only via a human-approved PR โ fully reversible.
FinOps projections reconcile against FOCUS cost-and-usage exports, not guesses.
Sandbox + Skeptic mean no removal ships unless the build still compiles.
Phantom.js โ built for the Kiroween 2026 hackathon.