CLI tool for reverse-engineering codebase documentation for AI agents
npm install agents-reverse-engineerReverse engineer your codebase into AI-friendly documentation.
Generate .sum files, AGENTS.md, and root docs for Claude Code, OpenCode, and any AI assistant that supports AGENTS.md.


``bash`
npx agents-reverse-engineer@latest
Interactive installer with runtime and location selection.
Works on Mac, Windows, and Linux.
_"Finally, my AI assistant actually understands my codebase structure."_
_"No more explaining the same architecture in every conversation."_
---
AI coding assistants are powerful, but they don't know your codebase. Every session starts fresh. You explain the same architecture, the same patterns, the same file locations — over and over.
agents-reverse-engineer fixes that. It generates documentation that AI assistants actually read:
- .sum files — Per-file summaries with purpose, exports, dependencies
- AGENTS.md — Per-directory overviews with file organization (standard format)
- CLAUDE.md / GEMINI.md / OPENCODE.md — Runtime-specific project entry points
The result: Your AI assistant understands your codebase from the first message.
---
Developers using AI coding assistants (Claude Code, OpenCode, Gemini CLI, or any tool supporting AGENTS.md) who want their assistant to actually understand their project structure — without manually writing documentation or repeating context every session.
---
`bash`
npx agents-reverse-engineer@latest
The interactive installer prompts you to:
1. Select runtime — Claude Code, OpenCode, Gemini CLI, or all
2. Select location — Global (~/.claude/) or local (./.claude/)
This installs:
- Commands — /are-init, /are-discover, /are-generate, /are-update, etc.
- Session hook — Auto-updates docs when session ends (Claude/Gemini)
After installation, create the configuration file in your AI assistant:
`bash`
/are-init
This creates .agents-reverse-engineer/config.yaml with default settings.
In your AI assistant:
``
/are-discover
/are-generate
The assistant creates the plan and generates all documentation.
`bashInstall for Claude Code globally
npx agents-reverse-engineer@latest --runtime claude -g
$3
`bash
npx agents-reverse-engineer@latest uninstall
`Removes:
- Command files (
/are-* commands)
- Session hooks (Claude/Gemini)
- ARE permissions from settings.json
- .agents-reverse-engineer folder (local installs only)Use
--runtime and -g/-l flags for specific targets.$3
`bash
npx agents-reverse-engineer@latest --version
`---
How It Works
$3
`bash
npx agents-reverse-engineer@latest
`Interactive installer installs commands and hooks for your chosen runtime(s).
Runtimes: Claude Code, OpenCode, Gemini CLI (or all at once)
---
$3
`
/are-init
`Creates
.agents-reverse-engineer/config.yaml with exclusion patterns and options.---
$3
`
/are-discover
`Scans your codebase (respecting
.gitignore), detects file types, and creates GENERATION-PLAN.md with all files to analyze.Uses post-order traversal — deepest directories first, so child documentation exists before parent directories are documented.
---
$3
`
/are-generate
`Your AI assistant executes the plan:
1. File Analysis — Creates
.sum file for each source file
2. Directory Docs — Creates AGENTS.md for each directory
3. Root Docs — Creates CLAUDE.md, GEMINI.md, OPENCODE.md---
$3
`
/are-update
`Only regenerates documentation for files that changed since last run.
---
Commands
| Command | Description |
| ------------------------------- | -------------------------------- |
|
are | Interactive installer (default) |
| are install | Install with prompts |
| are install --runtime