> ## Documentation Index
> Fetch the complete documentation index at: https://auto-sop.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> Global options, project targeting, and how auto-sop integrates with Claude Code

# CLI Overview

## How auto-sop Works

auto-sop is a **Claude Code plugin** powered by hooks. It installs `PreToolUse`, `PostToolUse`, and `Stop` hooks that silently capture every Claude Code interaction. The learner runs automatically during your session (every 10 turns) and once daily via a background sweep to detect patterns and write directives to your `CLAUDE.md`.

All commands are **project-scoped** — they operate on the current working directory by default. Use `--project <path>` to target a different project.

## Usage

```bash theme={null}
auto-sop [options] [command]
```

## Global Options

| Option          | Description                             |
| --------------- | --------------------------------------- |
| `-V, --version` | Output the version number               |
| `--json`        | Emit stable JSON output (for scripting) |
| `-h, --help`    | Display help for any command            |

## Project Targeting

Most commands accept `--project <path>` to operate on a specific project directory instead of the current working directory:

```bash theme={null}
# Status of the current project
auto-sop status

# Status of a different project
auto-sop status --project ~/projects/my-app
```

## All Commands

| Command      | Description                                                     |
| ------------ | --------------------------------------------------------------- |
| `install`    | Install hooks, learner scheduler, and managed CLAUDE.md section |
| `uninstall`  | Remove hooks, learner scheduler, and managed section            |
| `migrate`    | Migrate from old `claude-sop` package name                      |
| `learn-now`  | Run the learner immediately                                     |
| `recap`      | Show learner recap log entries                                  |
| `candidates` | Manage LLM pattern candidates                                   |
| `status`     | Show project install status                                     |
| `doctor`     | Run install health checks                                       |
| `recent`     | Show recent Claude activity                                     |
| `show`       | Show full turn or session details                               |
| `stats`      | Show directive-fire metrics                                     |
| `errors`     | Show recent errors from errors.jsonl                            |
| `revert`     | Restore CLAUDE.md from backup                                   |
| `repair`     | Fix managed-section drift                                       |
| `purge`      | Wipe captures without removing hooks                            |
| `pause`      | Temporarily disable capture + learner                           |
| `resume`     | Re-enable capture + learner                                     |
| `statusline` | Print sop status for terminal prompt                            |

## Self-Update

auto-sop keeps itself current automatically. The learner checks the npm registry for a newer version during each run and, if one is found, downloads and installs it in the background. No manual `npm install` is needed after your initial setup.

Run `auto-sop status` to see your current version and whether an update is pending.

## JSON Output

Pass `--json` to any command for machine-readable output:

```bash theme={null}
auto-sop status --json
```

```json theme={null}
{
  "installed": true,
  "hooks": "ok",
  "scheduler": "ok",
  "managedSection": "ok",
  "paused": false
}
```

<Tip>
  Combine `--json` with tools like `jq` to script auto-sop into CI pipelines or custom dashboards.
</Tip>
