snapshot

An interactive command-line interface for exploring an indexed codebase. It provides quick searches, tab completion, command history, and selectable vi or Emacs editing modes.

In plain words
What is it for?
Use it to find symbols, search by meaning, inspect callers and callees, view source code, and examine dependencies.
Why use it?
It makes repeated codebase investigation quicker and avoids retyping full commands. The history also lets you revisit earlier searches.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/agentis-tools/ctx/snapshot
Clone the repo
git clone --depth 1 https://github.com/agentis-tools/ctx
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,765 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02765
Opus 5 $0.00000 $0.01383
Sonnet 5 $0.00000 $0.00553
Haiku 4.5 $0.00000 $0.00277

Measured 2d ago against content hash 2537b695e885, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

snapshot scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/snapshot.md · 220 lines

How it starts

The opening of the file, as written. The whole thing — 220 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ctx snapshot

Capture per-commit Parquet metric snapshots for longitudinal quality analysis.

Synopsis

ctx snapshot [--force] [--churn-window <SPEC>] [--json]
ctx snapshot backfill --since <REF> [--every <N>] [--churn-window <SPEC>] [--json]

Description

Point-in-time commands like ctx score answer "did this change make the code better or worse?". ctx snapshot answers the longitudinal version: is the codebase trending better or worse over weeks and months? Each run exports the current commit's per-file and per-symbol metrics, near-duplicate pairs, and capture metadata as one Parquet partition:

.ctx/snapshots/sha=<sha>/symbols.parquet     per-symbol metrics
.ctx/snapshots/sha=<sha>/files.parquet       per-file metrics + churn + violations
.ctx/snapshots/sha=<sha>/dup_pairs.parquet   near-duplicate function pairs
.ctx/snapshots/sha=<sha>/meta.parquet        capture metadata (1 row)

Accumulate partitions over time (one per commit), then query them with ctx sql --snapshots to plot duplication, violation, and hotspot trends across the history.

A bare ctx snapshot captures HEAD: the index is refreshed incrementally first (same as ctx score), then the four Parquet files are written to a staging directory and moved into place with an atomic rename — readers never observe a half-written partition. If a partition for HEAD's sha already exists the command is a no-op (exit 0); --force rewrites it. When the working tree is dirty, a stderr warning notes that the snapshot is labeled with HEAD's sha but reflects the working tree.

Snapshot capture requires the duckdb feature (on by default); builds without it exit 2.

Options

Option Description Default
--force Overwrite an existing partition for HEAD false
--churn-window <SPEC> How far back to count per-file churn (a git log --since date spec) "90 days ago"
--json Machine-readable output (global flag) false

Read the full file on GitHub · 220 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 220 lines · 0 tokens per session scan A 2537b695e885

Subscribe to this mod's changes

snapshot is a command published in the GitHub repository agentis-tools/ctx (11 stars, last pushed 15d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,765 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.