When should you use it?
- Cleanup keeps losing to feature work
- Huge files and long branching slow debugging
- You have reviewers for a big pull request
Not for: Codebases without tests; Teams that cannot review a very large change
What do you need, and what do you get?
You need
- An agent with a skill encoding your coding standards
- A machine to host many workers
- Community or team reviewers
You get
- A large simplification pull request
- Smaller files and shared helpers
- New guidance for future workers
How does it work, step by step?
- Grow a skill firstLet the agent save lessons from your daily corrections so standards are written down.
- Set a standing goalGive a clear target such as a minimum line reduction and broken-up files.
- Partition the workThe coordinating agent sizes up the repo and hands each worker a separate slice with a written brief.
- Review hardHuman reviewers found deleted names that outside plugins still imported, plus altered error handling.
- Feed back lessonsAdd guidance on file size and complexity so later workers follow it.
The prompt
Our own prompt, inspired by Teknium and written to work in Custom agent. Values in lime are placeholders.
Goal: simplify [directory] without changing behavior. Targets: break files over [N] lines, unify duplicated helpers, flatten long if-else chains. Follow the rules in [skill]. Divide the work into non-overlapping groups and write an assignment per group. Do not remove any public name without checking external usage. Report line counts before and after.
Inspired by Teknium: Refactoring Hermes with 1,393 agents. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Workers each started their own language server, using gigabytes of memory.
- Splitting files raised module count and some import times.
Our take
Teknium of Nous Research asked his everyday Hermes agent to refactor Hermes itself: a standing goal plus a skill built from months of corrections carved the repo into 36 chunks and launched 1,393 subagents, up to 218 at once, over about nineteen hours. Non-test Python fell roughly a third; the main run's model bill came to about $19,300. The honest list of what reviewers caught is more useful than the headline numbers. Expect breakage at public interfaces and in error handling, and plan review around those. The real enabler was the skill grown from everyday corrections; without it the swarm would have had no taste. Start smaller: one directory, one goal, one reviewer. Cap concurrency and spend before any large run. Require tests to stay green after each chunk merges. Feed reviewer findings back into the skill so the next pass improves. Never point a swarm at production secrets. Measure behavior, not only line count.
Where the time goes back: Work estimated at months to years of engineering ran in days for a five-figure model bill.
FAQ
How did it land?
Did it fix everything?
Source and credit
Inspired by Teknium. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- Refactoring Hermes with 1,393 agents
- Creator
- Teknium
- Published on
- nousresearch.com
- Original date
- Sep 15, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Custom agent
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.