~/projects/api · git:main · open source · MIT · v0.9.2

know before
you touch.

code intelligence for LLM coding agents. // no full file reads. no context bloat. just signal.
$ cargo install scope-cli
github.com/rynhardt-potgieter/scope
32%
// cost per task
35%
// output tokens
+67%
// code edits
2×
// nav efficiency
// the problem

agents read too much.
they understand too little.

without code intelligence, agents navigate by loading full source files. a typical refactoring task burns 8,000–12,000 tokens on navigation before writing a single line.


scope builds a local structural graph — call hierarchies, type relationships, dependency chains. agents query exactly what they need. source loads only when they're ready to edit.

// without scope — 25:1 navigation-to-edit ratio
$0.58 per task · 2.4 edits
// with scope — 12:1 navigation-to-edit ratio
$0.39 per task · 4.0 edits
↑ 32% cheaper · 67% more edits · every read counts
// see it in action

one command. complete picture.

an agent runs scope sketch and knows class structure, caller counts, and type signatures — without reading a single source file.

~/projects/api — claude code session
$
PaymentService class   src/payments/service.ts:12–89
─────────────────────────────────────────────────────────────────────────
deps: StripeClient, UserRepository, Logger, PaymentConfig
extends: BaseService
impl: IPaymentService
methods:
processPayment  (amount: Decimal, userId: string) Promise<PaymentResult> [11 callers]
refundPayment  (txId: string, reason?: string) Promise<bool> [3 callers]
validateCard  (card: CardDetails) ValidationResult [internal]
getTransaction  (id: string) Transaction | null [2 callers]
fields:
private readonly client: StripeClient
private         repo: UserRepository
private         logger: Logger
// ~180 tokens · source file is 6,200 tokens
// agent reasoning — based on this output:
claude code · agent decisions claude-sonnet-4-6
processPayment has 11 callers — will run scope refs processPayment before touching the signature.
depends on StripeClient — uses the correct import without reading the imports file.
validateCard is internal — correctly excludes it from the public interface refactor.
did not read service.ts — the 6,200-token source file was never loaded. saved ~6,020 tokens on this single command.
// tokens saved vs loading source directly ~6,020 tokens
// command reference

every command has a purpose.

designed for agents. terse, labelled, consistent. every output is structured for immediate action.

scope sketch
<symbol> [--json]
Compressed structural overview. Methods with caller counts, deps, type signatures. ~200 tokens instead of ~4,000.
use before: reading source or editing a class.
scope refs
<symbol> [--kind calls|imports|extends|...]
Every reference grouped by kind — instantiations, imports, type annotations, call sites — with file and line.
use before: changing a function signature.
scope callers
<symbol> [--depth 1-5]
Direct and transitive callers. At depth 1, shows who calls this. At depth 2+, shows the blast radius — which entry points are ultimately affected.
use before: any refactor that changes a public API.
scope find
"<intent>" [--kind function|class|method|...]
Semantic search by what code does, not what it's named. Local embeddings — no API key, works offline.
use when: navigating unfamiliar code by intent.
scope deps
<symbol> [--depth 1-3]
What does this symbol depend on? Direct imports, called functions, extended classes. Transitive with --depth.
use when: understanding what must exist first.
scope trace
<symbol> [--depth 1-3]
Show how requests reach a symbol. Traces the call graph backward from target to entry points. Use for debugging — see how a bug is triggered.
use when: checking if an internal change is safe.
scope flow
<start> <end> [--depth N] [--limit N]
Find call paths between any two symbols. Unlike trace (entry points to target), this traces forward from start to end through the call graph.
use when: understanding how two symbols are connected.
scope map
[--json]
Full repository overview in ~500-1000 tokens. Entry points, core symbols ranked by caller count, architecture layers. Start here for complex tasks.
use when: starting work on an unfamiliar codebase.
scope entrypoints
[--json]
List API controllers, workers, and event handlers. Symbols with zero incoming calls — the starting points for every request flow.
use when: understanding how requests enter the system.
scope index
[--full] [--watch]
Build or refresh the code index. Incremental by default. --full rebuilds from scratch. --watch auto re-indexes on file changes.
use: once on setup. --watch during development.
scope rdeps
<symbol> [--depth 1-3]
What depends on this symbol? Reverse dependency traversal. Know the blast radius before deleting or renaming anything.
use before: deleting or renaming a symbol.
scope diff
[--ref <git-ref>] [--json]
Cross-references git diff with the index. Shows which symbols live in changed files. Perfect for PR triage — know what was affected without reading diffs.
use when: reviewing a PR or checking what changed.
scope source
<symbol> [--json]
Print the full source of a symbol between its start and end lines. When you've found the right symbol via sketch or find and need the actual code.
use when: you need the real code after navigating.
scope similar
<symbol> [--limit N] [--json]
Find structurally similar symbols via FTS5. Seeded from the target's kind, name, and signature. Great for finding parallel implementations or duplicates.
use when: looking for patterns or duplicates.
scope summary
<symbol> [--json]
One-line overview: name, kind, location, signature, callers, deps. ~30 tokens. The fastest way to answer "what is this?" without a full sketch.
use when: quick check before deciding to sketch.
scope setup
[--preload] [--json]
One-command agent integration: init + index + CLAUDE.md + skill install. --preload bakes architecture into CLAUDE.md for 32% agent cost savings.
use: first time setting up scope in a project.
scope status
[--json]
Index health check. Symbol count, file count, last indexed time, stale files. Know if your index is fresh before range-based edits.
use when: checking if the index is stale.
// mcp server

