agent-harness-adapter
One agent setup, every coding agent. Keep your instructions, skills and
hooks once, in the standard places (AGENTS.md and .agents/), and
agent-harness-adapter makes 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 use them. Hooks are written once in
Claude Code's format and run in every agent.
Tools in any language can also ship their own integration from a manifest file: the command writes it into each harness's own files, puts shared content in one place, and never overwrites what the user changed.
Install
Both install the agent-harness-adapter command. Rust tools can use the library
agent-harness-adapter-core
directly instead.
Quick start: your own setup
Already set up for Claude Code? The first install offers to move
CLAUDE.md's text, .claude/skills, Claude Code's hooks and
.claude/agents into the standard places (--migrate says yes without
asking), then points or copies them back for Claude Code. It refuses files
with uncommitted changes (--force overrides), and at user scope backs up
first.
Then keep everything in the standard places:
| What | Where | Each agent gets |
|---|---|---|
| Instructions | AGENTS.md |
read where it is; Claude Code gets @AGENTS.md in CLAUDE.md, Gemini CLI a context.fileName entry |
| Skills | .agents/skills/<name>/SKILL.md |
read where they are; copied into .claude/skills for Claude Code |
| Hooks | .agents/hooks.json (Claude Code's format) |
one entry per event that runs your hooks at hook time, in every agent |
| MCP servers | .mcp.json |
read where it is, or copied into each agent's config |
| Subagents | .agents/agents/<name>.md (Claude Code's format) |
copied into each agent's folder |
agent-harness-adapter install again (from anywhere in the repo) refreshes
the installed agents; --harness <id> adds one. agent-harness-adapter status
exits 1 when a copy is out of date, for CI.
.agents/hooks.json:
scripts/guard.sh gets Claude Code's hook input in every agent, and answers
the way Claude Code reads it, for example exit 2 with a reason on stderr to
block.
Quick start: a tool's integration
mytool.harness.toml:
= 1
= "mytool"
= { = "agent/instructions.md" }
= ["mytool"]
[[]]
= "mytool"
= "Use mytool to check the project."
= { = "agent/skill.md" }
[[]]
= "agent/skills/review" # an existing skill directory, copied as it is
[[]]
= "pre-tool"
= "shell"
= "mytool guard" # bridged: mytool speaks Claude Code's hook protocol
[[]]
= "mytool"
= "mytool"
= ["mcp"]
Commands
agent-harness-adapter install # the config, or --manifest <file>; --harness <ids|all>, --scope, --force, --migrate
agent-harness-adapter status # exit 1 when a copy is out of date
agent-harness-adapter uninstall # takes out what it wrote; your sources stay
agent-harness-adapter hook ... # what installed hooks run
agent-harness-adapter schema <manifest|hooks|hook-input|hook-answer|result>
Documentation
https://six5536.github.io/agent-harness-adapter/:
- Getting started and coming from Claude Code
- The command: every option and exit code
- The config and the manifest, key by key
- The hook contract and what each agent can do
- Harnesses: where each agent's files go
Pre-1.0, minor versions may contain breaking changes.
License
MIT. See LICENSE.