vfs-agent-search

A set of rules for searching source code: use VFS to locate definitions, then Grep and Read to understand their implementation.

In plain words
What is it for?
Use it when navigating, understanding, or changing Go, JavaScript, TypeScript, Python, Rust, Java, and other supported codebases.
Why use it?
It prevents mistaken conclusions based only on function or class signatures whose internal code was not inspected.

Cursor rule for Cursor

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 rules/trngtien/vfs/vfs-agent-search
Clone the repo
git clone --depth 1 https://github.com/TrNgTien/vfs

Made for: Cursor.

Per session 2,999 This file is loaded in full into every session.
When invoked 2,999 The same file — it is already loaded in full.
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.02999 $0.02999
Opus 5 $0.01499 $0.01499
Sonnet 5 $0.00600 $0.00600
Haiku 4.5 $0.00300 $0.00300

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

Security

Grade A, and why

vfs-agent-search 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 yesterday.

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.

.cursor/rules/vfs-agent-search.mdc · 264 lines

How it starts

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

Code Search Strategy: Navigate with vfs, Understand with Grep/Read

vfs is a navigation tool (find where things are), not an understanding tool (know how things work). Signatures without bodies create false confidence. Always read implementation before claiming to understand behavior.

How vfs Works

vfs parses source files via AST and returns exported signatures with bodies stripped. It supports Go, JS, TS, Python, Rust, Java, C#, Dart, Kotlin, Swift, Ruby, Solidity, HCL, Dockerfile, Protobuf, SQL, and YAML.

What vfs gives you: internal/services/fare.go:42: func CalculateFare(req *FareRequest) (*FareResponse, error) What vfs hides: The 50 lines of implementation inside that function.

This makes vfs excellent for locating definitions, but dangerous for understanding behavior.

Step 1: Classify Your Intent

Before searching, determine what you need:

Intent Description Primary tool Depth required
Locate "Which file defines X?" vfs Signature only — no Read needed
Understand "How does X work?" vfs → Read body + context Full implementation + dependencies
Modify "Change how X behaves" vfs → Read body + callers Full implementation + Grep for usages
Debug "Why does X fail?" Grep + Read Bodies, callers, error paths — vfs alone is useless here

Step 2: Search (vfs for navigation)

Use vfs as the first step to locate definitions — not as the final answer.

Access Priority: MCP First, CLI Fallback

MCP runs on the host outside the sandbox and bypasses binary restrictions.

Step,Name,Action,Condition,Result
1,MCP,"CallMcpTool(server: user-user-vfs, toolName: search, ...)",success,Use MCP for all vfs operations
1,MCP,"CallMcpTool(server: user-user-vfs, toolName: search, ...)",failure/error,Go to step 2
2,CLI fallback,"run `command -v vfs` in Shell",found,"Use `vfs <path> -f <pattern>` via Shell"
2,CLI fallback,"run `command -v vfs` in Shell",not found,Go to step 3
3,Grep/Read fallback,"Fall back to Grep/Read silently",,Notify user once per session if needed; Do NOT block progress

Read the full file on GitHub · 264 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. yesterday First seen · 264 lines · 2,999 tokens per session scan A d16c7edd21d6

Subscribe to this mod's changes

vfs-agent-search is a cursor rule published in the GitHub repository TrNgTien/vfs (141 stars, last pushed 14d ago), licensed MIT. It adds 2,999 tokens to every session, about $0.0150 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.