Hermes Agent: Lifehacks for Daily Productivity

Hermes Agent has hidden features that turn it from a chatbot into a full automation tool. Let's break down the best practices.

1. CLAUDE.md — Project Memory (Most Important!)

Create CLAUDE.md in repo root — it auto-loads into every context. Saves repeated explanations on every run.

# CLAUDE.md — example for TypeScript/React project
## Stack
- TypeScript 5.x, React 18, Vite
- Tailwind CSS, shadcn/ui
- Vitest + React Testing Library
- ESLint (flat config), Prettier

## Commands
- dev: npm run dev
- build: npm run build
- test: npm run test
- lint: npm run lint
- typecheck: npm run typecheck

## Code Rules
- Don't touch .hermes/ and .github/ folders
- Components in src/components/, hooks in src/hooks/
- Imports: absolute via @/ (tsconfig paths)
- State: useState for UI, Zustand for global
- Async: try/catch + Result pattern

## Git
- Branches: feature/*, fix/*, chore/*
- Commits: Conventional Commits (feat:, fix:, chore:)
- PR: squash merge, delete branch

Pro tip: Keep CLAUDE.md updated — the agent follows it literally.

2. Hooks — Event-Driven Automation

Hooks in .hermes/settings.json run commands on events.

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [
          {"type": "command", "command": "npm run lint -- --fix"},
          {"type": "command", "command": "npm run format"}
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {"type": "command", "command": "echo 'Running: $TOOL_INPUT'"}
        ]
      }
    ],
    "Notification": [
      {"type": "command", "command": "notify-send 'Hermes' 'Task completed'"}
    ]
  }
}

Typical use cases: auto-format on write, lint before commit, logs on error, system notifications.

3. Headless Mode — For CI/CD & Scripts

# Non-interactive run with JSON output
hermes -p "Migrate DB: add created_at to users" --output-format json

# In GitHub Actions
- name: Run Hermes
  run: |
    hermes -p "$TASK" --output-format json |
    jq -r '.result' > output.md

# In cron / scripts
hermes -p "Update deps and run tests" --output-format text

In headless mode, Hermes becomes an automation tool, not just interactive chat.

4. MCP Servers — Connect Your Data

Model Context Protocol lets you connect databases, APIs, browser, GitHub — one MCP works in Cursor, Claude Desktop, and Hermes.

# .hermes/settings.json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "$DATABASE_URL"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"]
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"]
    },
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search", "$BRAVE_API_KEY"]
    }
  }
}

Popular MCPs: mcp servers list | awesome-mcp-servers

5. Profiles — Specialization Per Task

Create profiles in .hermes/profiles/:

# .hermes/profiles/coder.json
{
  "name": "coder",
  "skills": ["git-workflow", "test-runner", "code-review", "frontend-verify", "api-conventions"],
  "model": "anthropic/claude-3.5-sonnet",
  "tools": ["bash", "read", "write", "edit", "grep", "github"]
}

# .hermes/profiles/writer.json
{
  "name": "writer",
  "skills": ["content-plan", "seo-optimization", "fact-checking"],
  "model": "openai/gpt-4o",
  "tools": ["bash", "read", "write", "web-search"]
}

# .hermes/profiles/devops.json
{
  "name": "devops",
  "skills": ["deploy-pipeline", "debug-playbook", "security-review", "cost-control"],
  "model": "anthropic/claude-3.5-sonnet",
  "tools": ["bash", "read", "write", "docker", "kubernetes"]
}

Switch: /profile coder in chat or hermes --profile coder in CLI.

6. Slash Commands — Reusable Prompt Templates

Files in .hermes/commands/ are parameterized templates.

# .hermes/commands/deploy.md
---
name: deploy
description: "Deploy to production with checks"
---
1. Run full test suite: npm run test
2. Build: npm run build
3. Check bundle size: npm run analyze
4. Deploy: npm run deploy
5. Verify health endpoint

---
# .hermes/commands/refactor.md
---
name: refactor
description: "Refactor code with safety checks"
args: ["target_file", "goal"]
---
Refactor $ARG_TARGET_FILE to $ARG_GOAL.
Steps:
1. Read file and understand context
2. Write tests if missing
3. Refactor incrementally
4. Run tests after each step
5. Update documentation

Usage: /deploy or /refactor src/api/users.ts "extract service layer"

7. Permission Modes — Trust Configuration

# Modes (switch in UI or flags)
# default — asks confirmation for dangerous ops
# auto-accept — auto-agrees (for trusted repos)
# plan-only — shows plan only, doesn't execute

# In settings.json
{
  "permissions": {
    "default": "default",
    "allow": ["Read", "Grep", "Glob"],
    "deny": ["Bash(rm -rf*)", "Bash(sudo*)"]
  }
}

8. Useful Aliases & Config

# ~/.bashrc or ~/.zshrc
alias hm='hermes'
alias hmp='hermes -p'
alias hma='hermes -a'

# Export vars for MCP
source ~/.env.mcp  # DATABASE_URL, BRAVE_API_KEY, GITHUB_TOKEN

9. Links & Resources

Pro User Checklist

  1. hermes auth login — authorize
  2. Create CLAUDE.md in repo
  3. Configure .hermes/settings.json (hooks, MCP)
  4. Create 2-3 profiles for your tasks
  5. Add slash-commands for routine
  6. Try headless mode in CI