> ## 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 scan: discover local agent configuration

> Use gandalf scan for read-only discovery of installed skills, hooks, MCP servers, and plugins for Codex and Claude Code. Safe to run anytime.

`gandalf scan` performs read-only discovery of the local agent configuration for `codex` and `claude-code`. It inspects installed skills, hooks, MCP servers, and plugins without making any changes, so you can run it safely at any time to understand the current state of your setup.

## Synopsis

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

## Flags

| Flag              | Description                                     | Default      |
| ----------------- | ----------------------------------------------- | ------------ |
| `-p`, `--project` | Project path                                    | `.`          |
| `--home`          | Home directory path                             | `$HOME`      |
| `--store`         | Gandalf data directory                          | `~/.gandalf` |
| `--agent`         | Target agent (`codex`, `claude-code`)           | (none)       |
| `--scope`         | Scope (`user`, `project`, `managed`, `unknown`) | (none)       |
| `--json`          | Emit output as JSON                             | (disabled)   |
| `--explain`       | Include paths considered during discovery       | (disabled)   |

## Examples

### Basic scan for Codex

```bash theme={null}
gandalf scan --agent codex --scope user
```

### Scan and emit JSON

```bash CodeGroup theme={null}
gandalf scan --agent codex --scope user --json
gandalf scan --agent claude-code --scope user --json
```

### Scan with explanation

```bash theme={null}
gandalf scan --agent claude-code --scope user --explain
```

## Notes

* `scan` never writes to disk. It is safe to run repeatedly.
* When `--explain` is passed, the output includes the file paths Gandalf inspected, which is useful for debugging or for understanding how agent configuration is resolved.
* Use `--json` to pipe scan output into other tools or for programmatic inspection.
* Currently supported agents are `codex` and `claude-code`. Project-local files are out of scope for the current release.
