For AI agents: the complete documentation index is available at https://docs.gage.io/llms.txt, the full documentation bundle is available at https://docs.gage.io/llms-full.txt, and this page is available as Markdown at https://docs.gage.io/commands/scan.md.

gage scan

The gage scan command runs scanners on sessions. For background, see Scans and Scanners.

gage scan [OPTIONS] [SESSION]...
gage scan <COMMAND>

A scan runs over a dataset. With session selection options, the command adds the selected sessions to the store, creates a dataset holding them, and scans it. With --dataset, the command scans an existing dataset. Session arguments accept unique ID prefixes.

With no scanner or session options, the command prompts for scanners and sessions. With --yes, unspecified selections take defaults: the default scanner group, and sessions from the past 30 days capped at 20.

OptionDescription
-N, --native <SOURCE>Session source, as described in gage session
-S, --storedScan stored sessions
-R, --stored-remote <NAME>Scan sessions fetched from a remote
-s, --scanner <SCANNER>Scanner to run, as a name or path (repeatable)
-g, --group <NAME>Scanner group to run (repeatable)
-d, --dataset <DATASET>Scan an existing dataset (ID or prefix)
-p, --project <PROJECT>Limit sessions to a project, given as a directory path or a project slug as shown by gage session list
--touches <DIR>Limit sessions to those that touch a directory
--since <SINCE>Select sessions active within a duration (e.g. 1h, 30m, 7d)
-a, --allSelect every available session
-n, --limit <N>Select the latest N sessions
-r, --sample <N>Select N sessions at random
-j, --jobs <N>Tasks to run at once (default 10)
--agent-jobs <N>Agents to run at once across all tasks (default 8)
--invalidateIgnore prior work: scan every session in full and carry no notes forward
--ignore-missing-attachmentsStart the scan when a required attachment is missing
--ignore-missing-harnessStart the scan when the default driver’s harness is missing
-t, --tag <NAME>Tag the new scan run
--force-tagMove the tag if it exists
--no-progressPrint task output as it happens instead of the progress view
--no-datasetRun with no dataset; scanners see no sessions
--list-scannersShow available scanners and exit
-y, --yesSkip prompts and confirmation

--scanner takes a scanner name. When no scanner has that name, the value is a path to a directory holding a scanner.rn or to a scanner file. A #{...} suffix overrides the scanner’s params.

A session touches a directory when it wrote or read a file in the directory or below it, or when it started there.

--limit combines with --since to cap the sessions selected from the window. --sample draws from sessions active in the past 30 days, or the window given with --since.

A stored session is as recent as its last entry, or as the store’s last write of it when no entry has a time. A native session is as recent as the last modification of its file. --since, --limit, and --sample all use this time.

A scan runs the attach tasks of the selected scanners on a dataset it creates. An existing dataset passed with --dataset is scanned as it is; use gage attachment add --scanner to prepare it. --ignore-missing-attachments lets a task that needs an attachment the dataset lacks run and fail on its own. Without it, the scan does not start.

A scan asks the default driver whether its harness, such as Claude Code, Codex, or Pi, is installed and logged in before it starts. --ignore-missing-harness skips that question, so a scan whose tasks start no agents runs without a harness. An agent that a task starts on a missing harness fails on its own. Without the option, the scan does not start.

A scan agent on Pi is not sandboxed. See Known issues.

--stored-remote names a remote of the store. The command selects among the sessions that gage fetch brought from that remote and that are not merged into the store. It fetches nothing, and a remote that nothing was fetched from is an error that names gage fetch. The session selection options apply to the fetched sessions. The scan’s dataset, notes, and issues are written to the store. The dataset links each fetched session at the commit the remote holds, and the session stays apart from the store’s own sessions. --stored-remote excludes --native, --stored, --dataset, and --no-dataset.

An object that links a fetched session is withheld: gage push refuses it and gage backup leaves it out, because sending it would send the remote’s session. The dataset of such a scan is withheld, and so are its notes on the sessions, the issues that cite those notes, and the scan itself. Merging the sessions with gage merge ends the withholding.

gage fetch acme --all
gage scan --stored-remote acme --since 7d

--no-progress is the output when stdout is not a terminal.

scan list

List scan runs.

gage scan list [OPTIONS]
OptionDescription
-m, --moreShow more items. Repeat to show more per use.
-a, --allShow all items
-n, --limit <LIMIT>Limit the number of items shown (default: 20)
--full-idShow the full scan run ID

scan view

View a scan run in the scan TUI. The view shows the scan’s tasks, sessions, issues, and notes.

gage scan view [SCAN]

If you omit the ID, Gage lets you pick from a list.

scan delete

Delete scan runs. Each scan run is deleted along with the notes and issues it wrote. Notes carried forward from earlier scan runs are kept.

A note or an issue that the scan run wrote is kept when another scan run or an issue still uses it. This applies to an issue that another scan run also wrote, to a note that a later scan run carried forward, and to a note that an issue cites. A kept note or issue is not changed. The command reports the number of notes and issues it deleted and the number it kept.

gage scan delete [OPTIONS] <IDS>...
OptionDescription
-y, --yesSkip confirmation prompt