Self-evolving agents: why Hermes got it right
Table of Contents
Most AI agents improve nicely for exactly one conversation, then the trouble starts…
You steer the agent, it adjusts, and for a while everything feels smarter. Then you start fresh and the same problem walks back in wearing a fake moustache.
I’ve been experimenting with Hermes Agent, and the self-improving part is real, but not in the marketing sense. No mystical agent-learning framework. No claim that the model rewired its brain while I was making coffee.
So I went looking for the magic in the code, and found it in two pieces.
1. Skill maintenance is in the prompt
Hermes writes the instruction straight into the agent prompt.
In agent/prompt_builder.py, the SKILLS_GUIDANCE block tells the agent to create a skill after complex work, a tricky error, or a non-trivial workflow. When a skill is outdated, incomplete, or wrong, the agent patches it immediately with skill_manage(action='patch') — more on that in section 2.
That last part matters.
Before doing the thing, Hermes also checks its skills, and that instruction lives in the generated prompt too: agent/prompt_builder.py#L1491-L1498. Strip the ceremony and it reads like this:
Load the relevant skill
Use it during the task
If the skill is stale, incomplete, or wrong:
Patch the skill
Verify the real path still works
Unglamorous, but that’s the point.
Most agent workflows still depend on whatever happens in the current conversation. That holds right up until the context gets polluted, truncated, or just weird. I wrote about that already with Rovo Dev, where an earlier instruction kept poisoning future attempts: My Inception moment with an AI Agent.
Hermes puts the procedural knowledge in skills, not only in the chat. So when the agent starts a task, it reads the relevant skill first. And if the skill is wrong, fixing it is part of finishing the job.
2. Skill management is a real tool
Hermes hands the agent a tool call that lets it edit its own skills.
The skill_manage tool description carries explicit triggers. Create a skill when a complex task succeeds, an error gets solved, or a non-trivial workflow appears. Update a skill when instructions go stale, OS-specific failures show up, or steps and pitfalls are missing. The trigger text lives in tools/skill_manager_tool.py#L1116-L1121.
Put it simply: use skill → hit reality → patch skill → next run starts sharper
The agent patches its own skills when it hits a gap, a stale command, or a missing edge case. It sharpens the axe while doing the work, and I don’t have to ask.
It’s the same shape as the local MCPs I’ve built before — like an MCP that gives the agent a private journal or one that assesses my own prompts — a small tool call, wired to explicit triggers, that changes what the agent does next.

Takeaway
The patterns I’d copy:
- Don’t make the chat remember everything. Put recurring workflows in durable skills, versioned and evolving.
- Make the agent check its skills before it starts working.
- Give it a way to edit reality: a specific tool with specific triggers.
- Create a skill after a tricky workflow.
- Patch a skill when a command goes stale. Merge or delete skills when they turn to junk.
Scale that pattern across a whole crew and you get something like Claude Code’s Agent Teams — multiple agents keeping each other honest instead of one agent alone.
Test it yourself
The pattern fits in a few lines. Append this to your CLAUDE.md:
Before replying, scan available skills. If a skill matches or is even partially relevant to your task, you MUST load it and follow its instructions.
If a skill has issues, fix it. After difficult/iterative tasks, offer to save as a skill. If a skill you loaded was missing steps, had wrong commands, or needed pitfalls you discovered, update it before finishing.
When using a skill and finding it outdated, incomplete, or wrong, patch it immediately, don't wait to be asked. Skills that aren't maintained become liabilities.Not magic. Just the entry level of harness engineering.