Wiki · Features in depth

Context files

A rules file is the fastest way to explain your conventions to the agent — and the fastest way to ruin it. Practical, no theory.

✅ Verified 17. 10. 2026Source: official documentation →📋 Copy for your AI
📄
A rules file is the fastest way to explain to the agent how things work at your place — and the fastest way to ruin it. The agent reads it on every task. A short, concrete file works; a long one gets truncated and some rules never reach it. Where things belong matters too: how to speak goes in one file, how to work in a project in another.

Two different files, two different jobs

FileWhat it is forWhere it lives
SOUL.mdWho the agent is and how it speaks: tone, brevity, directness, what to avoid. Applies everywhere~/.hermes/SOUL.md (only there — it is looked up in the Hermes home directory alone)
AGENTS.mdHow work is done in this project: paths, commands, conventions, what is forbiddenIn the project (git root and subdirectories)

A simple rule: what should apply everywhere goes into SOUL.md; what belongs to one project goes into AGENTS.md. Put a specific project's ports and paths into SOUL.md and you will be hunting and deleting them a month later.

Which files the agent knows

FileMeaning
.hermes.md / HERMES.mdProject instructions with the highest priority
AGENTS.override.mdYour personal per-directory override — usually not committed, so you can run different rules than the shared file
AGENTS.mdProject instructions, conventions, architecture notes
CLAUDE.mdA file from another tool that Hermes also recognises
.cursorrules, .cursor/rules/*.mdcCursor IDE rules — your existing conventions apply here too
SOUL.mdThe agent's identity; always loaded, independently of the rest

Only one project file is loaded — the first found in the order .hermes.md → AGENTS.override.md → AGENTS.md → CLAUDE.md → .cursorrules. So with both AGENTS.md and CLAUDE.md side by side, AGENTS.md wins and the other is ignored. SOUL.md is always added on top as the agent's identity — that is the exception.

When the files are loaded

WhenWhat happens
At startupThe working directory is scanned (upwards to the git root). Content is read, checked for injected instructions and truncated if needed
During the sessionWhen the agent touches a file in a subdirectory, rules from that directory and up to five parents are added. Great for large projects: each part carries its own rules

That is why you do not need one giant instruction file for a whole project. The frontend has its rules, the backend its own — and the agent gets them exactly when it starts working in that directory.

Limits worth knowing

LimitValue
Maximum file lengthConfigurable; otherwise it scales with the model (floor 20,000 characters, ceiling 500,000)
Truncating an over-long fileThe head (70%) and tail (20%) are kept, with a marker in the middle
Time to read one file5 seconds. A file on a slow drive (iCloud, OneDrive, a network share) may be skipped with a warning
An empty SOUL.mdNothing at all is added — which is also a choice
# this is the marker when a file was truncated: [...truncated AGENTS.md: kept 14000+4000 of 25000 chars. Use file tools to read the full file.]

Writing a file that works

PrincipleAn example from practice
Short and concreteTen concrete rules beat five pages of description
Write down what is forbidden too"Never add a light theme, the site is dark only" — without it the agent improvises
State the commands and paths to useThe agent does not have to hunt for them and cannot mix them up
Headers and bulletsThe agent navigates the file better, and so do you
Update it when the project changesStale rules are worse than none — the agent follows them

The easiest start: have the agent walk the project and write the first version, which you then edit.

❯ Walk through this project and draft an AGENTS.md — only the essentials that must be followed: how to run tests, where things live and what must not be done.

Pitfalls from our systems

What happenedWhat to do
A long rules file was truncated and part of it vanishedThat is exactly why we keep files short. If a rule matters, put it near the top
Two rules contradicted each other (old one in AGENTS.md, new one in SOUL.md)The agent leaned towards whichever it read first. Keep rules in one place — personality in SOUL.md, work in AGENTS.md
Rules from a subdirectory overrode the main onesExpect subdirectory files to be added during the session. When they conflict, the more specific (closer) file wins
A CLAUDE.md existed and its rules never appliedOnly one project file is loaded — the highest priority one. Delete the others or merge them
A SOUL.md in the project was ignoredCorrect: identity comes only from the Hermes home directory. Project rules belong in AGENTS.md
A file on a network share was never readReading has a 5-second cap. Keep rules on local storage
We accidentally pasted foreign text into a rules file (copied web content, say)Content is scanned for injected instructions, but rely on yourself: only put what you wrote into a rules file

Our tips

TipWhy
Start with three rules and add more when it hurtsAn empty file beats a five-page one that gets truncated
Say in SOUL.md how long answers should beOne sentence saves thousands of words across every reply
"What not to do" belongs in AGENTS.mdProhibitions work better than wishes
Keep the files in git with the projectYou can see when and why a rule changed
Put personal tweaks in AGENTS.override.mdYou do not overwrite the team file and your change stays yours

Where next

← Back to the wiki