# Installing HarnessLink

HarnessLink is the controller for your coding agents - it routes their model calls, gives them shared memory, banks what they do, and syncs and restores your setup. You code in omp, Claude Code, Codex, pi, and others. This page takes a fresh machine through to a working setup.

## Find the page for your task

| Task | Where |
| --- | --- |
| Install (macOS / Linux) | [Install section below](https://harnesslink.sh/docs#install) |
| Install (Windows) | [Windows section below](https://harnesslink.sh/docs#windows) |
| Connect to the cloud (first-time login) | [Connect the cloud below](https://harnesslink.sh/docs#connect-the-cloud) |
| What HarnessLink syncs | [What syncs below](https://harnesslink.sh/docs#what-syncs) |
| Set up one harness (Claude Code, Codex, omp, pi, Antigravity, Cursor) | [Harness pages](https://harnesslink.sh/harnesses) |
| Every command | [Commands below](https://harnesslink.sh/docs#commands) |
| Invite team members | [Team page](https://harnesslink.sh/team) (sign-in required) |
| Share an artefact with your team | [Agents page](https://harnesslink.sh/agents) (sign-in required) |
| Pull shared artefacts from your org | [Agents page](https://harnesslink.sh/agents) (sign-in required) |
| Policies and scoped instructions | [Policies page](https://harnesslink.sh/policies) (sign-in required) |
| Digest emails | [Settings page](https://harnesslink.sh/settings) (sign-in required) |
| Plans | [Plans and pricing](https://harnesslink.sh/pricing) |
| Self-hosting | [Contact us](https://harnesslink.sh/contact) |
| Templates and skills | [Templates](https://harnesslink.sh/templates) |
| MCP server integrations | [Integrations](https://harnesslink.sh/integrations) |

## What you need

| Requirement | Why | Auto-installed? |
| --- | --- | --- |
| **macOS, Linux or Windows** | Windows uses [install.ps1](https://harnesslink.sh/docs#windows) | - |
| **Bun ≥ 1.3.14** | Installs omp; the hnl binary itself needs nothing | yes (bun.sh) |
| A harness to code in | omp, Claude Code, Codex or pi - HarnessLink wires itself into each one it finds | omp yes (unless you skip it); others with `--with` |

Note

**Your harnesses keep their own logins.** HarnessLink needs no model credential of its own: model calls are made by your harness, through the local gateway, with the harness's own sign-in. Search by meaning over your synced memory uses embeddings that Workers AI computes inside Cloudflare, not your harness's login.

## Install

On macOS or Linux, in a terminal:

```bash
curl -fsSL https://harnesslink.sh/install.sh | bash
```

No GitHub account or token is needed: the installer downloads one signed **hnl** executable for your platform, checks its signature, and puts it in `~/.hnl/bin`. It installs **omp** (upstream oh-my-pi, a harness you code in) alongside unless told not to, and is **re-runnable** - every step checks before acting, so running it again updates rather than reinstalls.

On Windows, open PowerShell and run:

```powershell
irm https://harnesslink.sh/install.ps1 | iex
```

The installer downloads the signed release manifest and the hnl executable for your platform from this site, checks the manifest's signature and the binary's hash against it, and refuses anything it cannot verify - no git or GitHub involved. **Bun is installed automatically** via `bun.sh/install.ps1` if it is not already present. [Windows parameters and requirements](https://harnesslink.sh/docs#windows) are below.

### Options: macOS and Linux

```output
bash install.sh --help

HarnessLink installer: the controller for your coding agents (gateway, shared
memory, autobank, sync and restore for omp, Claude Code, Codex and pi).
Installs the `hnl` command.

  --dir <path>     Earlier source install to replace (default: ~/.hnl-src)
  --no-omp         Skip installing omp (a harness to code in)
  --with=<ids>     Also install the listed harnesses after omp (comma-separated)
                     Valid ids: omp claude-code codex gemini pi dsh
                     Example: --with=claude-code,codex
  --cloud          Run the onboarding even with --yes (it still needs a
                     terminal: sign-in happens in your browser)
  --yes            Assume yes for anything that modifies the system
  --help           This text

Environment:
  HNL_DIR          Earlier source install to replace (default: ~/.hnl-src)
  HNL_SITE         Base URL of the download server (default: https://harnesslink.sh)
```

Pass options through the one-liner with `bash -s --`: `curl -fsSL https://harnesslink.sh/install.sh | bash -s -- --with=claude-code,codex`.

### Windows: parameters and requirements

**Parameters.** `irm … | iex` cannot pass parameters; download the script and run it as a file instead:

```powershell
irm https://harnesslink.sh/install.ps1 -OutFile install.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Yes
```

`-DryRun` prints what it would do and changes nothing. `-NoOmp` skips omp. `-Yes` skips the onboarding and prints `hnl cloud setup` for you to run later. There is no `--with` or `--cloud` equivalent on Windows.

**Command name.** The installer creates `hnl` and removes the command names earlier releases installed, but only when they point at HarnessLink.

| Requirement | Why | Auto-installed? |
| --- | --- | --- |
| **Windows 10+** | PowerShell 5.1 built in | - |
| **Bun ≥ 1.3.14** | Installs omp; the hnl binary itself needs nothing | yes (bun.sh/install.ps1) |

### Troubleshooting: Windows

**Blocked by execution policy**

Bypass for the current shell only (no system-wide change):

```powershell
Set-ExecutionPolicy -Scope Process Bypass
irm https://harnesslink.sh/install.ps1 | iex
```

**`hnl` not recognised after install**

Bun's bin directory is not on `PATH`. For the current session:

```powershell
$env:PATH = "$env:USERPROFILE\.bun\bin;$env:PATH"
```

Add it permanently in **System Settings → Environment Variables**.

## Verify

```bash
hnl --version
hnl --smoke-test
```

The installer runs both. A version number alone does not prove a working install; the smoke test loads every command module and exercises the gateway and the MCP relay end to end. After that, plain `hnl` shows the home screen: whether the HarnessLink service is running, whether you are signed in and syncing, and what each harness is wired to.

## Connect the cloud: guided setup

On an interactive terminal the installer opens HarnessLink setup straight away: one plan screen, sign in once in your browser, and everything else turns on by itself - cloud sync, the HarnessLink service and every harness on the machine. Nothing syncs until you sign in. Run it again any time with `hnl cloud setup`; plain `hnl` runs it for you if setup has never finished. These are the steps the dashboard's [Setup page](https://harnesslink.sh/setup) ticks off live from your real sync state.

1. ### 1. Install and sign in
   The installer puts HarnessLink and omp on the machine, then opens hnl cloud setup. Sign in once and it turns on cloud sync, the HarnessLink service and, for each harness it finds, gateway routing, transcript sync, autobank, context hooks and memory tools.
   ```bash
   curl -fsSL https://harnesslink.sh/install.sh | bash
   ```
2. ### 2. Cloud sync on
   Signing in turns sync on. Plain hnl shows sync health on its home screen; this shows what has uploaded and what is waiting.
   ```bash
   hnl cloud status
   ```
3. ### 3. First sync completed
   Prompt something in any connected harness (omp, Claude Code, Codex, pi, Antigravity). It shows here after the next sync; this command syncs now.
   ```bash
   hnl cloud sync
   ```
4. ### 4. Profile pushed
   The HarnessLink service uploads this machine's profile by itself and again whenever it changes: HarnessLink's config and MCP server names, plus each harness's agents, commands, rules and skills. Never secret values. Push to refresh it now.
   ```bash
   hnl cloud push-profile
   ```
5. ### 5. Code intelligence wired
   Optional
   gortex is a separate code search tool. Once it is installed, HarnessLink wires it in as an MCP server, so your harnesses can search code across your repositories.
   ```bash
   curl -fsSL https://get.gortex.dev | sh
   ```
6. ### 6. HarnessLink skills folder in the profile
   Optional
   Skills and agents in HarnessLink's own folder (~/.hnl/agent) travel inside the profile, so a new machine can restore them. Skills hnl add installs live in the harnesses' own skill folders instead; the Claude Code, omp and pi copies travel with that harness's setup. Ticks once a profile carries at least one. The dry run lists every file the profile would carry.
   ```bash
   hnl cloud push-profile --dry-run
   ```
7. ### 7. Memories in the cloud
   Optional
   Setup turns this on: each harness's own memory files and its memory bank upload by themselves. Memories from MemPalace or ~/.hermes, if this machine has them, are imported once. Run the import again any time.
   ```bash
   hnl cloud import-memories --apply
   ```
8. ### 8. Adopt on another machine
   Optional
   On a fresh machine, restore this device's config, skills, tools and harness files. config.yml is backed up before it is replaced, harness files are only created (never overwritten), and MCP servers arrive disabled until you approve them.
   ```bash
   hnl cloud restore --device <device-id> --apply --install-tools
   ```

## What setup connects

A **harness** is the program that runs a model with tools - omp, Claude Code, Codex, pi. You code in it; HarnessLink is not one. For each harness it finds, setup turns on the features that harness supports. Every feature is a command of its own, so you can redo or undo it later. Each harness has [its own page](https://harnesslink.sh/harnesses) with what it gets and the commands for it.

| Feature | What it does | Harnesses | Command |
| --- | --- | --- | --- |
| **Gateway routing** | Model calls go through a local gateway on `127.0.0.1:4747`: cached on exact repeats, usage recorded. Your harness keeps its own login. | Claude Code, Codex, omp, pi | `hnl gateway connect [id]` |
| **Transcript sync** | Session transcripts, prompt history and the harness's own memory files (`CLAUDE.md`, `AGENTS.md`, `memories/` …) upload to your account. | Claude Code, Codex, omp, pi, Antigravity, Cursor (`~/.cursor/sessions` and `~/.cursorrules` only) | `hnl cloud harnesses enable <id>` |
| **Autobank** | Every finished turn becomes a Markdown memory bank entry, starting with the last 30 days; todo and plan snapshots too. Runs in the HarnessLink service. | omp, pi, Claude Code, Codex, Antigravity (one entry per conversation). Not Cursor. | `hnl cloud autobank enable <id>` |
| **Context hooks** | A project brief at session start and matching memories on each prompt, read from local files. | Claude Code, Codex, omp | `hnl harness context [id]` |
| **Memory tools (MCP)** | The model can search, read and record HarnessLink memory itself. | omp, Claude Code, Codex | `hnl mcp register --harness=<id> --yes` |

All of this runs in the **HarnessLink service**, a background process that setup installs as a LaunchAgent (macOS), a `systemd --user` unit (Linux) or a logon task (Windows). It hosts the gateway, the MCP hub (one per machine: each MCP server you configure in HarnessLink starts once and is shared by up to 64 sessions), a watchdog that caps the service's child processes and memory, and cloud sync. Check it with `hnl gateway status`, or just run `hnl`. When the service is down, harnesses routed through the gateway get "connection refused".

Policies you set on the dashboard are enforced before a tool runs in Claude Code, Codex and omp: tool and command rules, with their folder and model conditions. "Ask first" rules ask in Claude Code and omp and block in Codex, and standing instructions are added at the start of each session in all three. Policies are not enforced in pi, Cursor or Antigravity. Changes reach your machines within about a minute.

## What HarnessLink syncs

Sync is on whenever you are signed in. It has six categories, all on by default. Turn one off with `hnl cloud sync --disable <category>` and back on with `--enable`; `hnl cloud status` shows each one.

- **Prompt history** (`history`) - the prompts you type in every harness with capture on (Claude Code, Codex, omp, pi, Antigravity), each tagged with its harness. Not responses.
- **Session transcripts** (`sessions`) - full transcripts from every harness with capture on, except Antigravity.
- **Memories** (`memories`) - HarnessLink's memory tree under `~/.hnl/agent/memories` (bank entries from every harness with autobank on, `MAIN.md`, daily summaries, `state/` snapshots) and each captured harness's own memory files. Their text, except `MAIN.md` and daily summaries, is embedded by Workers AI inside Cloudflare so memory search can match by meaning as well as by keyword.
- **Old agent usage** (`usage`) - tokens and cost recorded by HarnessLink's old built-in agent. Nothing new is recorded; existing records still upload.
- **Gateway usage** (`gatewayUsage`) - tokens and cost of every model call through the gateway.
- **Device profile** (`profile`) - this machine's HarnessLink config and MCP server entries (secret values reduced to their names), plus the setup of each installed harness: Claude Code, Codex, omp and pi agents, commands, rules, prompts, skills and `CLAUDE.md` / `AGENTS.md` (Markdown only; their config files by key name only).

Everything is redacted on your machine before upload. On a new machine, `hnl cloud restore --apply` writes the profile back; every restored MCP server stays disabled until you approve it.

Data from HarnessLink's old built-in agent (its history, sessions and memories) is still read for restore, resume and upload. Nothing new of that kind is produced.

Note

Data is partitioned per organisation and user - other members can never read your history or memory. See [Plans and pricing](https://harnesslink.sh/pricing) for storage limits per tier. Organisations on the Team or Enterprise plan can also share selected artefacts with the whole org via the [Agents page](https://harnesslink.sh/agents).

## Commands

Every command takes `--help`. The commands below are the whole of `hnl`; coding happens in your harness.

| Command | What it does |
| --- | --- |
| `hnl` | No arguments. Runs setup when this machine is not signed in. After that, a home screen: service state and version, sign-in, sync health, autobank per harness, what each harness is wired to (gateway, transcripts, autobank, context, memory tools) and the one next action. Without a terminal it prints the same as plain text. |
| `hnl cleanup` | Remove the git worktrees the old built-in agent left in ~/.hnl/wt. Shows the size and asks first; worktrees with uncommitted changes are listed and never deleted without saying so. |
| `hnl cloud <action>` | Sign-in, sync and memory: setup, status, sync, recall, brief, push-profile, restore, pull-sessions, pull-memories, pull-history and more (hnl cloud --help lists all). |
| `hnl completions` | Print a shell completion script (bash, zsh or fish). |
| `hnl config` | Shortcut for cloud status: review authentication, sync health, active profile, and connected harnesses. |
| `hnl context-hook` | The entry point harness hooks call: a project brief at session start and matching memories per prompt. You do not run it by hand. |
| `hnl daemon` | Run or manage the HarnessLink service (gateway, MCP hub, watchdog, cloud sync, harness capture). |
| `hnl gateway` | The local model gateway: status, connect and disconnect harnesses, and the background service. |
| `hnl harness` | List, install and wire harnesses: capture, memory tools, context hooks. |
| `hnl install` | Shortcut for harness install: guided setup to install and configure coding harnesses (omp, Claude Code, Codex, pi). |
| `hnl kb (alias hnl knowledge)` | The Cloudflare knowledge base: ingest, search, status. |
| `hnl mcp` | Connect a harness to the HarnessLink MCP hub, print its client config, or register it in harness configs. |
| `hnl registry (alias hnl add)` | Install a registry item. Skills go into each harness's own skills folder (Claude Code, Codex, omp, pi, Antigravity, Cursor) for every harness on this machine; agents and extensions are omp only. hnl add --list shows what is installed; hnl remove <name> removes only what HarnessLink installed. |
| `hnl resume` | Pick a session from any harness on this machine and resume it natively, or seed a fresh one from memory. |
| `hnl run` | Hand a task to another harness (Claude Code, Codex, omp, pi, Antigravity): run it headless with its default permissions, stream its output and bank the turn. |
| `hnl sessions` | List or search sessions from every harness on this machine (read-only). |
| `hnl setup` | Shortcut for cloud setup: interactive terminal wizard to authenticate and connect your machine. |
| `hnl status` | Shortcut for gateway status: inspect the local model gateway, port bindings, and background daemon status. |
| `hnl tasks` | Decompose complex instructions into five execution phases and manage the session's work-state tasks. |
| `hnl update` | Update HarnessLink and each installed harness through its own updater. |

| Root flag | What it does |
| --- | --- |
| `hnl --help` | List the commands. |
| `hnl --version` | Print the HarnessLink version. |
| `hnl --smoke-test` | Load every command module and exercise the gateway and the MCP relay end to end. |
| `hnl --profile <name>` | Run against a named profile instead of the default. |

### Removed commands

These belonged to HarnessLink's old built-in agent. Each now prints one line - use omp (or your harness) for that - and exits with status 2. So does any other first argument that starts with `-`, such as `-p` or `--model`.

`launch`, `acp`, `auth-broker`, `auth-gateway`, `agents`, `bench`, `browser-relay`, `cleanse`, `commit`, `compress`, `dry-balance`, `eval`, `factory`, `gallery`, `gc`, `grep`, `grievances`, `integrate`, `join`, `marketplace`, `models`, `plugin`, `provider`, `q`, `read`, `say`, `search`, `share`, `shell`, `ssh`, `stats`, `ste`, `tiny-models`, `token`, `ttsr`, `usage`, `worktree`, `wt`.

## Updating

```bash
hnl update
```

Opens a picker over every harness on the machine - omp first, hnl itself, then Claude Code, Codex and others that are installed - and runs each one's own updater. hnl updates itself directly: it downloads the signed release manifest, verifies it, downloads the binary for this machine, verifies it against the manifest, smoke-tests it and swaps it in. An install from before the binary moves onto it with its next update.

If an older HarnessLink ran its built-in agent on this machine, its git worktrees may still sit in `~/.hnl/wt`. `hnl cleanup` removes them with your consent - the update and the home screen offer it too.

## Uninstalling

Warning

Undo the wiring first: deleting `hnl` while harnesses still point at its gateway leaves them failing with "connection refused".

```bash
hnl gateway disconnect          # put back each harness's own provider settings
hnl harness context --remove    # remove HarnessLink's context hooks
hnl gateway service uninstall   # stop and remove the background service
```

Remove HarnessLink's MCP entry from each harness: `claude mcp remove --scope user hnl`; the `[mcp_servers.hnl]` block in `~/.codex/config.toml`; `mcpServers.hnl` in `~/.omp/agent/mcp.json` and `~/.cursor/mcp.json`. Then delete HarnessLink:

Warning

`rm -rf ~/.hnl` also deletes local history, memory and sessions.

```bash
rm -f ~/.bun/bin/hnl
rm -rf ~/.hnl/bin
rm -rf ~/.hnl          # also deletes local history, memory and sessions
```

omp, pi, Claude Code, Codex and other harnesses stay installed - they are separate programs. `~/.bun/bin/pi` is the pi harness, not part of HarnessLink.

## Troubleshooting

**`hnl: command not found`**

`~/.bun/bin` is not on your `PATH`. Add it and open a new shell:

```bash
export PATH="$HOME/.bun/bin:$PATH"
```

**A harness fails with "connection refused"**

It is routed through the gateway and the HarnessLink service is not running. Check, then restart it:

```bash
hnl gateway status
hnl gateway service restart
```

**hnl shows you signed out, or another machine's setup**

Check which config directory is in use. `HNL_CONFIG_DIR` accepts either a relative name (resolved under `$HOME`) or an absolute path (used as the full config root). Setting it to a relative name such as `cfg` resolves to `$HOME/cfg`; setting it to an absolute path such as `HNL_CONFIG_DIR=/tmp/cfg` uses `/tmp/cfg` directly. To switch profiles, use an absolute path or set `HOME`.

```bash
echo "$HNL_CONFIG_DIR"    # empty means the default ~/.hnl
```

## Guides

Everything above in depth, and the rest of HarnessLink, one guide per subject:

- [Install guide](https://harnesslink.sh/docs/install): The full HarnessLink install guide: requirements, Windows, install options, verifying, the first-run onboarding, updating, troubleshooting and uninstalling.
- [Using HarnessLink](https://harnesslink.sh/docs/usage): Using HarnessLink day to day: Query, history, policies, shared memory, resuming sessions across harnesses, profile sync, templates, delegation, runs and cost.
- [Memory Banking](https://harnesslink.sh/docs/memory-banking): How HarnessLink turns each finished turn in omp, Claude Code, Codex, pi and Antigravity into a Markdown memory entry, when banking runs, and what reads it.
- [Memory benchmark](https://harnesslink.sh/docs/memory-benchmark): How HarnessLink measures memory search: 432 synthetic coding turns, 216 questions, the metrics, how to rerun it, and the recorded keyword-only baseline.
- [What each harness sends](https://harnesslink.sh/docs/multi-harness): What HarnessLink captures from omp, Claude Code, Codex, pi, Antigravity and Cursor after setup, and how it stays a controller rather than a harness.
- [Organisation visibility](https://harnesslink.sh/docs/organisation-visibility): What owners and admins of a HarnessLink Team or Enterprise organisation can see about you, the owner-only switches (all off by default) and team memory.
- [Query syntax](https://harnesslink.sh/docs/query-syntax): The HarnessLink query language: words, phrases, fields, wildcards, regex, number and date ranges, AND/OR/NOT, in: and has:, for Query, History, Memory and Runs.
- [How we measured](https://harnesslink.sh/docs/measurements): Every figure on harnesslink.sh, how we measured it and its limits: folding logs, the code map, tool pruning, the response cache, keep-warm and memory search.
