# Migrating to 0.21.0

0.21.0 is a breaking release. The MCP surface is deliberately smaller, `impact` and `brief` work
without a generated snapshot, and the default read path is live. There is no silent compatibility
layer: a removed tool or a changed default fails loudly.

## Before you upgrade

1. Pin the exact 0.21.0 release in the manifest or lockfile you deploy.
2. Run `codebase-snapshot validate` against the old snapshot. Re-generate before relying on the
   new live tools; the manifest format is still readable, but the MCP surface changed.
3. If an agent or CI job calls an MCP tool by name, update it from the table below. The seven tools
   are the complete set: `snapshot_impact`, `snapshot_context`, `snapshot_locate`,
   `snapshot_read`, `snapshot_validate`, `snapshot_explain`, `snapshot_generate`.

## MCP: 27 tools to 7

| Removed tool(s) | Replacement |
| :--- | :--- |
| `snapshot_status`, `snapshot_stats`, `snapshot_review` | `snapshot_validate` with `mode: "status"` or `mode: "audit"` |
| `snapshot_health` | `snapshot_validate` with `mode: "audit"` and `deep: true` |
| `snapshot_dependents`, `snapshot_neighbors`, `snapshot_tests`, `snapshot_diff_context`, `snapshot_cycles` | `snapshot_impact` |
| `snapshot_plan_for`, `snapshot_answer`, `snapshot_budget` | `snapshot_context` (use `planOnly: true` for the plan without bodies) |
| `snapshot_search`, `snapshot_symbol`, `snapshot_query`, `snapshot_routes`, `snapshot_entrypoints` | `snapshot_locate` |
| `snapshot_history` | `snapshot://reports/log`, or the report file on disk |
| `snapshot_workspace` | `context/WORKSPACE.json` and the CLI |

The seven remaining tools keep the same read/write rule: only `snapshot_generate` writes. The
other six are read-only and must never create a cache, a temp file, or a snapshot inside the
repository. Live reads may write the documented OS cache under the user cache directory, never
inside the served repository.

## Changed defaults

- `impact` defaults to `HEAD`. It no longer requires a prior `generate`; it builds a live index in
  memory and overlays uncommitted edits.
- `impact` and `brief` use the live index by default. Pass `--no-live` to require the persisted
  snapshot. `--no-cache` bypasses only the OS summary cache.
- `snapshot_read` prefers snapshot part bodies when the index source is `snapshot`; live bytes are
  used only for `live-overlay` or `live-memory`.
- `snapshot_validate` with `mode: "status"` reports presence, counts, fingerprint and timestamps;
  it does **not** claim `current`. Use the default drift mode for freshness. Audit mode reports
  health, not drift.
- `brief` was added. It emits redacted diff hunks and bounded source windows, with every omitted
  file named. `--out` refuses symbolic and hard links.
- `skill --install` writes three registries: `.agents/`, `.claude/` and `.cursor/`.
  `--with-mcp` merges one entry into `.mcp.json` and preserves other servers.

## New flags

| Flag | Command | Meaning |
| :--- | :--- | :--- |
| `--brief <path>` | generate, validate | Merge an owner-written half into `PROMPT.md`. |
| `--prompt-task <task>` | generate, validate | `audit`, `review` or `explain`. |
| `--attachment-slots <n>` | generate | Plan delivery for a destination that accepts n files. |
| `--max-parts <n>` | generate, validate | Grow the part budget until the snapshot has at most n parts. |
| `--tests-paths` | impact | Print candidate test paths, one per line. |
| `--run` | impact | Run the detected runner on the candidate tests (text output only). |
| `--precise` | impact | Add bounded compiler-resolved symbol references. |
| `--include-imports`, `--include-cycles` | impact | Add outgoing imports or cycles. |
| `--no-live`, `--no-cache` | impact, brief | Require the snapshot, or bypass the live-index cache. |
| `--copy`, `--out` | brief | Copy the brief, or write it inside the repository. |
| `--with-mcp` | skill | Merge a server entry into `.mcp.json`. |

## Configuration and behaviour

- `maxPartBytes` is a hard byte ceiling. `maxParts` is explicitly experimental: it may grow the
  budget and records a warning when it does.
- `--delta` and `--changed-since` record unchanged paths as `unchanged`; a file dropped later by
  `--budget-tokens` or `--slice` is `not-selected`, not `unchanged`. Validate therefore does not
  confuse a budget drop with an unchanged file.
- `--only` narrows the CLI. On the MCP surface it cannot replace an include allow-list declared in
  `snapshot.config.json`; the request is refused instead of widening scope.
- A snapshot generated with `--include-sensitive-files` is refused by the MCP server, including
  its part resources. Regenerate without that flag before serving a prompt.

## Older lines

The 0.20 line was published in place and remains documented in its own history. If you are on
0.12.x, upgrade to the newest 0.20 release first, then follow this page. The configuration file
format has not changed; removed MCP tools and the new live defaults are the migration work.

`validate` on a snapshot written by an older version still works: newer manifest keys are optional,
and an artifact the manifest does not record is not required to exist.
