Skip to content
live DUAL-AGENT INFRASTRUCTURE / agent-harness

agent-harness · Dual-agent continuity layer

Claude Code and Codex reuse a set of project contracts, memory, skill source code and relay status, while retaining their respective native entrances, tool events and permission semantics. It solves the problem of information exchange and does not undertake the management of project panel and Project HEAD.

belong to the system Support projects · Dual-Agent Infrastructure · Upstream connects Claude Code and Codex native entrance, and downstream serves multiple projects and AI Project Harness Provide cross-Agent collaboration capabilities · The two share part of the infrastructure, but the product boundaries are independent (see Engineering chain)·Latest verification: 2026-09

01 / Position in the system

Why this layer exists

Multiple projects will switch between Claude Code and Codex: one end is suitable for long context and top-level design, and the other end is suitable for code, testing, batch processing and local tools. If rules, skills, and engineering memories are each stored in one copy, differences in capabilities and factual drift will quickly appear.

Core architectural decision: dual agents coexist but do not pretend to be the same runtime. Both ends share the vault truth source and project directory, which are entered through CLAUDE.md / AGENTS.md and the local adapter respectively; what is shared is the contract, memory, skill source code and relay status, and each still uses native tools and permission models.

02/File structure

Directory structure + dual-engine coexistence layout

E:\iva-vault\shared\ ← Long-term source of truth for Claude Code + Codex
├── contracts\IVA.md ← Global red lines and engineering rules
├── contracts\CODEX_PARITY.md ← Capabilities and adaptation boundaries at both ends
├── hooks\ ← Hermes incremental review and routing trust check
├── memory\ ← Routable structured memory
│ ├── MEMORY.md ← Thin navigation portal
│ ├── _FULL_INDEX.md ← Full disk routing index
│ └── _topics\<cluster>\ ← Topic bucketing
├── skills-src\ ← Share skill source code
└── commands\ ← Claude command truth source

E:\RAG\Knowledge Base\ ← External data and special research, layered with internal engineering memory

Claude Code native entrance
├── ~/.claude/CLAUDE.md ← Global Contract Entry
├── project/CLAUDE.md ← Project and sub-project routing
└── ~/.claude/skills/ ← Claude entry for shared skills

Codex native entrance
├── ~/.codex/AGENTS.md ← Global fallback + vault routing
├── project/AGENTS.md ← Project and sub-project routing
├── ~/.agents/skills/<name> ← Junction pointing to shared/skills-src
└── prompt router ← Inject up to 3 related memory paths in each round

What is shared is a long-term source of truth, not a forced copy of a running shell. Claude and Codex use CLAUDE.md / AGENTS.md and their respective native tools respectively. The adaptation layer is only responsible for routing, indexing and product differences; only one copy of the rule text, memory and skill source code is maintained.

03 / Four project closed loops

The context will be exhausted and the project cannot be restarted

This layer is not a skill list, but a continuity mechanism built around four types of real failures:

AChange sessions without losing tasks

BreakAndMemory + ImBack solidifies the taskbar, environment fingerprints, key files and excluded routes into snapshots; when restoring a new session, it first performs environment control and drift detection. If the fingerprints are inconsistent, mark STALE, and it is forbidden to directly regard "completed" in the old snapshot as the current fact.

BAutomatic compression does not rewrite the target

CompactAnchor curates goals, authorization boundaries, rejection routes and real stuck points before compression; automatic compression without warning generates mechanical anchors from hooks. A canary back-injection block must appear after compression. If it is missing, the link will be interrupted, and further advancement based on the summary alone is not allowed.

CCorrection can reflow, but cannot contaminate

Hermes Incremental Hook continuously consumes session signals according to the successful cursor, giving priority to updating existing memory, rebuilding the index and running retrieval regression; the cursor will be advanced only if the complete submission is successful. When the source continues to grow during processing, new tails are added and left for the next round to avoid missing reading or mistakenly recording unaccepted content as long-term facts.

DDo not mix sources of internal and external knowledge

Shared memory holds verified engineering facts and user corrections, and Obsidian RAG holds external data and topical research. Internal memory is injected according to tasks through the Top-3 route-card, and external knowledge is retrieved on demand; the two layers each retain the source, update and acceptance boundaries, and do not directly upgrade the web page summary to the engineering truth.

The four closed loops share the same principle: any automation must leave a verifiable disk placement status, any recovery must first confirm the current environment, and any long-term memory must go through retrieval, regression and submission access control.

04 / Current state

Where have you done it now?

state live — Claude Code and Codex already share vault truth sources, task relays, and hierarchical memory routing across multiple projects.

ADual engine native entrance

Claude Code and Codex CLI share the project directory and vault truth source, which are entered through CLAUDE.md / AGENTS.md respectively. Share rule text, retain respective tool events and permission semantics, and do not duplicate two sets of long-term documents that will drift.

BInject memory by task

Structured memory is bucketed by topic and routed by full indexing. Only up to 3 related route-cards are returned in each round, and specific articles are read as needed; the entire knowledge base is not resident in the context, and no bounded full-text search is relied on to try its luck.

CRelay and drift detection

Task snapshots record goals, progress, file pointers, and environment fingerprints; during recovery, the current status is compared item by item. CompactAnchor handles same-session compression, BreakAndMemory / ImBack handles cross-window relay, and the two links have a clear division of labor.

Dcurrent verification

The current item-by-item compatibility status of contracts, skills, hooks, memory, commands, plugins and MCP is maintained by CODEX_PARITY.md; the Codex side only enables adapted and real-machine verified entries, without using quantity alignment to cover up tool semantic differences.

05 / Next milestone

What to push next

ACross-end parity automatic audit

Continuously put contract routing, skill visibility, hook trust and memory retrieval boundaries into one-click acceptance to prevent silent drift after either end is upgraded.

BRetrieval regression and boundary verification

Maintain a fixed query set, and check whether relevant inputs can hit, whether irrelevant inputs remain silent, and whether the routing results fall at the correct level; rerun after each index, hook, or descriptor change to prevent silent recall degradation.

System/Module