Skip to main content

Hermit keeps Claude Code or Codex as the orchestrator while a local MCP executor handles cost-aware coding work.

Project description

HermitAgent

Python tests

Run Claude Code or Codex cheaper — Hermit is an MCP executor that handles the high-token mechanical work while your orchestrator stays in charge.

┌──────────────┐
│  Claude Code │──┐
│  (planner)   │  │    ┌──────────────┐   any OpenAI-compatible   ┌───────┐
└──────────────┘  ├───▶│  HermitAgent │ ────────────────────────▶ │  LLM  │
                  │    │  (executor)  │                           └───────┘
┌──────────────┐  │    └──────────────┘
│    Codex     │──┘         ~$0 / flat-rate
│  (planner)   │
└──────────────┘

Claude Code or Codex stays the orchestrator — planning, interviewing, code review. Hermit takes the rest: file edits, test runs, commits, refactors, on a cheap local or flat-rate model via MCP. The switch is one word in a slash command: /foo/foo-hermit.

Install

npm install -g @cafitac/hermit-agent
hermit setup-claude    # Claude Code
# or
hermit setup-codex     # Codex

Requires Node.js 20+ and Python 3.11+. The npm package bootstraps a managed Python runtime under ~/.hermit/ on first run — no repo checkout needed.

To upgrade: hermit self-update

Quick start

hermit-mcp-server   # starts the gateway + MCP stdio server

Then in Claude Code:

/feature-develop-hermit <task>

Claude interviews, writes the plan, and delegates implementation to Hermit over MCP. Executor tokens never hit your orchestrator bill.

Reference skills

Four example skills ship under .claude/commands/. Fork these into your own workflow:

Command Claude does Hermit does
/feature-develop-hermit interview + plan implement + test
/code-apply-hermit read PR review apply every change
/code-polish-hermit pick what to polish lint/test loop
/code-push-hermit write PR description commit + push

See docs/hermit-variants.md to add your own.

Executor LLM

ollama (local, free):

brew install ollama && ollama pull qwen3-coder:30b

z.ai (flat-rate subscription) — add to ~/.hermit/settings.json:

{
  "providers": {
    "z.ai": {
      "base_url": "https://api.z.ai/api/coding/paas/v4",
      "api_key": "<your key>",
      "anthropic_base_url": "https://api.z.ai/api/anthropic"
    }
  }
}

Configuration

~/.hermit/settings.json (created by hermit setup-*):

{
  "gateway_url": "http://localhost:8765",
  "gateway_api_key": "hermit-mcp-…",
  "model": "glm-5.1",
  "routing": {
    "priority_models": [
      {"model": "gpt-5.4", "reasoning_effort": "medium"},
      {"model": "glm-5.1"},
      {"model": "qwen3-coder:30b"}
    ]
  }
}

Providers not configured or installed are skipped automatically. Explicit model names are strict — a missing provider returns a clear error instead of silently falling back.

Architecture

  • AgentLoop — LLM turn → tool call → result → compact on context fill
  • Gateway — FastAPI relay in front of the executor (routing, 429 failover, dashboard at :8765)
  • MCP serverrun_task / reply_task / check_task / cancel_task
  • TUI — optional React+Ink terminal UI for standalone interactive sessions (hermit)

Tests

.venv/bin/pytest tests/

Status

Early, working, MIT. No release cadence guarantees.

License

MIT — see LICENSE.

See also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cafitac_hermit_agent-0.3.18.tar.gz (451.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cafitac_hermit_agent-0.3.18-py3-none-any.whl (407.6 kB view details)

Uploaded Python 3

File details

Details for the file cafitac_hermit_agent-0.3.18.tar.gz.

File metadata

  • Download URL: cafitac_hermit_agent-0.3.18.tar.gz
  • Upload date:
  • Size: 451.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cafitac_hermit_agent-0.3.18.tar.gz
Algorithm Hash digest
SHA256 c6a42ac671324ef5c09810ab5c7daefef55dd821516f6c7c7a5fb4abd32aaaa6
MD5 c4d47b2f7b77144f5eccd1a4a6eefd86
BLAKE2b-256 78031c162b42fd559188d2580fc66c0d67fc20020c22ba023e7a1587ce8b5070

See more details on using hashes here.

File details

Details for the file cafitac_hermit_agent-0.3.18-py3-none-any.whl.

File metadata

File hashes

Hashes for cafitac_hermit_agent-0.3.18-py3-none-any.whl
Algorithm Hash digest
SHA256 fba0386056e2c453adb9f5778281609a0cb6c6a14ec6259881c299c88110aa63
MD5 aae4b57b8e6561aab0968f94b28ead54
BLAKE2b-256 3d8ef8cc9cc067f4176d5d813ce8dc90b3833411dbbf21b65f988aff8c2cafa3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page