Skip to content
ryanjkellyPublic

About

Multi-agent coordination + harness adapters + portable CLI utilities for Claude Code / Cursor / Codex.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,802 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Harnery

Harnery

Multi-agent coordination for AI coding agents: Claude Code, Cursor, and Codex.

CI npm version License: MIT

⚠️ Pre-1.0. API surface is still settling. Pin a specific minor version (harnery@^0.31.0) and read the CHANGELOG before each upgrade.

What it is

harnery keeps multiple AI coding agents from stepping on each other in a shared checkout. It came out of years of running several Claude Code / Cursor / Codex sessions at once against the same monorepo.

  • Multi-agent coordination. Per-agent heartbeats in .harnery/active/, claim-time and commit-time guards, the canonical event stream, a decision docket, per-agent journals, and adapter adapters for Claude Code / Cursor / Codex.
  • Cross-machine presence. Sessions on every machine that shares a repo see each other, labeled by machine. Zero-config over the repo's own git remote (presence refs), with an optional live-socket upgrade via an end-to-end-encrypted relay: the public relay.harnery.com, or self-host with harn relay serve / the bundled Cloudflare Worker (relay/worker/). The relay sees only ciphertext in opaquely-named rooms.
  • Coordination-aware workflows. harn run <script> runs bounded, schema-gated multi-subagent workflow scripts. Plain JS stages fan out to headless adapter-CLI subagents that are born coordination-registered (heartbeats, events, claim guards), and deterministic code decides the routing between stages. An optional host-owned policy gates dispatch and declared external mutations with ALLOW, ASK, and DENY. CLI ASK requests park durably for an explicit approve/deny and same-run resume; library callers stay fail-closed by default.
  • Standalone web UI. harn web up boots a local Next.js dashboard for the coord layer, workflow runs, per-project state, and a local coding-agent status view (Claude Code / Codex / Cursor usage, backed by harn devtools). Ships with the git clone, not the npm package (see Install).
  • Backup. harn backup snapshots .harnery/ via restic.

The CLI also ships batteries: portable utility commands (tokens, eml, env, grep for parallel, ripgrep-accelerated monorepo search, plus docs, browse, fetch, read, webview, devtools, and more) and the library toolkit they're built from. Every page loader reads at human pace by default, waiting 3 to 9 seconds between loads of one site through a machine-wide ledger, with --no-pace and HARNERY_PACE=off to opt out. Useful, cross-platform, and dependency-light, but deliberately not the headline. Coordination is why harnery exists; the toolkit exists because the CLI needed it (see Public surface tiers).

Install

curl -fsSL https://harnery.com/install.sh | bash

One line, no clone: it installs the harn CLI globally (npm preferred, Bun fallback), puts it on your PATH, and verifies it. Or drive your package manager directly: npm install -g harnery / bun add -g harnery (or npm install harnery for a project dep). Then wire a project:

harn init     # creates .harnery/ + registers the adapter hooks
harn doctor   # optional: one-time runtime + dependency check

From a git clone? Cloning for the web/ dashboard or to contribute? ./scripts/setup.sh does the clone setup in one shot: installs deps, builds dist/ on a Bun-free host, runs harn init, and links the bins onto your PATH.

npm gives you the engine + CLI. The web/ dashboard and the docs/ site live in the git repo, not the npm package (which is the CLI + coord engine: bin, dist, src, schemas). To run the dashboard, git clone the repo, bun install, and harn web up from there, pointing it at your project with --coord-root <dir> (or just run it from inside the project). harn web up prints these exact steps if you invoke it without the clone present.

Native Windows source checkout

For source development on Windows, install Node.js 24.22.1+ and Bun 1.4.4+, then use PowerShell 7:

bun install --frozen-lockfile
Push-Location web
bun install --frozen-lockfile
Pop-Location
npm link --ignore-scripts --offline --package-lock=false
harn init --project-root 'C:\path\to\project' --adapter 'claude-code,codex'
harn web up --coord-root 'C:\path\to\project'

The native launchers run source through Bun and need no Bash. The dashboard binds to loopback. Codex hook commands still need the harness's separate approval before a new session can execute them.

Windows state inherits NTFS ACLs: POSIX mode bits cannot prove those access rights. File contents are still flushed before publication; Windows does not support the directory fsync used for POSIX directory-entry durability. Atomic file publication and lease ownership checks remain in place.

Uninstall

Two layers. Unwire a project (keeps .harnery/ history by default; on a terminal it asks before deleting it):

harn deinit                 # unwire the adapter hooks
harn deinit --purge-state   # also delete .harnery/ (destructive)

Remove the CLI with the hosted one-liner (npm rm -g harnery / bun remove -g harnery work too):

curl -fsSL https://harnery.com/uninstall.sh | bash

From a git clone, ./scripts/teardown.sh is the mirror of ./scripts/setup.sh: it runs harn deinit, removes the PATH symlinks, and (on a terminal) asks whether to also delete this project's .harnery/ history and the clone itself. Both default to no; pre-answer with --purge-state and --remove-clone for unattended runs.

Use as a CLI library

Project-specific CLIs compose Harnery's command tree and add their own commands on top:

// mycli/src/program.ts
import { createHarneryProgram } from 'harnery/commander';
import { deployCommand, dbCommand } from './commands';

const program = createHarneryProgram({
  binName: 'mycli',
  context: { projectName: 'my-monorepo' },
});

program.addCommand(deployCommand);
program.addCommand(dbCommand);

await program.parseAsync(process.argv);

mycli agents status then resolves to the same code as harn agents status, loaded as a library. See examples/extending-with-commander.ts for the full pattern.

Public surface tiers

The exports map draws the line between what harnery is and what it ships with:

  • Product tier (harnery, harnery/commander, harnery/core/*): the coordination layer and CLI composition. This is the API to build against, and the reason to install harnery.
  • Toolkit tier (every harnery/lib/* subpath: http, cookies, format, readability, browser, machine, …): the supporting utilities harnery's own CLI is built from, exposed for embedding hosts that want to lean on them. Supported, but secondary: it can evolve faster than the product tier, and it isn't a reason to adopt harnery on its own.

The boundary is enforced, not aspirational: CI verifies that no harnery/lib/* export imports the coordination core, directly or transitively (scripts/check-layering.ts), so pulling a toolkit module never drags in coordination state. Details: Embedding + surface tiers.

Documentation

Full docs at harnery.com:

Contributing

See CONTRIBUTING.md. Bug reports and feature requests via GitHub Issues.

License

MIT © Ryan Kelly

About

Multi-agent coordination + harness adapters + portable CLI utilities for Claude Code / Cursor / Codex.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages