> ## 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.

# Learning & Analysis

> Trigger the learner, view recap logs, and manage LLM pattern candidates

# Learning & Analysis

## learn-now

Run the learner immediately instead of waiting for the next automatic run. By default, LLM analysis is enabled (uses your Claude Max subscription at \$0 cost).

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

### Options

| Option        | Description                                     |
| ------------- | ----------------------------------------------- |
| `--dry-run`   | Show what would change without writing          |
| `--offline`   | Disable LLM mode (rule-based detectors only)    |
| `--force-llm` | Force LLM analysis even if no new turns         |
| `--recompute` | Force full metrics recomputation from all turns |
| `--limit <n>` | Limit recap entries shown                       |

### Examples

<CodeGroup>
  ```bash Run Learner Now theme={null}
  auto-sop learn-now
  ```

  ```bash Preview Without Writing theme={null}
  auto-sop learn-now --dry-run
  ```

  ```bash Rule-Based Only (No LLM) theme={null}
  auto-sop learn-now --offline
  ```

  ```bash Force Full Recomputation theme={null}
  auto-sop learn-now --recompute
  ```
</CodeGroup>

### How Learning Works

1. **Scans** captured interactions since last run
2. **Rule-based detectors** identify patterns requiring N>=3 evidence instances
3. **LLM analysis** (via `claude -p`) finds higher-level patterns across sessions
4. **Validates** candidate directives against existing ones (no duplicates)
5. **Writes** new directives to the managed section of `CLAUDE.md`

<Tip>
  Use `--dry-run` to preview what directives would be added before committing them.
</Tip>

***

## recap

Show learner recap log entries. Each entry records when the learner ran, what it found, and what directives were written.

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

### Options

| Option        | Description                                  |
| ------------- | -------------------------------------------- |
| `--limit <n>` | Show last N entries (default: 10)            |
| `--tail`      | Follow recap log for new entries             |
| `--follow`    | Alias for `--tail`                           |
| `--run`       | Run the learner now (LLM mode ON by default) |
| `--dry-run`   | Dry-run mode (requires `--run`)              |
| `--offline`   | Disable LLM mode (requires `--run`)          |

### Examples

<CodeGroup>
  ```bash View Recent Recaps theme={null}
  auto-sop recap
  ```

  ```bash Show Last 5 Entries theme={null}
  auto-sop recap --limit 5
  ```

  ```bash Follow Live theme={null}
  auto-sop recap --tail
  ```

  ```bash Run + Show Results theme={null}
  auto-sop recap --run
  ```
</CodeGroup>

<Note>
  `--run` is a convenience shortcut that combines `learn-now` with viewing the recap log. It's equivalent to running `auto-sop learn-now` followed by `auto-sop recap`.
</Note>

***

## candidates

Show, prune, or clear LLM pattern candidates. Candidates are potential directives identified by the LLM that haven't yet accumulated enough evidence to be promoted.

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

### Options

| Option             | Description                                |
| ------------------ | ------------------------------------------ |
| `--project <path>` | Project root (default: current directory)  |
| `--prune`          | Remove stale candidates older than 30 days |
| `--clear`          | Clear all candidates (fresh start)         |

### Examples

<CodeGroup>
  ```bash View Current Candidates theme={null}
  auto-sop candidates
  ```

  ```bash Prune Stale Candidates theme={null}
  auto-sop candidates --prune
  ```

  ```bash Clear All Candidates theme={null}
  auto-sop candidates --clear
  ```
</CodeGroup>

<Warning>
  `--clear` removes all candidate patterns permanently. Use this if you want the LLM to start fresh without prior hypotheses.
</Warning>
