Skip to main content

Hermit

Spend premium agent tokens on judgment, not on routine execution.

Hermit is a small MCP coding executor for Claude Code and Codex. Your paid host agent plans, reviews, and makes the important calls; Hermit delegates bounded repository work—reading and editing files, running commands, and tests—to a local or lower-cost executor model.

It is a cost-optimization layer for agentic coding, not another chat UI and not a replacement for Claude Code or Codex.

Claude Code or Codex: plan, review, decide
                 │ delegate a bounded task
                 ▼
Hermit: execute with a local or lower-cost model
                 │ return status and result
                 ▼
Claude Code or Codex: verify and continue

Install

Requires Node.js 20+ and Python 3.11+.

Claude Code

npm install -g @cafitac/hermit-agent
hermit install claude

Codex

npm install -g @cafitac/hermit-agent
hermit install codex

hermit install registers both hosts. Each command creates the local Hermit settings if needed, starts the local gateway when necessary, and registers this stable stdio command with the selected host:

hermit mcp-server

Restart the selected host after installation. Check the result at any time:

hermit doctor

hermit install codex writes the shared Codex MCP configuration, so the same registration is available to the Codex CLI, desktop app, and IDE extension after they restart.

Claude Desktop

Download hermit-<version>.mcpb from the matching GitHub Release and either double-click it or choose Settings → Extensions → Advanced settings → Install Extension in Claude Desktop. The extension uses the MCPB UV runtime, so it installs Hermit's matching PyPI dependency without requiring a global Python installation. It creates ~/.hermit/settings.json on first launch. It supports Claude Desktop on macOS and Windows; network access is required the first time UV resolves the Hermit package. The installation screen optionally accepts an executor model, OpenAI-compatible base URL, and API key; these values are held by Claude Desktop and applied only to Hermit's MCP process, rather than written to settings.json. Leave them blank to keep existing Hermit/Ollama settings.

Use

Ask Claude Code or Codex to delegate a scoped repository task to Hermit. The MCP server exposes four task-lifecycle tools:

  • run_task(task, cwd, model?, max_turns?)
  • check_task(task_id)
  • reply_task(task_id, message)
  • cancel_task(task_id)

run_task starts a background task. Poll with check_task; if Hermit needs input or a permission decision, reply through reply_task.

Hermit also supplies a small server instruction that recommends delegation for bounded implementation, debugging, test, and maintenance work. It is guidance, not a hidden autopilot: the host still owns the decision to delegate.

Quality and multi-agent work

run_task defaults to strategy: "single": one low-cost executor, with no quality trade-off from orchestration. For a complex refactor, migration, or security-sensitive change, the host can use strategy: "auto". Hermit then runs a read-only planner, one writing executor, and a read-only reviewer.

There are never parallel writing agents. If the reviewer does not return VERDICT: PASS, Hermit returns needs_review instead of done; the host gets the execution result and review findings together. Users can make auto their local default in ~/.hermit/settings.json:

{
  "orchestration": {
    "mode": "auto",
    "max_agents": 3,
    "allow_parallel_writes": false
  }
}

Configuration

Settings live at ~/.hermit/settings.json. The default executor routing is:

{
  "routing": {
    "priority_models": [
      {"model": "glm-5.1"},
      {"model": "qwen3-coder:30b"}
    ]
  }
}

Use Ollama for a local executor (no per-token API cost) or any provider that offers the OpenAI-compatible Chat Completions API with tool calling. Give a custom endpoint an explicit provider profile; model names never need to match a built-in prefix:

{
  "providers": {
    "budget-provider": {
      "base_url": "https://llm.example.com/v1",
      "api_key_env": "BUDGET_PROVIDER_API_KEY"
    }
  },
  "routing": {
    "priority_models": [
      {"model": "coder-small", "provider": "budget-provider"},
      {"model": "qwen3-coder:30b"}
    ]
  }
}

Codex is a supported MCP host; it is not part of the default executor fallback chain.

Architecture

Claude Code or Codex
        │ MCP over stdio
        ▼
  hermit mcp-server
        │ REST + task status
        ▼
 FastAPI gateway (:8765)
        ▼
 AgentLoop → repository tools → local/flat-rate LLM

The gateway owns background execution, cancellation, permission waits, model routing, and task state. The MCP process stays small and transports only the four public task operations.

Development

.venv/bin/python -m pytest tests/

Hermit is MIT licensed and currently in alpha.

Release files for cafitac-hermit-agent 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cafitac-hermit-agent 0.4.0
File Size Uploaded
cafitac_hermit_agent-0.4.0.tar.gz 144.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cafitac-hermit-agent 0.4.0
File Interpreter ABI Platform
cafitac_hermit_agent-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 345.3 kB

Release files / cafitac_hermit_agent-0.4.0.tar.gz

Download URL cafitac_hermit_agent-0.4.0.tar.gz
Size 144.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2b5c57514048efa1b2cb53d8d40d1b7206fa6906be26b06eecb2c7a24f6188f7
BLAKE2b-256 checksum
How to use checksums
5494e1ff02146c5e401411598dd2fe228e5ca8dd5b4e746273d7bd9800460fd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / cafitac_hermit_agent-0.4.0-py3-none-any.whl

Download URL cafitac_hermit_agent-0.4.0-py3-none-any.whl
Size 200.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4d220a87b3b9869409ba866d09579eb0df026d250e355fd47e055bf54a8d1b4
BLAKE2b-256 checksum
How to use checksums
92c8ff6d41d79f314d339e8efd267c384b0fd7420a07bc0acb5ef0c16b89ede3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.4.2

2 release files

0.4.1

2 release files

This release

0.4.0 This release

2 release files

0.3.58

2 release files

0.3.57

2 release files

0.3.56

2 release files

0.3.55

2 release files

0.3.54

2 release files

0.3.53

2 release files

0.3.52

2 release files

0.3.51

2 release files

0.3.50

2 release files

0.3.49

2 release files

0.3.48

2 release files

0.3.47

2 release files

0.3.46

2 release files

0.3.45

2 release files

0.3.44

2 release files

0.3.43

2 release files

0.3.42

2 release files

0.3.41

2 release files

0.3.40

2 release files

0.3.39

2 release files

0.3.38

2 release files

0.3.37

2 release files

0.3.36

2 release files

0.3.35

2 release files

0.3.34

2 release files

0.3.33

2 release files

0.3.32

2 release files

0.3.31

2 release files

0.3.30

2 release files

0.3.29

2 release files

0.3.28

2 release files

0.3.27

2 release files

0.3.26

2 release files

0.3.25

2 release files

0.3.24

2 release files

0.3.23

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.20

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page