Skip to content

Agent Rules — Tell Your AI Agent to Use vfs Before grep

You must create a rule file in your project that instructs the agent: “use vfs before grep for code discovery.”

Each AI tool has its own rule system:

ToolRule file locationHow to reuse vfs-agent-search.mdc
Cursor.cursor/rules/vfs.mdcCopy directly: cp vfs-agent-search.mdc yourproject/.cursor/rules/
Claude CodeCLAUDE.mdCopy the content into your CLAUDE.md (strip the YAML frontmatter)
AntigravityGEMINI.mdCopy the content into your GEMINI.md (strip the YAML frontmatter). Also reads AGENTS.md.
Windsurf.windsurf/rules/vfs.mdCopy as-is: cp vfs-agent-search.mdc yourproject/.windsurf/rules/vfs.md
Cline.clinerulesCopy the content into your .clinerules (strip the YAML frontmatter)
Continue.continue/rules/vfs.mdCopy as-is: cp vfs-agent-search.mdc yourproject/.continue/rules/vfs.md
Aider.aider.conventions.mdCopy the content into your .aider.conventions.md (strip the YAML frontmatter)

The core instruction is the same regardless of tool. Create the rule file for your tool (see table above) and add this content:

Terminal window
mkdir -p .cursor/rules

Create .cursor/rules/vfs.mdc with the rule content above. The vfs repository includes a production-ready Cursor rule at .cursor/rules/vfs-agent-search.mdc that you can copy directly:

Terminal window
cp /path/to/vfs/.cursor/rules/vfs-agent-search.mdc .cursor/rules/

Create or append to CLAUDE.md in your project root with the rule content above. Claude Code reads this file at the start of every session.

Create GEMINI.md in your project root with the rule content above. Antigravity reads GEMINI.md as its native config. It also reads AGENTS.md for general agent instructions.

Terminal window
mkdir -p .windsurf/rules

Create .windsurf/rules/vfs.md with the rule content above.

Without the rule file:

You: "Where is the login handler?"
Without rule: Agent runs grep -r "HandleLogin" . → reads 200 lines → 3,500 tokens
With rule: Agent calls vfs search("HandleLogin") → reads 23 lines → 370 tokens

The rule file is what turns vfs from “installed but ignored” into “actively saving tokens on every search.”