scope

A command for searching your local Claude Code session history, with options to search, list sessions, view statistics, or rebuild the index.

In plain words
What is it for?
Use it for full-text searches, recent-session listings, history statistics, or index management.
Why use it?
It makes old conversations and their context easier to find without browsing through session files by hand.

Command

Part of the claude-scope plugin — 1 command shipped together

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/waazy-w/claude-scope/scope
Clone the repo
git clone --depth 1 https://github.com/waazy-w/claude-scope

Or install claude-scope, the plugin that ships this one along with the rest of its 1 command.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 482 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.00013 $0.00482
Opus 5 $0.00006 $0.00241
Sonnet 5 $0.00003 $0.00096
Haiku 4.5 $0.00001 $0.00048

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

Security

Grade A, and why

scope 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.

commands/scope.md · 41 lines

What it actually says

Search the user's local Claude Code session history using the claude-scope tool.

How to run it

Use the Bash tool to run:

python3 "${CLAUDE_PLUGIN_ROOT}/scripts/scope.py" $ARGUMENTS

If ${CLAUDE_PLUGIN_ROOT} is not set or did not expand in this context, locate scope.py by trying, in order, and use the first absolute path found:

  1. The CLAUDE_PLUGIN_ROOT environment variable at runtime (e.g. "$CLAUDE_PLUGIN_ROOT/scripts/scope.py").
  2. A glob like ~/.claude/plugins/*/claude-scope/scripts/scope.py.
  3. find ~/.claude -name scope.py -path '*claude-scope*'.

Interpreting the arguments

The user's input is: $ARGUMENTS

  • Valid subcommands are search, sessions, stats, and index.
  • If the input does not start with one of those subcommands (e.g. the user typed bare words like /claude-scope:scope database migration), treat the entire input as a search query: prepend search and pass the rest through unchanged.
  • If the input is empty, run sessions to show recent sessions.

Presenting results

  • Show the script's stdout to the user essentially verbatim, inside a code block — it is pre-formatted plain text (timestamps, project, branch, role, highlighted snippets, session ids).
  • After the results, add one short line: to open a found session, run claude --resume <session-id>.
  • If the script prints a staleness WARNING, surface it prominently at the top of your response — never hide or paraphrase it away.

Rules

  • Never modify anything under ~/.claude/projects; the script is strictly read-only there, and you must be too.
  • Do not retry with destructive workarounds if the script fails; report the error output instead.
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 · 41 lines · 13 tokens per session scan A 67d0c9ee1393

Subscribe to this mod's changes

scope is a command published in the GitHub repository waazy-w/claude-scope (4 stars, last pushed 13d ago), licensed MIT. It adds 13 tokens to every session and 482 once invoked, about $0.0001 per session on Opus 5. 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-31.