HarnessLink for Codex
What HarnessLink captures from Codex
| Feature | In Codex | Details |
|---|---|---|
| Prompt history | Yes | ~/.codex/history.jsonl. |
| Session transcripts | Yes | ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, uploaded moments after they change. |
| Memory bank (autobank) | Yes | Every finished turn becomes a memory entry (subagent threads are skipped). |
| Gateway routing | Yes | A top-level openai_base_url in ~/.codex/config.toml: .../codex/chatgpt/codex with a ChatGPT login, .../codex/openai with an API key. |
| Context hooks | Yes | SessionStart, UserPromptSubmit, PreToolUse and PreCompact in ~/.codex/hooks.json (no Stop). |
| Memory tools (MCP) | Yes | [mcp_servers.superpi] in ~/.codex/config.toml, running superpi with args = ["mcp", "--harness", "codex"]. |
| Org policy rules | Partly | Checked in PreToolUse. "Ask first" rules block, because Codex cannot ask from a hook. |
| Skills from templates | Yes | hnl add <skill> installs into ~/.agents/skills, which Codex reads. |
| Resume in another harness | Yes | hnl resume reopens a session with codex resume. |
Set up Codex
Install HarnessLink on macOS or Linux (Windows has its own one-liner).
curl -fsSL https://harnesslink.sh/install.sh | bashSign in once in your browser; setup then turns on what each harness on the machine supports.
hnl cloud setupOr turn the pieces on one at a time.
hnl gateway connect codex hnl cloud harnesses enable codex hnl cloud autobank enable codex hnl harness context codex hnl mcp register --harness=codex --yesTrust the new hooks once in Codex: run
/hooksthere. Codex skips hooks you have not trusted, andhnlreminds you until you do.Check what is connected: plain
hnlshows, for each harness, the gateway, transcripts, autobank, context and memory tools.hnl
How memory reaches Codex
At session start the SessionStart hook adds your organisation's policy instructions and a brief of the project, up to 7,000 characters (Codex shows longer hook output only as a preview).
On each prompt the UserPromptSubmit hook adds up to 3 memory entries that share at least two distinctive words with your prompt, wherever they were banked: a decision made in Claude Code reaches Codex this way.
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.
Before Codex compacts the PreCompact hook saves a handoff entry, so a new session (/new) can pick the task up.
Limits
- Codex runs a new or changed hook only after you trust it in
/hooks. - Org policy: "ask first" rules block in Codex, and Codex's hosted web search cannot be hooked.
- There is no
Stophook for Codex, so it does not prompt for a handoff;PreCompactstill saves one. - The MCP server is registered only when the
codexcommand is on your PATH.
Guides
- Using HarnessLink: Using HarnessLink day to day: Ask, history, policies, shared memory, resuming sessions across harnesses, profile sync, templates, delegation, runs and cost.
- 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: 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
- Claude Code: Hooks, MCP memory tools, gateway and autobank
- omp: Context extension, MCP memory tools, gateway and autobank
- pi: Transcripts, autobank and gateway
- Antigravity: Transcripts and one memory entry per conversation
- Cursor: MCP memory tools, by hand; chats not captured