Loose Ends: A check for unused code AI wrote or forgot to remove A new open-source tool called Loose Ends, published to npm as loose-ends and requiring Node.js 20 or newer plus git, checks AI-written code changes before merge and reports whether added or touched code is still reachable from a real entry point. Loose Ends builds a Liveness Graph across TypeScript, JavaScript, Python and Java — covering imports, exports, re-exports, top-level references, dynamic imports and package dependencies — and flags two error classes, orphaned-addition and superseded, as shown in its express-api example where an agent added a v2 service, left the original behind and added an unused pagination helper, producing 2 errors and a failed check. The tool's bench/RESULTS.md reports results on public repositories, including about 700 Python and Java commits replayed through check and a sweep of 30 popular repositories, and it never deletes code without deterministic evidence and a passing verification run. Graph-powered liveness checks for AI-written code. Every change should lead somewhere. Coding agents write code fast, and they leave things behind: a helper that is never called, a UserServiceV2 sitting next to the UserService it replaced, a route that was unregistered while its handler stayed. Loose Ends checks every change before merge and reports, with evidence, whether the code it added or touched is still reachable from a real entry point. bash $ npx loose-ends check Loose Ends · check main dc9af08 → working tree 4 files changed ✖ error orphaned-addition src/lib/pagination.ts:1 File added in this change is not reachable from any entry point. Import it from live code, add it to entries , or mark it with // loose-ends-file: dormant