← In the News

Nous Research refactors its own coding agent with 1,393 subagents

Refactoring Hermes with 1,393 agents · Teknium, Nous Research · nousresearch.com, September 2026

Machine-readable Download Markdown

On September 2, Teknium set Hermes Agent, Nous Research's open source coding agent, on a standing cleanup goal for the project's own codebase, more than a million lines of non-test Python. The main run took about nineteen active hours, dispatched 1,393 subagents, and reached 218 running at once, three delegation levels deep. Nous merged the resulting pull request on September 4. Non-test Python fell from 1,063,826 lines to 698,363, a 34.4 percent cut, for an estimated $19,300 in model cost on the main run and about $25,000 including follow-up sessions. Teknium put the cost of doing the same work by hand at $150,000 to $1.8 million for a small team over two months to two years: "How to get $1.8M of value from $19K of tokens," as the post's own subtitle puts it.

The run was not clean. About fifty minutes in, an authentication token expired and killed the process. A separate Hermes session diagnosed the failure and prepared a handoff so the resumed run could pick the work back up. Two rounds of community review caught real regressions before merge: workers had deleted public function names with no callers inside the repository, not realizing outside plugins imported them, and an automated rewrite changed exception handling behavior at roughly 65 sites. Nous also published a benchmark testing whether the refactor actually helped: simulating 4,000 symbol lookups against both versions of the code, the average tokens returned per lookup fell from 2,218 to 993.

Why it matters: The lookup benchmark gives teams considering an agent-led refactor a concrete test beyond cost and line count. In Nous Research's test, the smaller codebase reduced average lookup context from 2,218 tokens to 993, measuring whether the result was easier for agents to navigate.