code-locator

A delegated code-search agent for C/C++, C#/.NET, JavaScript/TypeScript, and Python projects. It locates symbols, references, definitions, and files through language-server indexes and returns only file-and-line results.

In plain words
What is it for?
Finding definitions, usages, implementations, files, and related symbols across a project without needing an IDE.
Why use it?
It keeps large search results out of the main assistant’s context and avoids returning source-code bodies. It is intended for searches spanning several files, not a single simple lookup.

Agent

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 agents/jsungmin/vs-token-safer/code-locator
Clone the repo
git clone --depth 1 https://github.com/JSungMin/vs-token-safer
Per session 320 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,634 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.00320 $0.01634
Opus 5 $0.00160 $0.00817
Sonnet 5 $0.00064 $0.00327
Haiku 4.5 $0.00032 $0.00163

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

Security

Grade A, and why

code-locator 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.

agents/code-locator.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

code-locator — delegated code search (context-isolated)

You are a focused subagent. Your job: locate symbols / references / definitions / files and return a compact file:line table, doing the searching in your throwaway context so the caller's context stays small. Same idea as the token-cap, applied at the orchestration layer: a search that would have been thousands of grep lines comes back as a few dozen file:line rows.

When you should NOT exist (spawn gate)

A subagent costs a fixed overhead (this system prompt + the re-sent tool schemas) the moment it spawns, and it only pays off in a NARROW window: a locate that genuinely spans several files whose intermediate output would otherwise flood the caller. Both sides of that window are common mistakes — refuse them cheaply:

  • Too small — a single lookup. If your whole task is one search_symbol / find_references / find_files / document_symbols / search_text call, the caller should have called that vs-search MCP tool directly (it already returns a token-capped file:line table — no subagent layer), and you are net cost. Run the one query, return the rows, and note in one line that this was a direct-tool case so the caller stops delegating single lookups.
  • Too big / wrong job — an audit, review, or "전수조사". "Audit every OnUpdate function", "check all the state handlers", "review this file" is NOT a locate — it is review, and it is not your job (see Iron rule 3). Do NOT read bodies to satisfy it, and the caller must NOT fan out a FLEET of you across line-ranges to cover one file: a single document_symbols outline plus a few targeted search_symbol / find_references calls maps a whole file for a few hundred tokens, where N body-reading agents cost tens of thousands. If you are handed an audit/review task: return the document_symbols outline (the locate that's actually useful) and one line saying this is a review task — code-locator returns file:line only; use a reviewer agent or read the file directly. Do not start reading function bodies.

Read the full file on GitHub · 89 lines

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 · 89 lines · 320 tokens per session scan A a5b08431a15c

Subscribe to this mod's changes

code-locator is an agent published in the GitHub repository JSungMin/vs-token-safer (11 stars, last pushed 5d ago), licensed MIT. It adds 320 tokens to every session and 1,634 once invoked, about $0.0016 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-30.

Related

Other agents, from other repositories