Prism
Graph-ranked code context for AI coding agents.
Prism turns a task plus a few precise anchors into the code, callers, callees,
tests, docs, and coverage gaps an agent needs to make a change safely.
Prism is not a better grep. Use rg/grep to find the first anchor. Use
Prism to answer the follow-up questions that usually cost several file reads:
- What calls this?
- What does this call?
- Which tests define the contract?
- What else is in the blast radius?
- Which nearby exported functions have no direct test coverage?
The recommended agent path is now CLI text mode:
prism query "fix direct coverage gaps" --terms buildCoverageGaps --include graph,tests,coverage_gaps --format text
prism read internal/cli/commands.go --format text
prism lookup github.com/provasign/prism/internal/cli.invokeWithPersistentLedger --format text
--format text gives agents plain source-like context with short headers.
Use lean or json only when automation needs structured output.
Grove is embedded in the Prism binary. There is no separate daemon, token, or
grove_url setup in current releases.
Why Prism
Shell search gives pointers. Agents still have to chase those pointers by
reading files, guessing test names, and manually reconstructing call paths.
Prism precomputes the project graph and lets the agent ask for relationships:
rg buildCoverageGaps internal/
-> prism query "write tests for buildCoverageGaps" \
--terms buildCoverageGaps \
--include graph,tests,coverage_gaps \
--format text
On this repository, five real maintenance scenarios were run both ways on
2026-06-07. Shell-only baselines used rg plus targeted sed reads; Prism used
one CLI text command per scenario.
| Scenario |
Shell bytes |
Prism CLI bytes |
Context reduction |
| Init / CLI steering impact |
19,970 |
12,818 |
35.8% |
coverage_gaps precision |
21,226 |
17,145 |
19.2% |
| CLI text/lean/json output formatting |
15,820 |
14,198 |
10.3% |
| Session cache / savings ledger |
33,134 |
19,922 |
39.9% |
| Release/version/install wiring |
21,246 |
12,157 |
42.8% |
The average reduction was 29.6% with one Prism command instead of 5-6 shell
commands. The bigger correctness win is that Prism surfaces tests and coverage
gaps proactively; shell-only workflows often discover those after CI fails.
Details: Real-World Prism CLI Benchmark.
How It Works
Task + anchor terms
|
v
Embedded Grove index
- symbols
- call edges
- dependency edges
- test edges
|
v
Prism ranking
- graph distance
- semantic similarity
- recency
- test relevance
- edit frequency / learned weights
|
v
Budgeted text context
- target symbols
- callers/callees
- tests
- docs
- coverage_gaps
Prism saves context by replacing repeated manual graph chasing with one
graph-aware query. The CLI also persists its ledger and file-read cache between
commands, so repeated unchanged file reads can return a short SHA pointer.
Installation
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/provasign/prism/main/install.sh | bash
# Windows PowerShell
irm https://raw.githubusercontent.com/provasign/prism/main/install.ps1 | iex
# Pin a version
VERSION=v0.5.6 curl -fsSL https://raw.githubusercontent.com/provasign/prism/main/install.sh | bash
The installer writes prism to ~/bin by default. Set
INSTALL_DIR=/usr/local/bin or another directory to override.
Build from source:
make build
make test
make install
Quick Start
Run this once at the project root:
prism init .
prism index .
This writes:
- steering files such as
AGENTS.md, CLAUDE.md, .cursorrules,
.windsurfrules, .github/copilot-instructions.md, and others
prism.yaml with the project profile and optional model settings
The generated agent instructions tell agents to use commands like:
prism query "trace the payment refund flow" --terms RefundPayment --include graph,tests --format text
prism query "find direct coverage gaps" --terms UpdatePayment,RequireScope --include graph,coverage_gaps --format text
prism read internal/payment/service.go --format text
prism lookup github.com/example/payflow/internal/payment.(*Service).RefundPayment --format text
Recommended agent workflow:
- Locate the first anchor with
rg, grep, or find.
- Run
prism query with the same anchor terms.
- Use
prism read for whole files only when needed.
- Use
prism lookup for one known function or method.
- Treat
coverage_gaps as a terminal structured output, not the start of
manual cross-referencing.
CLI Reference
prism init [dir]
prism index [dir]
prism status [dir]
prism query <task> [dir] \
--terms a,b,c \
--include graph,tests,docs,coverage_gaps \
--depth 2 \
--format text
prism read <file> [dir] --format text
prism lookup <name> [dir] --format text
prism search <keyword> [dir] --format text
prism savings [dir]
prism compact [dir]
prism feedback --tool <name> --rating <0-5> [dir]
prism version
Output formats:
| Format |
Use |
text |
Default and recommended for agents |
lean |
Compact JSON without most metadata |
json |
Full metadata for tooling/debugging |
Configuration
prism.yaml is intentionally small:
version: 1
profile: "default"
Optional keys:
model: "claude-sonnet-4-6"
grove_binary: "grove"
embeddings_backend: "tfidf"
Environment overrides include PRISM_MODEL, PRISM_PROFILE,
PRISM_GROVE_BINARY, and PRISM_EMBEDDINGS_BACKEND.
Language Support
Prism delegates parsing and graph construction to embedded Grove.
| Language |
Extensions |
| Go |
.go |
| TypeScript / TSX |
.ts, .tsx |
| JavaScript / JSX |
.js, .jsx, .mjs, .cjs |
| Python |
.py |
| Java |
.java |
| Rust |
.rs |
| C / C++ |
.c, .h, .cc, .cpp, .hpp, ... |
| C# |
.cs |
| PHP |
.php, .phtml, ... |
Markdown, YAML, JSON, shell scripts, Dockerfiles, Makefiles, SQL, GraphQL, and
other non-code files are indexed as document symbols and can be requested with
--include docs.
Benchmarks
Read benchmark numbers by transport:
Current practical summary:
- CLI
--format text is the recommended default for shell-capable agents.
- Prism is strongest on graph/blast-radius/test/coverage-gap questions.
- Shell tools remain best for locating exact strings or filenames.
Troubleshooting
prism query returns nothing: run prism index . from the project root.
Agent still uses stale instructions: run prism init . and restart or
reload the coding agent so it reads the updated steering files.
Wrong Prism binary: run command -v prism and prism version. Reinstall if
the version is old.
macOS quarantine:
xattr -d com.apple.quarantine "$(which prism)"
codesign -f -s - "$(which prism)"