structured tools.
no bash required.

scope-mcp wraps 12 commands as typed MCP tools over stdio. agents call scope directly — no shell permissions, no string parsing, no prompt approvals.

Claude Desktop Claude Code Cursor any MCP client
// one line in your MCP config
{ "mcpServers": { "scope": { "command": "scope-mcp" } } }
// before — bash permissions + string parsing
⚠ Allow Bash(scope sketch PaymentService --json)?
agent → Bashshellscopestdout stringparse JSON
requires Bash(scope:*) permission · every call needs approval or allowlist
// after — native MCP tool calls
✓ scope_sketch({ symbol: "PaymentService" })
agent → MCP tool calltyped JSON result
no permissions needed · typed parameters · --compact by default (57% smaller)
status
map
sketch
summary
source
find
refs
callers
deps
diff
trace
flow
// setup

zero infrastructure.
three steps.

everything lives in .scope/ in your project root. no server, no docker, no api key required.

1

install

single binary. installs from crates.io.

cargo install scope-cli
2

index your project

run once. incremental from then on.

scope init
scope index
3

install the skill + snippet

copy the skill to .claude/skills/ and add the snippet to CLAUDE.md. agents discover scope automatically.

CLAUDE.md
## Code Navigation

This project has Scope CLI installed.
Run `scope status` to check. `scope map` for overview.

Subagents needing code navigation:
read .claude/skills/code-navigation/SKILL.md

// all the detail lives in the skill file. // CLAUDE.md just points to it.
// scale up

workspaces. one command,
every project.

monorepos, multi-repo setups, polyglot stacks — scope queries across all your projects as one unit. each project keeps its own index. one query searches them all.

~/platform scope-workspace.toml
├── 📁 web-app/ TS 4,102 sym live
├── 📁 api-gateway/ Go 2,341 sym live
└── 📁 user-service/ Rs 1,823 sym live

$ scope refs PaymentService --workspace
found 23 refs across 3 projects · 8,266 symbols · 3 languages
watching all members · scope workspace index --watch
scope workspace init
[--name]
Discover projects and create a workspace manifest. Each project keeps its own .scope/ index.
use: once per workspace.
scope map --workspace
[--json]
Unified map across all members. Entry points, core symbols, architecture — tagged by project.
use: orienting across repos.
scope workspace index --watch
Watch all members. One watcher per project, one command to rule them all. Ctrl+C stops everything.
use: during development.
// language support

your stack, covered.

six languages production-ready. C, C++, Kotlin, and Ruby are next.

TypeScript
✓ production-ready
C#
✓ production-ready
Python
✓ production-ready
Rust
✓ production-ready
Go
✓ production-ready
Java
✓ production-ready
C
◎ next
C++
◎ next
Kotlin
○ planned
Ruby
○ planned