Generate the snapshot
snapshot_generateGenerate a budgeted repository snapshot in an output directory, replacing the previous one and returning fingerprint, part, and count details for codebase context.
Instructions
Write the snapshot to its output directory and return its fingerprint, parts and counts. Replaces the previous snapshot in that directory. A large repository can take several seconds.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "snapshot_generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| only | No | Globs to include: replaces the config allow-list for this run. | |
| pack | No | Also write one full-repository file in this format. | |
| root | No | Repository root. Defaults to the directory this server was started in. | |
| sarif | No | Also write reports/audit.sarif beside reports/audit.md, for CI code scanning. | |
| slice | No | Narrow the snapshot to what the planner picks for this question. | |
| ignore | No | Globs to exclude, added to the config deny-list for this run. | |
| outDir | No | Snapshot directory, relative to the root, and it must resolve inside the served repository. Defaults to the project configuration's outDir. | |
| staged | No | Only files staged in the git index. | |
| skeleton | No | Replace every function body with `{ /* ... */ }`, keeping signatures, imports and exports. Applies to TypeScript, JavaScript and JSX. | |
| tokenTree | No | Also write reports/tokens.md with per-file token estimates. | |
| includeLogs | No | Also write reports/log.md with this many recent commits. | |
| sliceTokens | No | Token budget for `slice` (default 30000, as the CLI). | |
| budgetTokens | No | Fit the snapshot into this token budget, highest value first. | |
| changedSince | No | Only files changed since this git ref, for example "main" or "HEAD~3". | |
| includeDiffs | No | Also write reports/diff.md from the uncommitted diff. | |
| maxPartBytes | No | Byte budget per part, for example 307200 or "300k". Defaults to the project configuration. | |
| maxPartTokens | No | Token ceiling per part, for example 32000 or "32k". Narrower than maxPartBytes; it converts at four bytes per token. | |
| stripComments | No | Remove comment text from JavaScript/TypeScript bodies (line numbers kept). | |
| withDependents | No | With staged or changedSince, also include the files that import the changed ones (one hop). | |
| removeEmptyLines | No | Drop blank lines from emitted bodies (line numbers move; recorded per file). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| parts | No | ||
| skipped | No | ||
| fingerprint | No | ||
| emittedBytes | No |