<!-- GENERATED by scripts/build-docs.mjs from the live Commander tree (src/cli/program.ts). Do not edit by hand. -->

# pai registry

> Registry maintenance: scan, migrate, stats, rebuild

## Synopsis

```
pai registry <subcommand> [options]
```

## Subcommands

| Command | Description |
|---------|-------------|
| [`pai registry scan`](#pai-registry-scan) | Walk ~/.claude/projects/ and configured scan_dirs, upsert all projects |
| [`pai registry migrate`](#pai-registry-migrate) | Import data from ~/.claude/session-registry.json |
| [`pai registry stats`](#pai-registry-stats) | Show summary statistics for the registry |
| [`pai registry rebuild`](#pai-registry-rebuild) | Erase all registry data and rebuild from the filesystem (destructive) |
| [`pai registry dedupe`](#pai-registry-dedupe) | Merge registry rows that describe the same project. |
| [`pai registry reconnect`](#pai-registry-reconnect) | Point projects back at the transcripts they lost. |
| [`pai registry lookup`](#pai-registry-lookup) | Find the project slug for a filesystem path (for use in scripts) |

### pai registry scan

Walk ~/.claude/projects/ and configured scan_dirs, upsert all projects

**Options**

| Option | Description | Default |
|--------|-------------|---------|
| `--add-dir <path>` | Add a directory to scan_dirs config |  |
| `--remove-dir <path>` | Remove a directory from scan_dirs config |  |
| `--show-dirs` | Show currently configured scan directories |  |
| `--quick` | Minimal output mode (used by hooks and daemon) |  |


### pai registry migrate

Import data from ~/.claude/session-registry.json


### pai registry stats

Show summary statistics for the registry


### pai registry rebuild

Erase all registry data and rebuild from the filesystem (destructive)


### pai registry dedupe

Merge registry rows that describe the same project.

Two spellings of one directory (e.g. via a symlinked path prefix) register
as separate projects and split session history between them. Rows are grouped
by resolved path, so a merge only happens when the paths are provably identical.
Dry-run by default; --execute backs up the registry first and merges in one transaction.

**Options**

| Option | Description | Default |
|--------|-------------|---------|
| `--execute` | Actually perform the merge (default is dry-run) |  |


### pai registry reconnect

Point projects back at the transcripts they lost.

A project's encoded_dir is written once and never updated when the project
moves, so handovers, session digests and checkpoints silently find nothing.
Repairs are read from the transcripts themselves — each records the cwd it ran
in — rather than re-derived from the naming rule that broke.
Dry-run by default; --execute writes the corrected rows in one transaction.

**Options**

| Option | Description | Default |
|--------|-------------|---------|
| `--execute` | Actually write the corrections (default is dry-run) |  |


### pai registry lookup

Find the project slug for a filesystem path (for use in scripts)

**Options**

| Option | Description | Default |
|--------|-------------|---------|
| `--path <path>` | Filesystem path to look up |  |


## See also

[`pai audit`](audit.md) · [`pai backup`](backup.md) · [`pai clear-names`](clear-names.md) · [`pai config`](config.md) · [`pai daemon`](daemon.md) · [`pai db`](db.md) · [`pai end`](end.md) · [`pai help`](help.md) · [`pai identity`](identity.md) · [`pai kg`](kg.md) · [`pai launch`](launch.md) · [`pai mcp`](mcp.md) · [`pai memory`](memory.md) · [`pai notify`](notify.md) · [`pai observation`](observation.md) · [`pai obsidian`](obsidian.md) · [`pai pause`](pause.md) · [`pai project`](project.md) · [`pai projects`](projects.md) · [`pai restore`](restore.md) · [`pai session`](session.md) · [`pai sessions`](sessions.md) · [`pai setup`](setup.md) · [`pai shell-init`](shell-init.md) · [`pai skill`](skill.md) · [`pai task`](task.md) · [`pai topic`](topic.md) · [`pai update`](update.md) · [`pai worker`](worker.md) · [`pai zettel`](zettel.md)

Run `pai help <area>` to read any of these in the terminal.

