codebase-exploration

codebase-exploration is a cursor rule for Cursor from fmflurry/settings-opencode. It costs 821 tokens per session, scanned A, original, MIT.

A rule for exploring a codebase with a connected code-memory tool before using text search or shell commands. It covers finding code, definitions, callers, dependencies, and importers.

In plain words
What is it for?
It helps locate symbols, find where code is used, trace callers and dependencies, and fall back to grep or file search when needed.
Why use it?
It gives code searches a required order and avoids starting with less targeted tools when an indexed code search is available.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit It helps locate symbols, find where code is used, trace callers and dependencies, and fall back to grep or file search when needed.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/fmflurry/settings-opencode/codebase-exploration
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.

Clone the repo
git clone --depth 1 https://github.com/fmflurry/settings-opencode

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codebase-exploration

README.md
[![agentmods](https://agentmods.dev/badge/rules/fmflurry/settings-opencode/codebase-exploration/github.svg)](https://agentmods.dev/rules/fmflurry/settings-opencode/codebase-exploration)
Your own site
<a href="https://agentmods.dev/rules/fmflurry/settings-opencode/codebase-exploration"><img src="https://agentmods.dev/badge/rules/fmflurry/settings-opencode/codebase-exploration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codebase-exploration

Your own site · 80×15
<a href="https://agentmods.dev/rules/fmflurry/settings-opencode/codebase-exploration"><img src="https://agentmods.dev/badge/rules/fmflurry/settings-opencode/codebase-exploration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 821 This file is loaded in full into every session.
When invoked 821 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00821 $0.00821
Opus 5.5 $0.00328 $0.00328
Sonnet 5.5 $0.00164 $0.00164
Haiku 4.5 $0.00082 $0.00082

Measured 8d ago against content hash a446057e22c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codebase-exploration 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 8d 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.

plugins/fmflurry-harness/rules/codebase-exploration.mdc · 50 lines

How it starts

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

Codebase Exploration

ROUTING PRECEDENCE: First-tool routing gate (Orchestration & Routing) determines whether to delegate to a specialist Agent. After that gate is satisfied, CodeMemory-first mandate applies to exploration within whichever agent is executing (including the primary when no specialist matches).

HARD DEFAULT: When mcp__code-memory__* tools are connected, they are the FIRST and REQUIRED choice for any code search, symbol lookup, callers/callees, definitions, dependencies, or importers. Grep/Glob/Bash are fallbacks ONLY — reach for them only when code-memory cannot answer (raw directory listing, filename glob, reading a known path region, or no index for the project). Do not "start with grep" or "try grep first". Start with code-memory.

Applies whenever the code-memory MCP server is connected (tools named mcp__code-memory__*). Skip entirely if the server is absent.

Priority

For any codebase exploration — search, callers, callees, definitions, dependencies, importers, "where is X used?", "what calls Y?", "find references to Z", semantic Q&A over the repo — use mcp__code-memory__* tools first.

Fall back to rtk grep / rtk find / Grep / Glob / Bash only when code-memory cannot answer the question:

  • Raw directory listing (ls-style) — code-memory has no list_files.
  • Globbing by filename pattern only (no symbol/content concern).
  • Reading a file region whose path you already know — use Read.
  • Code-memory has no index for the project (first call returns empty / project-not-ingested).

Tool routing

Question Tool
"How does X work?" / "Where is X handled?" (semantic) mcp__code-memory__codememory_retrieve
"Where is symbol X defined?" mcp__code-memory__codememory_definitions
"Who calls X?" / impact analysis for rename mcp__code-memory__codememory_callers
"What does X call?" mcp__code-memory__codememory_callees
"What does file F import?" mcp__code-memory__codememory_dependencies
"Who imports file F?" mcp__code-memory__codememory_importers
"List files in dir D" Bash (rtk ls, find)
"Find files matching glob *.spec.ts" Glob or Bash
"Read lines 40-80 of F" Read

Read the full file on GitHub · 50 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. 8d ago First seen · 50 lines · 821 tokens per session scan A a446057e22c9

Subscribe to this mod's changes

codebase-exploration is a cursor rule published in the GitHub repository fmflurry/settings-opencode (171 stars, last pushed yesterday), licensed MIT. It adds 821 tokens to every session, about $0.0033 per session on Opus 5.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-10-08.