
ai-coding-harness-kit
io.github.Mehedi-Hasan-Abir/ai-coding-harness-kit
Persistent memory for AI coding agents: SESSION.md, checklist, handoff and skills via AGENTS.md
Documentation
AI Coding Harness Kit
Build once. Remember everything. Ship consistently.
A portable toolkit for persistent AI coding context, reusable skills, project workflows, and cross-session continuity.
Works with Claude Code, Codex, Cursor, Windsurf, Antigravity, GitHub Copilot, Gemini CLI, OpenCode, and any MCP client.
npx ai-coding-harness-kit init
Why AI coding agents forget, and the fix
You spend an hour with a coding agent. It fixes the bug, finds the real cause of the failing test, and makes three decisions with you. The next morning a new session knows none of it. It repeats the same dead end, undoes yesterday's decision, and you explain the project again from scratch.
The model isn't the problem. The agent has nowhere to keep its work.
An AI coding harness is the instructions, memory and skills wrapped around the model so its work survives between sessions. This kit is one, made from four plain Markdown files that live in your repo. Every agent reads and updates them.
| File | What it holds | Updated |
|---|---|---|
AGENTS.md | How to work here: project, code map, commands, conventions, and the workflow loop | Rarely |
SESSION.md | Working memory: objective, changes, findings, failed attempts, issues, verification, next action | After every meaningful step |
CHECKLIST.md | Your deliverables or task list. Agents copy a summarized version of their own to-do list here, and an item is ticked only with evidence | Per deliverable or plan |
HANDOFF.md | A five-minute starting point for the next agent, reviewer, or you in two months | When transferring work |
The most important one is SESSION.md.
What it's for
- Resume a project after months. Open the repo and say "read SESSION.md and continue". You get the objective, the decisions, what was tried and failed, and the next step.
- Run several AI agents on one project. Claude Code writes, Codex reviews, OpenCode takes over a refactor. They all share one record, so no work is repeated and no decision is overwritten.
- Ship consistently. CHECKLIST.md only counts verified behavior, so "I created the component" doesn't pass for "the upload flow works".
- Hand off cleanly to a teammate, a reviewer, or a different tool.
- Reuse your setup on every project. Same structure, fresh state.
Quick start
All install options only add files and never overwrite your work.
npx (recommended). Adds the four files, a CLAUDE.md that imports AGENTS.md, and the skills:
npx ai-coding-harness-kit init # Claude Code + Codex + OpenCode
npx ai-coding-harness-kit init --agents=codex,opencode # pick your tools
MCP server (Cursor, Windsurf, Antigravity, VS Code, Claude, Codex, any MCP client). Gives the agent tools to read and update the harness (harness_status, harness_log, harness_set_next, harness_handoff, ...):
{ "mcpServers": { "harness": { "command": "npx", "args": ["-y", "ai-coding-harness-kit", "mcp"] } } }
Gemini CLI extension. Bundles the MCP server, the skills and the context:
gemini extensions install https://github.com/Mehedi-Hasan-Abir/ai-coding-harness-kit
Claude Code plugin. Installs the skills in every project:
/plugin marketplace add Mehedi-Hasan-Abir/ai-coding-harness-kit
/plugin install harness-kit@ai-coding-harness-kit
No Node.js. Adds only the four files and CLAUDE.md:
curl -fsSL https://raw.githubusercontent.com/Mehedi-Hasan-Abir/ai-coding-harness-kit/main/install.sh | sh
irm https://raw.githubusercontent.com/Mehedi-Hasan-Abir/ai-coding-harness-kit/main/install.ps1 | iex
Manually. Copy templates/ into your repo root.
Then ask your agent:
Use the harness-setup skill to fill in AGENTS.md for this repo.
Commit the files. They are the project's memory.
How the harness works
Every agent follows this loop in every session. It is written into AGENTS.md, so you never repeat it.
┌─ start ──────────────────────────────────────────────────────────┐
│ read SESSION.md (objective · open issues · next action) │
│ read CHECKLIST.md, and HANDOFF.md if it was refreshed │
└──────────────────────────────┬───────────────────────────────────┘
▼
┌─ work ───────────────────────────────────────────────────────────┐
│ after each meaningful change or investigation (dead ends too): │
│ add a dated SESSION.md entry: what · where · why · how checked │◀─┐
└──────────────────────────────┬───────────────────────────────────┘ │
▼ │
┌─ done means evidence ────────────────────────────────────────────┐ │
│ tick a CHECKLIST.md item only after a check proves it │──┘
│ blocked items stay visible, with the reason │
└──────────────────────────────┬───────────────────────────────────┘
▼
┌─ stop ───────────────────────────────────────────────────────────┐
│ update "Next action" · refresh HANDOFF.md if work remains │
└──────────────────────────────────────────────────────────────────┘
See a filled-in example in examples/document-mvp/: an invoice MVP built by Claude Code and Codex taking turns.
Works with Claude Code, Codex, Cursor, Windsurf, Antigravity, Copilot, Gemini CLI and OpenCode
| Tool | Reads AGENTS.md | Skills folder used by init | MCP |
|---|---|---|---|
| Claude Code | via CLAUDE.md → @AGENTS.md | .claude/skills/ or the plugin | ✓ |
| Codex | natively | .agents/skills/ | ✓ |
| Cursor | natively | .agents/skills/ | ✓ one-click |
| Windsurf | natively | .windsurf/skills/ | ✓ |
| Google Antigravity | natively | .agents/skills/ | ✓ |
| GitHub Copilot | natively | .agents/skills/ | ✓ one-click |
| Gemini CLI | via GEMINI.md → @AGENTS.md, or the extension | extension or .agents/skills/ | ✓ |
| OpenCode | natively | .agents/skills/ | ✓ |
| Cline, Kiro, Zed, JetBrains, others | most do | copy skills/ | ✓ |
npx ai-coding-harness-kit init wires up Claude Code and the .agents/skills tools by default, and adds Windsurf or Gemini when it finds their folders. --agents=all wires up everything. Per-tool setup, including every MCP config: docs/INTEGRATIONS.md.
SESSION, CHECKLIST and HANDOFF are ordinary Markdown files. Any agent that can read a file can use them.
Reusable skills
The files hold the state. The skills hold the procedures. They follow the open Agent Skills format (SKILL.md).
| Skill | Use it when |
|---|---|
harness-setup | Starting a project or adopting the harness. Fills AGENTS.md from the real repo, not from guesses |
harness-log | After a change, an investigation, or a decision. What a useful SESSION entry looks like |
harness-verify | Before saying "done". Ticks only what a check proves |
harness-handoff | Ending a session, switching agents, asking for review |
harness-resume | Coming back after a break. Rebuilds context from the files and git, finds drift, reports before acting |
Project workflows and prompts
Copy-paste prompts for each moment are in prompts/:
- MVP kickoff: one prompt that starts the build and sets up the harness
- Resume after a break, switch agents, run agents in parallel, verify before "done"
CLI
npx ai-coding-harness-kit init [dir] add the harness (safe: appends or skips, never clobbers)
--agents=claude,codex,opencode which tools to wire up (default: all)
--no-skills files only
--no-claude-md don't create or patch CLAUDE.md
--force replace harness files; old copies go to .harness/backup/
--dry-run show what would happen
npx ai-coding-harness-kit status [dir] objective, next action, open issues, latest changes, git drift
npx ai-coding-harness-kit log "<text>" dated SESSION.md entry (--kind=change|finding|issue|verification --agent=Name)
npx ai-coding-harness-kit next "<text>" set SESSION.md › Next action
npx ai-coding-harness-kit doctor [dir] missing files, template placeholders, missing sections,
commits made since SESSION.md was last updated
npx ai-coding-harness-kit archive [dir] move old SESSION.md entries to .harness/archive/,
keeping objective, open issues and next action
npx ai-coding-harness-kit mcp start the MCP server (stdio)
If you install it globally (npm i -g ai-coding-harness-kit), the short command is harness-kit. When init finds an existing AGENTS.md, it appends the workflow section and leaves the rest of your file alone. When it finds an existing CLAUDE.md, it appends one line, @AGENTS.md.
Recommended skill packs by project type
The four files are the foundation. Add other packs when the work calls for them:
| Project | Add |
|---|---|
| Small script or bug fix | Nothing. A short SESSION entry and a 3-item checklist are enough |
| Backend API or service | One workflow pack: Superpowers or Matt Pocock's skills |
| MVP with a UI | Frontend Design + Webapp Testing |
| Dataset, model, evals | Hugging Face Skills |
| MCP server | MCP Builder |
| Long investigation | Planning with Files. Decide which file owns which state, so you don't end up with two progress logs |
| Your own repeated procedure | Skill Creator |
FAQ
How do I give Claude Code memory between sessions?
Run npx ai-coding-harness-kit init. Claude Code loads CLAUDE.md, which imports AGENTS.md. That file tells the agent to read SESSION.md at the start of every session and update it as it works. Start new sessions with "read SESSION.md and continue".
Does this work for Codex and OpenCode too?
Yes. Both read AGENTS.md natively, and the skills install to .agents/skills/. The same files serve every agent, so you can switch tools in the middle of a project.
Does it work in Cursor, Windsurf and Google Antigravity?
Yes. All three read AGENTS.md natively. init puts the skills where each one looks (.agents/skills/, or .windsurf/skills/ for Windsurf), and the MCP server gives their agents tools to read and update the harness. See docs/INTEGRATIONS.md.
Is there an MCP server?
Yes: npx -y ai-coding-harness-kit mcp. It provides 7 tools (harness_status, harness_log, harness_set_next, harness_handoff, harness_init, harness_doctor, harness_archive), the skills as prompts, and the templates as resources. It has no dependencies and reads your workspace root from the client.
How do I use multiple AI coding agents on one project?
Give each agent a separate task. Every agent logs its work to SESSION.md with its name, and uses HANDOFF.md when it passes work on. See the parallel-agents prompt.
What is the difference between AGENTS.md and SESSION.md?
AGENTS.md holds durable facts: how to build, test and work in the repo. SESSION.md holds changing state: what happened, what was learned, and what comes next.
Doesn't my tool already have memory?
Built-in memory is tied to one tool, one machine, and often one user. These files live in the repo. They are versioned with git, reviewed in PRs, and readable by every agent and every human.
Should I commit the files?
Yes. Keep secrets out: name the environment variable, never its value.
SESSION.md is getting long. What now?
Run npx ai-coding-harness-kit archive. Old entries move to .harness/archive/, and the objective, open issues and next action stay.
Is this a framework?
No. It is four Markdown files, five skills and a small CLI with no dependencies. Delete it any time and you keep useful documentation.
Background
I came to this setup after years of building AI-native software and using it with frontier models every day. The full story, with the reasoning behind each file:
- 📝 The AI coding harness I reuse on every project: 4 files + skills (Towards AI)
- 🌐 AI Coding Harness: 4 Files That Give Claude Code and OpenCode Memory (mhabir.dev)
- 🧩 AI Coding Harness Kit case study (how and why it's built this way)
This repo uses the kit on itself. Its own AGENTS.md, SESSION.md and CHECKLIST.md are live examples.
If the AI Coding Harness Kit saves you a re-explanation, a ⭐ helps other developers find it. Issues and PRs are welcome. See CONTRIBUTING.md.
License
ai-coding-harness-kitnpm install ai-coding-harness-kit