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

# gandalf check: detect drift from the team manifest

> Compare gandalf.toml against local Codex and Claude Code setup and report missing MCP servers, skills, or hooks. Add --ci to exit non-zero on drift.

`gandalf check` compares the team manifest at `gandalf.toml` with your local agent environment and reports drift. Use it locally to preview what `gandalf apply` would do, or in CI to enforce team standards.

## Synopsis

```bash theme={null}
gandalf check [flags]
```

## Flags

| Flag              | Description                         | Default                          |
| ----------------- | ----------------------------------- | -------------------------------- |
| `--manifest`      | Path to `gandalf.toml`              | search project root              |
| `--ci`            | Exit with code 1 on drift or errors | off                              |
| `-p`, `--project` | Project directory                   | `.`                              |
| `--home`          | Home directory                      | `$HOME`                          |
| `--store`         | Gandalf store directory             | `~/.gandalf` or `$GANDALF_STORE` |
| `--json`          | Emit JSON output                    | off                              |

## Examples

```bash theme={null}
gandalf check
gandalf check --ci
gandalf check --manifest ./config/gandalf.toml
gandalf check --json
```

## Output shape

Text output prints the manifest name and version, the target agents, and one of two states:

* **In sync**: local setup matches the manifest.
* **Drift detected**: numbered list of items with agent, kind, name, and target file path.

Example:

```text theme={null}
📦 Team Manifest: my-team-project (version: 1.0)
🎯 Target Agents: claude-code, codex

⚠️  [DRIFT DETECTED] The following items are missing or out of sync:
  [1] [claude-code] mcp_server: postgres-db (~/.claude/settings.json)
```

Add `--json` for machine output containing the parsed manifest and drift list.

## Errors

* `MANIFEST_NOT_FOUND`: run [`gandalf init`](/cli/init) to create a manifest.
* `MANIFEST_PARSE_ERROR`: check TOML syntax.
* `MANIFEST_VALIDATION_ERROR`: correct required fields per the [manifest reference](/reference/manifest).

## Related

* [`gandalf apply`](/cli/apply)
* [Team manifest guide](/guides/team-manifest)
