Skip to main content

hex

Run the coding-agent CLIs you already use in bounded, resumable, journaled loops.

Install

macOS and Linux (arm64 and x86_64). On Windows, use WSL.

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/k4black/hex/releases/latest/download/hex-cli-installer.sh | sh
brew install k4black/tap/hex-cli
uv tool install hex-agents-cli   # or: pipx install hex-agents-cli
npm install -g @k4black/hex-cli
cargo binstall hex-cli           # or: cargo install hex-cli
mise use -g github:k4black/hex

Setup

Run these from the repository root:

hex init            # creates .hex/, a project config, ~/.config/hex/config.yaml
hex doctor          # checks that agent CLIs, models and checks are usable
hex skill install   # installs the /hex skill for your agents
  • hex skill install writes ~/.claude/skills/hex and ~/.agents/skills/hex. hex keeps the skill in sync with the binary.
  • Alternative: npx skills add k4black/hex.

First run

hex run critique-loop -p "fix the flaky auth test"
  • One agent implements. A different model reviews. The loop stops when the reviewer approves or a bound runs out.
  • hex run blocks. To watch from another terminal:
    • hex runs lists runs and their ids.
    • hex status <run> shows the current node, the in-flight attempt and the spend.
    • hex logs <run> --follow streams the agent output.
    • hex steer <run> "use the v2 API" guides the next attempt.
  • Ctrl-C pauses the run. hex resume <run> continues it.
  • hex list shows the presets. hex graph <preset> shows one.
  • Exit codes: 0 succeeded · 1 failed · 2 usage or config error · 3 timed out · 4 budget exhausted · 5 cancelled · 6 paused.

Supported agents

  • Codex (codex)
  • Claude Code (claude)
  • pi (pi)
  • opencode (opencode)
  • Any other CLI through a kind: command worker.

Customize

Config layers deep-merge per key: built-in, then ~/.config/hex/config.yaml, then .hex/config.yaml.

Graphs. A graph is one YAML file. A file in .hex/graphs/<name>.yaml overrides a preset of the same name. Copy a preset to start: hex graph critique-loop --format source > .hex/graphs/my-loop.yaml. Check it with hex validate my-loop.

version: 1
name: fix-until-green
entry: implement
defaults: { role: implementer }
nodes:
  implement:
    agent: { prompt: "{{prompt}}", context: continue }
    on: { done: test }
  test:
    command: { check: test }
    on: { passed: done, failed: implement }
  done:
    terminal: succeeded
accept:
  require: [test.passed]

Checks. A check says what "green" means in this project. The list is empty by default. A graph that names an undeclared check does not start.

checks:
  test: [cargo, test, --workspace]

Roles. A graph names a role. A role binds a worker, a model and an effort. By default claude implements and codex reviews, each on its CLI's default model.

roles:
  implementer: { worker: claude, model: claude-opus-5, effort: high }
  reviewer:    { worker: codex, model: gpt-6-sol }

How it works

flowchart LR
  G[Graph YAML] --> K[kernel: reduce + schedule]
  K -- effect intents --> R[runtime]
  R -- runs one agent --> W[worker: codex / claude / pi / opencode]
  W -- VERDICT line --> R
  R -- append event --> J[(journal)]
  J -- fold --> K
  • The journal is authoritative. Each state change is an append-only event. hex computes the current state from the journal. resume rebuilds a run from it after a pause or a crash.
  • Routing is deterministic. An agent with several outcomes ends its final message with VERDICT: <signal>. The signal must be in the node's may_propose list. Edges pick the next node. Routing spends no tokens.
  • Every loop is bounded. Each node has a visit bound (default 5). Each attempt has a time bound (default 30m). The run also has elapsed and output-token bounds.
  • Gates decide "done". An agent's "done" is a proposal. accept.require names the evidence a success needs, for example [test.passed] or [review.approved].
  • Two verbs execute. run starts a new run. resume continues the same run. To redo work, start a new run.
  • Four node kinds: agent, command, human, terminal.

Status: the core loop works and runs on this repo. TODO.md lists what is open.


Contributing

cargo build --workspace
cargo test --workspace
cargo clippy --workspace --all-targets
cargo fmt --all

Metadata

Release files for hex-agents-cli 0.1.2

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

Built distributions (wheels)

Table of built distributions (wheels) for hex-agents-cli 0.1.2
File Actions
hex_agents_cli-0.1.2-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for hex_agents_cli-0.1.2-py3-none-musllinux_1_2_x86_64.whl
hex_agents_cli-0.1.2-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for hex_agents_cli-0.1.2-py3-none-musllinux_1_2_aarch64.whl
hex_agents_cli-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for hex_agents_cli-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hex_agents_cli-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for hex_agents_cli-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hex_agents_cli-0.1.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for hex_agents_cli-0.1.2-py3-none-macosx_11_0_arm64.whl
hex_agents_cli-0.1.2-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for hex_agents_cli-0.1.2-py3-none-macosx_10_12_x86_64.whl

Total release size: 8.9 MB

Release files / hex_agents_cli-0.1.2-py3-none-musllinux_1_2_x86_64.whl

Download URL hex_agents_cli-0.1.2-py3-none-musllinux_1_2_x86_64.whl
Size 1.6 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4fef770a05f6ea1285bef86bb976609c651ff2be5ce652ffe99a88eb4befbd7d
BLAKE2b-256 checksum
How to use checksums
e9077f6e18d7b82275fa07ba9456ccfb601c671a3f659fa1ec9ba5702d3270ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / hex_agents_cli-0.1.2-py3-none-musllinux_1_2_aarch64.whl

Download URL hex_agents_cli-0.1.2-py3-none-musllinux_1_2_aarch64.whl
Size 1.5 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
830aa6e9d2545f540b9599eae0319691a15c12145dc9191252c5c0621cf6cbdd
BLAKE2b-256 checksum
How to use checksums
52805c46a970a111bbc243c7e7036cb152424df1f0bed81c6964bae021f8a680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / hex_agents_cli-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hex_agents_cli-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c2ba3600b8faefa777e4a841440722ac4b7f473d73afc0e93f7d24ab4fb27b1f
BLAKE2b-256 checksum
How to use checksums
afb27f282837f1f3acc9e1d514c16306ebe97fa4f4b30a661af0e853c4a4b987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / hex_agents_cli-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hex_agents_cli-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
facf01bf49f40b435aa78fa94e82d2ba74dcac68ac829a480ea22b95ef1dc8a3
BLAKE2b-256 checksum
How to use checksums
a4f15988752f472708e010956c64ad1b875301284f4804c646b405f855e23b2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / hex_agents_cli-0.1.2-py3-none-macosx_11_0_arm64.whl

Download URL hex_agents_cli-0.1.2-py3-none-macosx_11_0_arm64.whl
Size 1.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
88a64f6a783f252947aa9e30f4da867c12ffdf2c436d22226475e081ba476dfe
BLAKE2b-256 checksum
How to use checksums
ffa0b3ae96b91ddad997b0f2a3d65f1c1909bd4968d50a03c8b0e9791d3f3cbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / hex_agents_cli-0.1.2-py3-none-macosx_10_12_x86_64.whl

Download URL hex_agents_cli-0.1.2-py3-none-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c445786dd5cb0177ba72a4f992e44076bdeee198b90eface08bcb278ab1f4c5c
BLAKE2b-256 checksum
How to use checksums
87303af7a9df3ae9a5da62bcc759b616b2a45e5b4d0eb525bf096c79bc188c91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Security for hex-agents-cli 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

6 release files No provenance

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