OCR: Map
Generate a Code Review Map to help navigate large, complex changesets.
- Type
- Slash Command
- Repository
- spencermarx/open-code-review
- GitHub stars
- 369
- License
- Apache-2.0
- Repo last updated
- Jul 28, 2026
- Source file
- .ocr/commands/map.md
What OCR: Map is
OCR: Map is a slash command published in the spencermarx/open-code-review repository on GitHub, which has about 369 stars. The repository describes itself as: “AI-powered multi-agent code review. Simulates a customizable team of Engineers performing code review with built-in discourse.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
OCR: Map gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install OCR: Map
Claude Code
- Download map.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from .ocr/commands/map.md, shared under the repository's Apache-2.0 license. Read the full file on GitHub.
Usage
/ocr-map [target] [--fresh] [--requirements <path>]Arguments
- target (optional): Branch, commit, or file to map. Defaults to staged changes.
- --fresh (optional): Clear any existing map for today's session and start from scratch.
- --requirements (optional): Path to requirements document (spec, proposal, ticket).
Examples
/ocr-map # Map staged changes
/ocr-map --fresh # Clear existing map and regenerate
/ocr-map HEAD~5 # Map last 5 commits
/ocr-map feature/big-refactor # Map branch vs main
/ocr-map --requirements spec.md # Map with requirements contextWhen to Use
The map command is for extremely large changesets that would take multiple hours for a human to review. It produces a structured navigation document with:
- Section-based grouping of related changes
- Checkboxes for tracking review progress
- Flow context (upstream/downstream dependencies)
- Requirements coverage (if requirements provided)
For most changesets, /ocr-review is sufficient. Use /ocr-map when you need a navigation aid for overwhelming changes.
Steps
- Run Setup Guard (MANDATORY - validates OCR is properly configured)
- Read and execute .ocr/skills/references/setup-guard.md
- If validation fails → STOP and show error
- If validation passes → continue
- Session State Check (verify existing session state)
- Load the OCR skill from .ocr/skills/SKILL.md
- Execute the 6-phase map workflow defined in .ocr/skills/references/map-workflow.md
- Store results in .ocr/sessions/{date}-{branch}/map/runs/run-{n}/
Session State Check (Phase 0)
Before starting any map work, verify the current session state:
Step 1: Check for existing session
# Find today's session directory
ls -la .ocr/sessions/$(date +%Y-%m-%d)-* 2>/dev/nullStep 2: Check for existing map runs
# Find existing map runs
ls -la .ocr/sessions/{id}/map/runs/ 2>/dev/nullStep 3: Check current state
ocr state showStep 4: Determine action
- If --fresh flag: Delete the map directory and start from run-1
- If map exists and complete: Start new run (run-{n+1})
- If map exists but incomplete: Resume from current phase
- If no map exists: Start from run-1
CRITICAL: Required Artifacts (Must Create In Order)
> See references/map-workflow.md for the complete workflow.
You MUST create these files sequentially:
.ocr/sessions/{YYYY-MM-DD}-{branch}/
├── discovered-standards.md # Phase 1: merged project standards (shared)
├── requirements.md # Phase 1: user requirements (if provided, shared)
└── map/
└── runs/
└── run-1/ # Map run (increments on re-map)
├── topology.md # Phase 2: file categorization
├── flow-analysis.md # Phase 3: dependency tracing
├── requirements-mapping.md # Phase 4: coverage (if requirements)
└── map.md # Phase 5: final map outputState is managed via ocr state CLI commands (stored in SQLite at .ocr/data/ocr.db).
State Management Commands
Prefer the atomic, invariant-checked verbs (v2.0). finish refuses to close a map whose current run was never finalized.
> v2.0.0 retired ocr state init / transition / round-complete / map-complete / close — use the atomic verbs above. Calling a retired verb exits 2 with a pointer to its replacement.
Checkpoint Rules
- Before Phase 2 (Topology): discovered-standards.md MUST exist
- Before Phase 3 (Flow Tracing): topology.md MUST exist
- Before Phase 4 (Requirements): flow-analysis.md MUST exist
- Before Phase 5 (Synthesis): All prior artifacts MUST exist
- NEVER write map.md without completing Phases 1-4
Configuration
The map workflow reads redundancy settings from .ocr/config.yaml:
code-review-map:
agents:
flow_analysts: 2 # Default: 2 (range: 1-10)
requirements_mappers: 2 # Default: 2 (range: 1-10)If not configured, defaults are used.
Output
The final map.md contains:
- Executive Summary: Narrative hypothesis about changeset intent
- Sections: Logical groupings with checkboxes for each file
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is OCR: Map?
OCR: Map is a slash command for Claude Code and Claude Cowork from the spencermarx/open-code-review repository on GitHub. Generate a Code Review Map to help navigate large, complex changesets.
How do I install OCR: Map in Claude Code?
Download map.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use OCR: Map in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is OCR: Map safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Refinement SPARC Refinement phase specialist for iterative improvement with self-learning Subagent · spencermarx/open-code-review
- Pseudocode SPARC Pseudocode phase specialist for algorithm design with self-learning Subagent · spencermarx/open-code-review
- Pr Manager Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows Subagent · spencermarx/open-code-review
- Project Board Sync Synchronize AI swarms with GitHub Projects for visual task management, progress tracking, and team coordination Subagent · spencermarx/open-code-review
- OCR: Post Post the current OCR review to a GitHub PR. Slash Command · spencermarx/open-code-review
- OCR: Doctor Check OCR installation and verify all dependencies are available. Slash Command · spencermarx/open-code-review
- OCR: Review Run an AI-powered multi-agent code review on your changes. Slash Command · spencermarx/open-code-review
- OCR: Create Reviewer Create a new custom reviewer from a natural language description. Slash Command · spencermarx/open-code-review