split
File splitting for large files
Split large files into manageable chunks for AI processing. Respects code boundaries and produces structured output.
Features
- Split files by line count or byte size
- Respects code boundaries (functions, blocks)
- Structured JSON output with chunk metadata
- MCP server and CLI modes
Install
go install github.com/hegner123/split@latestThe Problem: Files too large for AI context windows
# A 3000-line file exceeds what an AI can process at once.
# Manually splitting risks breaking mid-function.
# You need smart boundaries, not arbitrary line cuts.Solution
$ split --cli --file large_module.go --lines 500Output
{"file":"large_module.go","total_lines":2847,"chunks":6,"parts":[{"start":1,"end":498,"lines":498},{"start":499,"end":997,"lines":499},{"start":998,"end":1495,"lines":498},{"start":1496,"end":1993,"lines":498},{"start":1994,"end":2491,"lines":498},{"start":2492,"end":2847,"lines":356}]}Comparison
| Metric | Value |
|---|---|
| Boundary awareness | Respects code blocks |
| Split modes | By lines or bytes |