# HarnessLink for Claude Code

Claude Code gets everything HarnessLink does: its transcripts and prompts are captured, every finished turn becomes a memory entry, a project brief and related memories arrive through Claude Code's own hooks, and the model can search the same memory your other harnesses write.

## What HarnessLink captures from Claude Code

| Feature | In Claude Code | Details |
| --- | --- | --- |
| Prompt history | Yes | Your prompts, read from the session transcripts. |
| Session transcripts | Yes | `~/.claude/projects/<project>/<session>.jsonl` and subagent transcripts, uploaded moments after they change. |
| Memory bank (autobank) | Yes | Every finished turn becomes a memory entry (subagents are skipped). |
| Gateway routing | Yes | `env.ANTHROPIC_BASE_URL` in `~/.claude/settings.json` points at `http://127.0.0.1:4747/claude-code/anthropic`. Claude Code keeps its own login. |
| Context hooks | Yes | `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `Stop` and `PreCompact` in `~/.claude/settings.json`. |
| Memory tools (MCP) | Yes | Added with `claude mcp add --scope user`, so it lands in the user-scope `mcpServers` of `~/.claude.json`. |
| Org policy rules | Yes | Checked in `PreToolUse` before a tool runs; "ask first" rules ask you. |
| Skills from templates | Yes | `hnl add <skill>` installs into `~/.claude/skills`. |
| Resume in another harness | Yes | `hnl resume` reopens a session with `claude --resume`. |

## Set up Claude Code

1. Install HarnessLink on macOS or Linux ([Windows](https://harnesslink.sh/docs#windows) has its own one-liner).
   ```
   curl -fsSL https://harnesslink.sh/install.sh | bash
   ```
2. Sign in once in your browser; setup then turns on what each harness on the machine supports.
   ```
   hnl cloud setup
   ```
3. Or turn the pieces on one at a time. Each is its own command, so you can redo or undo it later.
   ```
   hnl gateway connect claude-code
   hnl cloud harnesses enable claude-code
   hnl cloud autobank enable claude-code
   hnl harness context claude-code
   hnl mcp register --harness=claude-code --yes
   ```
4. Check what is connected: plain `hnl` shows, for each harness, the gateway, transcripts, autobank, context and memory tools.
   ```
   hnl
   ```

## How memory reaches Claude Code

**At session start** the `SessionStart` hook adds your organisation's policy instructions, then a brief of the project: `MAIN.md`, recent memory entries and harness memory, up to 9,500 characters (Claude Code takes at most 10,000).

**On each prompt** the `UserPromptSubmit` hook adds up to 3 memory entries that share at least two distinctive words with what you typed, from any harness that banked them.

The hooks read files on the machine only (the local memory index and `MAIN.md`); they never call the cloud, so they stay fast and work offline.

**When the model needs more** it calls the memory tools. The MCP server is the HarnessLink service's own (`superpi mcp`). Its tools include `memory_search` (search your memory across projects and machines), `memory_get` (read one entry in full), `memory_bank` (record a decision or outcome), `context_brief` (a budgeted brief of the project), `session_list` and `session_get`.

**Near the context limit** the `Stop` hook asks the model to save a handoff with `memory_bank` and to suggest `/clear`; `PreCompact` saves the handoff before Claude Code compacts.

## Limits

- The MCP server is registered only when the `claude` command is on your PATH.
- The gateway sees model calls only after `hnl gateway connect claude-code`; until then usage and model rules do not apply.

## Guides

- [Installing HarnessLink](https://harnesslink.sh/docs/install): The full HarnessLink install guide: requirements, Windows, install options, verifying, the first-run onboarding, updating, troubleshooting and uninstalling.
- [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.
- [What HarnessLink captures from each harness](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.

## Other harnesses

- [Codex](https://harnesslink.sh/harnesses/codex): Hooks, MCP memory tools, gateway and autobank
- [omp](https://harnesslink.sh/harnesses/omp): Context extension, MCP memory tools, gateway and autobank
- [pi](https://harnesslink.sh/harnesses/pi): Transcripts, autobank and gateway
- [Antigravity](https://harnesslink.sh/harnesses/antigravity): Transcripts and one memory entry per conversation
- [Cursor](https://harnesslink.sh/harnesses/cursor): MCP memory tools, by hand; chats not captured

[All harnesses](https://harnesslink.sh/harnesses) · [Install guide](https://harnesslink.sh/docs) · [Pricing](https://harnesslink.sh/pricing) · [Integrations](https://harnesslink.sh/integrations)
