lybrary

Measurement guide

Does codebase memory save tokens in your repo?

The useful measure is the complete agent run. A smaller retrieval result can still lead to extra calls or turns, so compare correct answers end to end.

Where savings can come from

Lybrary does not guarantee that every task uses fewer tokens. Exact symbol searches, small repositories, or questions requiring full function bodies may favor normal tools.

Run a paired read-only comparison

From a Lybrary source checkout, choose a real question whose answer you can verify:

python benchmark.py /path/to/indexed/repo \
  "Trace how an invitation email and calendar attachment are sent"

The script records runs with and without Lybrary under .lybrary/benchmarks/. Read both answers and traces. Compare answer correctness, total input tokens, cached and uncached input tokens, output tokens, and tool calls. Repeat with exact-symbol, cross-file, and unfamiliar-feature questions before drawing a general conclusion.

Tune your workflow

Use memory_query for code navigation, inspect only the returned source ranges, and query one named call again if the first result leaves a gap. Use full content only when a compact excerpt is insufficient. In a repository's AGENTS.md or CLAUDE.md, tell the agent when to query Lybrary and when to fall back to ordinary search.