code-index

code-index is a cursor rule for Cursor from HoangP8/tokless. It costs 268 tokens per session, scanned A, original, MIT.

A rule for exploring a codebase by tracing relevant symbols, execution paths, dependencies, and the parts affected by a change. When available, it uses a prebuilt code index; otherwise it falls back to normal file-search methods.

In plain words
What is it for?
Use it to trace a request through the code, find callers of a function, understand architecture, or estimate the impact of changing a symbol.
Why use it?
It helps answer how code works and what a change might affect without reading the entire project. It also provides a fallback when the index is missing or unusable.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to trace a request through the code, find callers of a function, understand architecture, or estimate the impact of changing a symbol.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/hoangp8/tokless/code-index
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/HoangP8/tokless

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 code-index

README.md
[![agentmods](https://agentmods.dev/badge/rules/hoangp8/tokless/code-index/github.svg)](https://agentmods.dev/rules/hoangp8/tokless/code-index)
Your own site
<a href="https://agentmods.dev/rules/hoangp8/tokless/code-index"><img src="https://agentmods.dev/badge/rules/hoangp8/tokless/code-index/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 code-index

Your own site · 80×15
<a href="https://agentmods.dev/rules/hoangp8/tokless/code-index"><img src="https://agentmods.dev/badge/rules/hoangp8/tokless/code-index.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 268 This file is loaded in full into every session.
When invoked 268 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.00268 $0.00268
Opus 5.5 $0.00107 $0.00107
Sonnet 5.5 $0.00054 $0.00054
Haiku 4.5 $0.00027 $0.00027

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

Security

Grade A, and why

code-index 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 21d 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.

.cursor/rules/code-index.mdc · 27 lines

What it actually says

Code Index (codegraph)

Tool codegraph_explore gives source, call path, and blast radius in one call.

Rules

  • .codegraph/ index exists: use CodeGraph first.
    • Use for: how X works, flows, architecture, callers, blast radius, symbols.
    • Trust results — no re-read/re-grep. Stale banner? Read only listed files.
    • Result spilled? Search only needed symbol; never read whole spill. Use context-mode when spill is large.
    • Configs/docs/.env/non-indexed: use normal tools.
  • No .codegraph/: run git ls-files | wc -l.
    • ≤5 files or no git: use normal tools.
    • Otherwise: run tokless index once.
      • Ready: use CodeGraph.
      • Fails/CLI missing: use normal tools; do not retry.

Examples

  • codegraph_explore("how does auth middleware validate a JWT")
  • codegraph_explore("flow from HTTP request to DB query")
  • codegraph_explore("OrderService.createOrder callers and blast radius")
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. 21d ago Changed · -2 tokens per session c8b31b68a63a
  2. 1mo ago Changed · -16 tokens per session ceb1dd3553d7
  3. 3mo ago First seen · 27 lines · 286 tokens per session scan A bd7fef358722

Subscribe to this mod's changes

code-index is a cursor rule published in the GitHub repository HoangP8/tokless (420 stars, last pushed 4d ago), licensed MIT. It adds 268 tokens to every session, about $0.0011 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-08-30.

Related

code-index compared with cursor rules from other repositories

code-index next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-indexHoangP8/toklessCursor rule4204d agoMITA268Cursor
engine-internals0xranx/golembotCursor rule3221mo agoMITA0Cursor
code-stylecoddy-project/coddy-agentCursor rule215yesterdayMITA366Cursor
architecturerajudandigam/agent-inspectCursor rule2134d agoMITA70Cursor
hatch3r-dynamic-stack-verificationhatch3r/hatch3rCursor rule262mo agoMITA0Cursor
hatch3r-observability-logginghatch3r/hatch3rCursor rule262mo agoMITA0Cursor
modus-checkbox-value-inversion-reactjulianoczkowski/create-trimble-appCursor rule34mo agoMITA0Cursor