Adopt pair in an existing repository
Install pair next to existing code and your own AGENTS.md or CLAUDE.md without losing them, then describe the project from what is already there.
Goal: add pair to a repository that already has code and agent instruction files.
Prerequisites
- A clean git working tree
- Node.js 18+ and
pair-cliinstalled (Quickstart)
Figure: install never overwrites silently. The only two ways past the refusal are moving your file aside or telling install to skip that registry.
Steps
- Decide what happens to your agent files
pair-cli installis all-or-nothing per registry target: ifAGENTS.md,CLAUDE.md,.claude/skillsor.pair/knowledgealready exists it exits 1 withTarget '<path>' already existsand writes nothing. For your ownAGENTS.mdandCLAUDE.md(one registry, decided together): keep them, or overwrite them.
- Install
- With pair-cli, keep:
pair-cli install --skip-registries agents. The choice is saved inpair.config.jsonas"skipRegistries": ["agents"]and every laterpair-cli updatehonours it. Other targets you own are kept the same way:--skip-registries skills,github. - With pair-cli, overwrite:
mv AGENTS.md AGENTS.md.bak(andCLAUDE.md), thenpair-cli install. Usemv, notcp: a leftover original makes install refuse again. - With
/pair-assistant(optional, Claude Code): "install pair, keep my files". It checks every target, asks keep or overwrite per file, and runs themvor the--skip-registriesafter you agree.
- With pair-cli, keep:
- Wire your kept file to pair
- In your assistant: add one line to your
AGENTS.mdpointing at.pair/knowledge/and.pair/adoption/. pair never edits a kept file, so without the pointer your assistant will not find it. - With
/pair-assistant(optional, Claude Code): ask it to draft the line and show the diff.
- In your assistant: add one line to your
- Describe the project
- In your assistant:
/pair-process-bootstrapreads the codebase, config and git history and proposes the adoption files;$mode: quicktakes the defaults. The full reverse-engineering walkthrough is the Existing project tutorial. - With
/pair-assistant(optional, Claude Code): ask for "a full adoption pass"; it hands off to/pair-process-bootstrap.
- In your assistant:
Verify
pair-cli kb-validatepasses.git diff AGENTS.md CLAUDE.mdis empty when you chose keep.- A new session in your assistant describes the project from
.pair/adoption/.
Related
- Existing project tutorial
- Bootstrap: guided or quick
- Update the Knowledge Base: how to opt a kept registry back in later