Guide
Hermes Agent + Claude Code
Hermes Agent and Claude Code aren't competitors — they cover different parts of an AI-augmented workflow. Hermes lives on Telegram/Discord and remembers users across sessions. Claude Code lives in your terminal and edits code. Here's how to wire them together so they share an Anthropic key, share MCP servers, and even call each other.
Why Pair Them?
- One Anthropic API key, two surfaces — Hermes on chat, Claude Code in the terminal.
- Same MCP servers (Linear, GitHub, Slack) accessible from both.
- Claude Code can run shell commands that drive Hermes deploys (PR comments, CI triggers).
- Hermes can ping you in chat when long-running Claude Code tasks finish.
Step 1: One Anthropic Key, Two Tools
Generate an Anthropic API key at console.anthropic.com. Set it in both places:
# For Claude Code (in shell)
export ANTHROPIC_API_KEY=sk-ant-...
# For Hermes Agent (in ~/.hermes/config.json)
{
"models": {
"providers": {
"anthropic": {
"apiKey": "sk-ant-..."
}
}
},
"agents": {
"defaults": {
"model": { "primary": "anthropic/claude-sonnet-4-6" }
}
}
}Now both tools call the same model, share quota, and show up on the same Anthropic usage dashboard.
Step 2: Share MCP Servers
Claude Code reads MCP servers from ~/.claude/mcp.json and project-level .mcp.json. Hermes Agent reads them from ~/.hermes/mcp.json. The format is the same — symlink one to the other so a single edit reaches both:
# Symlink Hermes config to Claude's
mkdir -p ~/.hermes
ln -sf ~/.claude/mcp.json ~/.hermes/mcp.json
# Both tools now see the same MCP servers
ls -la ~/.claude/mcp.json ~/.hermes/mcp.jsonAdd a server once, both Claude Code and Hermes can use it. Linear, GitHub, Slack, Notion — same set on both sides.
Step 3: Let Claude Code Drive Hermes Deploys
If you self-host Hermes on a VPS, give Claude Code an SSH shortcut and a slash command that pulls + restarts the Hermes container:
# ~/.claude/commands/redeploy-hermes.md
Pull latest Hermes container on the VPS and restart it.
```bash
ssh hermes-vps "cd ~/hermes && git pull && docker compose up -d --build"
```Now /redeploy-hermes in Claude Code restarts your Hermes bot in one keystroke.
Step 4: Have Hermes Ping You When Claude Code Finishes
Long-running Claude Code tasks (big refactors, full test suites) can write a webhook to your Hermes gateway and Hermes will DM you on Telegram when they finish:
# Claude Code hook in ~/.claude/settings.json
{
"hooks": {
"Stop": [
"curl -X POST https://hermes.example.com/notify \
-H 'Authorization: Bearer YOUR_HERMES_TOKEN' \
-d '{\"text\": \"Claude Code finished in $(pwd)\"}'"
]
}
}Hermes routes the webhook to your Telegram chat. Walk away from the terminal — you'll get a chat ping when the work is done.
Step 5: Have Claude Code Read Hermes Memory
Hermes's long-term memory store is a JSON file. Expose it as a read-only MCP server so Claude Code can quote it during pair-programming:
# ~/.claude/mcp.json
{
"mcpServers": {
"hermes-memory": {
"command": "cat",
"args": ["~/.hermes/memory/long-term.json"]
}
}
}Now Claude Code can answer “what did the customer tell Hermes about their deploy preference last week?” without you re-typing it.
Common Pitfalls
- Quota: sharing one Anthropic key means both tools consume the same usage. Set a budget alert in the Anthropic console.
- Tool name collisions: if both Claude Code and Hermes register a tool called
send_email, the MCP server's namespace prefix avoids ambiguity. Use unique names per server. - Memory leakage: Hermes's memory store can contain user PII. Don't expose it as an MCP server on a shared machine.
When to Use Each
See the side-by-side comparison at Hermes Agent vs Claude Code for which workflow each tool wins. Short version: Hermes for multi-user chat with memory, Claude Code for repo-aware code edits, both for everything in between.
Skip the Setup — Managed Hermes
If wiring Claude Code to a self-hosted Hermes container feels like too much, managed Hermes hosting on OpenClaw Launch gives you a webhook URL, an auth token, and a deploy dashboard out of the box. You still control Claude Code locally, but Hermes runs on managed infra. From $3/mo.