Pure static analysis — no bundler, no LLM, no config. JS, TypeScript, HTML inline scripts and Python. Grouped by real dependencies, ordered so nothing runs too early, with a drop-in loader so your pages keep working.
● npm release pending — from-source instructions work today.
Built for legacy scripts and plugin-style code that bundlers can't touch.
Turn a 500KB script into focused files grouped by what actually depends on what.
Immediate references enforce ordering; deferred callbacks don't — no false cycles.
Generated app.js pulls in every file in order. Change nothing else.
IIFEs, block scoping, window.x globals, decorators and Promise executors handled correctly — in JS, TS and Python.
Hubs, duplicates, cycles and parser mode reported — plus a pre-split risk scan per file type (--check runs it alone).
Three tiny runtime deps (acorn + HTML parser; typescript optional, only for .ts). One command, honest manifest, 30-test suite.
Live terminal replay — exactly what you run.
Defaults do the right thing — flags only override.
| Before | After SplitCode |
|---|---|
460KB single app.js | 18 focused files + loader |
| Load order implicit, fragile | Computed topological order, 0 violations |
| Duplicate declarations silent | Reported in console + manifest |
| Refactoring means manual surgery | One command, reproducible |
Every read of a 460KB file costs ~115K tokens. SplitCode runs blind — one deterministic command, zero context spent — then your agent plans from a ~500-token manifest and edits one small file per task. Up to ~85% fewer tokens per edit.
Agent runs one command. Same input always gives same output — deterministic, no LLM variance, safe to run blind.
manifest.json lists files, declarations, hubs and load order — a machine-readable task plan, no code reading required.
Work file-by-file, never reorder order, rerun tests after each change. Syntax is proven; behavior is yours to verify.
You are refactoring a large file. Do NOT read it whole. 1. Run: npx splitcode app.js ./split-out (or from source: node split-js.js app.js ./split-out) 2. Read ./split-out/manifest.json — `order` is the load order, `declares` tells you what lives where, `hubNamesSuppressed` is shared state. Plan your edits from this file alone. 3. Open only the files you must change. Never reorder `order`, never rename the loader. Rerun the app's tests after every edit. 4. The manifest says "verified": "syntax-only" — that proves syntax, NOT behavior. You own the smoke test.
Prefer automatic invocation? Copy skills/splitcode/SKILL.md into your project's .claude/skills/ — or paste the prompt above into CLAUDE.md / AGENTS.md.