Appearance
Context references (@-syntax)
This is one of those small features I use constantly. Type @ followed by a reference in a CLI message, and Hermes injects that content inline before sending. No "let me read the file first" round-trip, the file (or diff, or web page) is just there in the message.
Supported references
| Syntax | Injects |
|---|---|
@file:path/to/file.py | File contents |
@file:path/to/file.py:10-25 | A specific line range (1-indexed, inclusive) |
@folder:path/to/dir | Directory tree listing with file metadata |
@diff | git diff (unstaged working tree changes) |
@staged | git diff --staged |
@git:5 | Last N commits with patches (max 10) |
@url:https://example.com | Fetched web page content |
Examples
text
Review @file:src/main.py and suggest improvements
What changed? @diff
This test is failing: @file:tests/test_auth.py
and the implementation @file:src/auth.py:50-80
What does this project do? @folder:src @file:README.md
Summarize @url:https://arxiv.org/abs/2301.00001Multiple references work in one message, and trailing punctuation is stripped automatically.
Tab completion
In the interactive CLI, typing @ opens autocomplete: it lists the reference types, and @file:/@folder: complete filesystem paths with size metadata. You rarely need to type a full path.
Size limits
References are bounded so they cannot blow up your context window:
| Threshold | Value | Behavior |
|---|---|---|
| Soft limit | 25% of context length | Warning, expansion still proceeds |
| Hard limit | 50% of context length | Expansion refused, message sent unchanged |
| Folder entries | 200 files max | Excess replaced with - ... |
| Git commits | 10 max | @git:N clamped to 1-10 |
On a local model with a 64K window this matters more than on a giant cloud context, so for big files prefer a line range: @file:main.py:100-200.
Security
Some paths are always blocked from @file: to prevent leaking secrets into the prompt: SSH keys and config, shell profiles (~/.bashrc, ~/.zshrc), credential files (~/.netrc, ~/.npmrc), and $HERMES_HOME/.env. Whole directories are blocked too (~/.ssh/, ~/.aws/, ~/.gnupg/, ~/.kube/). Paths that resolve outside the workspace are rejected, and binary files are refused with a warning.
Platform availability
Context references are a CLI feature. On messaging platforms the @ syntax is passed through literally, the agent can still read files there using its read_file, search_files, and web_extract tools instead.
Compression note
Injected content counts toward context usage and, if the session is later compressed, the file content is summarized rather than kept verbatim. Inject focused excerpts, not whole large files, when you can.