cursorrules

A set of rules for a project connected to Codesteward, a service that has already mapped the codebase into a graph of files, symbols, calls, dependencies, and other relationships.

In plain words
What is it for?
Finding functions and classes, tracing callers and dependencies, following data flow, checking route protection, and verifying whether the code graph is current.
Why use it?
It directs agents to use that map for structural questions, which can avoid manually searching many files, and to read source files when exact code is needed.

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/codesteward/codesteward-graph/cursorrules
Clone the repo
git clone --depth 1 https://github.com/Codesteward/codesteward-graph

Made for: Cursor.

Per session 403 This file is loaded in full into every session.
When invoked 403 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.00403 $0.00403
Opus 5 $0.00201 $0.00201
Sonnet 5 $0.00081 $0.00081
Haiku 4.5 $0.00040 $0.00040

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

Security

Grade A, and why

cursorrules 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.

templates/.cursorrules · 51 lines

What it actually says

Codesteward Graph — Code Intelligence

This project has the Codesteward MCP graph server connected. It has already parsed this codebase into a structural graph.

Prefer graph tools over file reads for structural questions

For questions about code structure, relationships, and dependencies, use the graph tools first. They answer cross-file, cross-language questions in a single call that would otherwise require reading and grepping many files.

Use graph tools for:

  • Finding functions, classes, or methods by name → codebase_graph_query (lexical)
  • Finding what calls a function, or what a function calls → codebase_graph_query (referential)
  • Checking whether a route is protected by auth middleware → codebase_graph_query (referential, filter on GUARDED_BY/PROTECTED_BY)
  • Listing external package dependencies → codebase_graph_query (dependency)
  • Tracing data flow → codebase_graph_query (semantic)

Use file reads when you need the actual source code of a specific function or file after identifying it via the graph.

Workflow

Before your first structural query in a session, check if the graph is ready:

graph_status()

If last_build is null or the graph looks stale after recent changes:

graph_rebuild()

No arguments needed — the server already knows the repo path.

Then query:

codebase_graph_query(query_type="referential", query="authenticate")

query_type reference

  • lexical → find functions/classes/methods by name or file
  • referential → find call/import/extends/auth-guard relationships
  • semantic → trace data-flow relationships
  • dependency → list external package dependencies
  • cypher → custom Cypher query for anything not covered above

Recording inferred relationships

If you identify a relationship through reasoning that the parser could not detect (e.g. a dynamic call or runtime-resolved dependency), record it with graph_augment. Use node_id values from query results as source_id and target_id.

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 · 51 lines · 403 tokens per session scan A 431d2741eb06

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository Codesteward/codesteward-graph (2 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 403 tokens to every session, about $0.0020 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-31.