agent-harness-adapter-core
One agent setup, every coding agent: the library behind
agent-harness-adapter. Write instructions, skills and hooks once, or read
them from the standard places (AGENTS.md, .agents/skills,
.agents/hooks.json, .mcp.json, .agents/agents), and install them into
Claude Code, OpenAI Codex, Gemini CLI, GitHub Copilot, Cursor, Factory Droid,
Pi, OpenCode, Kilo Code, Qwen Code, Devin and any agent that reads
AGENTS.md. Shared content is written once, sources are left where agents
read them, and what the user changed is never overwritten. Hooks speak one
contract in every agent: Claude Code's.
Documentation: https://six5536.github.io/agent-harness-adapter/: the Rust guide, what each harness gets, and the hook contract.
Tools in other languages use the same library through the
agent-harness-adapter
command, or the Node and Python bindings.
Installation
Prerequisites
- Rust 1.85 or newer
Install
Usage
Implement Tool for your CLI and call install / status:
use ;
use ;
#
The hook command answers through the harness that ran it:
use ;
use ;
// mytool hook <harness> <event>
Modules
integration:Integrationand its items (Skill,Hook,McpServer,Agent,Command)harness: theHarnesscontract, the parts, their states,install/uninstall/status/installed, the same for every harnesshook: events,HookInput,Answer,emit,LoopGuard;wire, the hook contract (Claude Code's protocol);file, the hooks file;claude_names, tool calls in Claude Code's termsmanifest: an integration declared in a TOML or JSON file (Manifest,ManifestTool), as theagent-harness-adaptercommand reads it;find_config, the config.agents/agent-harness-adapter.tomlclaude,codex,factory,gemini,copilot,cursor,pi,opencode,kilo,qwen,devin,agents_md: one harness eachreport:Finding,Report, text and JSON formscli: exit codes (0 ok, 1 errors found, 2 usage or internal error), stdout, broken pipes,finishfs:read_textandwrite_atomic
Notes
- The library enables
serde_json'spreserve_orderfeature, so a merge keeps the user's key order. Cargo turns features on for the whole build: every crate usingserde_jsonbeside the library gets insertion-ordered maps. - MSRV is 1.85. Raising it is a minor release, made only when needed.
- Pre-1.0: minor versions may contain breaking changes.
Contributing
See CONTRIBUTING.md.
License
MIT. See LICENSE.