Skip to content
Back to skills

Token Efficient Retrieval

ASecurity

Use the trl-retrieve MCP tools to fetch exact code slices instead of reading whole files, saving context tokens. Trigger whenever exploring or answering questions about the current codebase.

  • 2 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 6, 2026
ai-agentsapi

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned September 6, 2026

npx -y skills add AryanGonsalves/trl-token-reduction --skill token-efficient-retrieval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Token Efficient Retrieval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Token Efficient Retrieval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aryangonsalves-token-efficient-retrieval/badge)](https://www.skillsdirectory.com/skills/aryangonsalves-token-efficient-retrieval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: token-efficient-retrieval
description: Use the trl-retrieve MCP tools to fetch exact code slices instead of reading whole files, saving context tokens. Trigger whenever exploring or answering questions about the current codebase.
---

# Token-efficient code retrieval

When you need to understand or answer a question about this codebase, DO NOT grep and
read whole files. Instead:

- Call **`retrieve_code(query)`** (MCP server `trl-retrieve`) with a natural-language
  question. It returns the exact relevant source slices (functions / classes / methods)
  at a fraction of the tokens of opening files.
- Call **`explain_symbol(name)`** to fetch the full source of a named symbol.
- Only fall back to reading whole files if retrieval returns nothing relevant.

The index builds automatically on your first `retrieve_code` call (cached at `<project>/.trl/index.json`, incremental). Just call the tools directly — no setup step. If a tool says it "couldn't resolve your project", set `TRL_REPO` or pass `repo='/path'`.

## Optional precision (off by default)

Retrieval ranks by keyword + call-graph. For vague natural-language questions where the
right symbol isn't surfacing, an OPTIONAL hosted rerank exists (`retrieve(rerank="hosted")`)
that uses YOUR OWN `ANTHROPIC_API_KEY` (~1 cent/query via claude-haiku-4-5). It is a
PRECISION option, not a token saver, and is OFF by default.

## Honest scope (retrieval tier)

This skill delivers the RETRIEVAL lever only: it cuts context tokens by fetching slices
instead of whole files. It does NOT deliver the full proxy-path headline savings —
prefix caching and tail compression require running the local proxy and pointing your
agent's base URL at it (see `/trl-status` and the README two-tier note).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.