context-lint
A read-only linter for the context files Hermes Agent loads into
every prompt: AGENTS.md (AGENTS.override.md, agents.md), .hermes.md / HERMES.md, CLAUDE.md, .cursorrules,
.cursor/rules/*.mdc, and SOUL.md in HERMES_HOME.
It checks the two things Hermes itself does not:
| Rule | Severity | Checks |
|---|---|---|
| CL010 | error | a line that looks like it contains a credential (API key, token, password). The file goes to the model provider on every turn and is usually committed. |
| CL020 | warning | a reference to a repository file that does not exist (stale advice after a refactor): an inline-code path such as src/app/main.ts, or a Markdown link target. |
| CL001 | info | a file that could not be read (too large, not a regular file, or blocked by Hermes' read denylist). |
What it deliberately leaves to core: Hermes' own /context command already reports each context file's size,
estimated tokens, whether it is loaded, truncated over the context-file cap, shadowed by a higher-priority type,
blocked by the injection scan or empty. context-lint does not repeat that.
Use
/context-lint # the context files of the current project (and SOUL.md)
/context-lint ./AGENTS.md # one file
/context-lint ../other-project # a folder: its context files
The agent can run the same check as the context_lint tool (path, min_severity, limit).
Precision
- Credential detection uses Hermes' own redactor (
agent.redact.redact_sensitive_text(force=True), a public plugin
API name, so it works even if redaction is turned off). Outside Hermes a small built-in pattern set is used. - Documentation placeholders are ignored:
sk-...,<your-password>,your_api_key_here,${TOKEN},example.
A long random-looking token on the same line still counts. - References are checked only in inline code and Markdown links, never in fenced code blocks, never for bare file names
in prose, never for globs, placeholders, template names (your_tool.py), URLs, absolute paths, or folders that are
normally generated (node_modules,dist,build,.venv, ...). A path counts as found if it exists relative to the
file's folder or any folder above it up to the project root, or if it is the tail of any real project file
(store/session.tsforapps/desktop/src/store/session.ts). Only a name that matches nothing is reported. - Measured on the 17
AGENTS.mdfiles in the Hermes repository (2,625 lines): no CL010 findings, and 3 CL020 findings
that were each checked by hand and are genuinely dead (tools/delegate_tool.py, referenced twice, and
references/new-skill-pr-salvage.md). Before the partial-path matching above the same files gave 8 findings, 5 of
them false.
Safety
- Read-only, and it never repeats a secret. A CL010 finding contains the file and line number only. No network, no
model calls, no subprocesses, no writes. - A path you pass is checked against Hermes' own read denylist first, and symlinks that leave the project are not followed.
Files over 1 MB are skipped.
Settings
# ~/.hermes/config.yaml
plugins:
entries:
context-lint:
settings:
min_severity: warning # info | warning | error
max_findings: 100 # 1-1000
Develop
python3 -m unittest discover -s tests -p 'test_*.py'
License
MIT © Shikhyy
README from the reviewed commit dd18d88; it updates when the author re-pins.

Shikhyy