Shown·Hermes Agent·Software companies
Million-line codebase refactor
Hermes Agent split a million-line Python repo into 36 groups and dispatched 1,393 subagents in git worktrees to refactor it.
Non-test Python fell from 1,063,826 to 698,363 lines (34.4%), gateway/run.py from 34,847 to 5,512 lines, and functions over 300 lines from 192 to 2.
Overview
How it was set up
Hermes Agent with a /goal objective and a hermes-agent-dev skill. Workers ran in git worktrees, checked against a frozen baseline, with tool schemas and CLI help output compared to the original.
Worth knowing
Reviewers caught removed public names and altered exception handling that tests missed. Fixes took two review rounds, plus more after merge.
A prompt to start from
Set a standing goal: reduce non-test source by at least [percent]. Break up god files, unify duplicate helpers, replace long if/elif chains with dispatch tables, and keep public interfaces identical. Split the code into non-overlapping groups, assign each to a worker in its own git worktree, and require verified commits.Written by Agentic Feats from the source. Not the author's exact prompt.
Sources 1
History
- Source published
- 2026-09-15
- Added to Agentic Feats
- 2026-10-13
- Pick
- No
- Markdown copy
- /c/million-line-codebase-refactor-hermes-agent.md
More in software companies
15 featsResultSmall scoped fixes took about five minutes to test and merge versus roughly an hour by hand; the full-stack task failed and was rewritten.
ResultDevin found nearly every old term in a docs-wide rename, but the edits still needed 20+ manual commits.
ResultThe author shipped 120 models, an MCP server for Claude Desktop, and 140 chaos tests with a 100% pass rate over 22 months.