code-search

code-search is a cursor rule for Cursor from trankhanh040147/chatgpt-mcp. It costs 601 tokens per session, scanned A, original, MIT.

A code-search rule for finding and tracing symbols in the chatgpt-mcp repository. It defines where searches should start, when to inspect related code, and how to verify results after edits.

In plain words
What is it for?
It helps locate controllers, services, repositories, task workflows, MCP handoffs, result artifacts, health interfaces, and HTTP dashboard code.
Why use it?
It reduces guesswork in a changing codebase and helps prevent edits based on outdated or unresolved symbol names.

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/trankhanh040147/chatgpt-mcp/code-search
Clone the repo
git clone --depth 1 https://github.com/trankhanh040147/chatgpt-mcp

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-search

README.md
[![agentmods](https://agentmods.dev/badge/rules/trankhanh040147/chatgpt-mcp/code-search.svg)](https://agentmods.dev/rules/trankhanh040147/chatgpt-mcp/code-search)
Your own site
<a href="https://agentmods.dev/rules/trankhanh040147/chatgpt-mcp/code-search"><img src="https://agentmods.dev/badge/rules/trankhanh040147/chatgpt-mcp/code-search.svg" alt="Measured on agentmods" height="20"></a>
Per session 601 This file is loaded in full into every session.
When invoked 601 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.1 $0.00601 $0.00601
Opus 5 $0.00300 $0.00300
Sonnet 5 $0.00120 $0.00120
Haiku 4.5 $0.00060 $0.00060

Measured yesterday against content hash 07bca45b09e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

code-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/code-search.mdc · 63 lines

How it starts

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

Code Discovery (chatgpt-mcp)

Extends user code-search rule. When this rule conflicts with User Rules, follow this Project Rule. Team Rules still take precedence.

GitNexus slug (required): chatgpt-mcp — every call: { repo: "chatgpt-mcp", ... }.

Edit/commit invariants (impact, detect_changes, rename) → AGENTS.md only.

Discovery flow

DISCOVERY     query → context → targeted Read (start narrow; typically 1–2 ranges — not a hard limit)
EDIT GATE     if changing existing symbol → impact upstream (AGENTS.md)
VERIFY        exact/path-scoped Grep

Start narrow. Widen only when initial reads leave a concrete remaining question (e.g. controller → service → repository needs another range).

Quick-map (hints — not authority)

Topic Start symbol
MCP handoff tools registerHandoffTools
Task lifecycle TaskService
Native writeback v0.8 writeResultArtifacts
Worker health UI/API buildWorkerHealthRow
HTTP dashboard server (src/http/api.ts)

If context cannot resolve an entry, rediscover with query — do not assume the symbol still exists.

Prefer context on these over repo-wide handoff / task greps.

Stale / missing index

GitNexus miss alone does not imply a stale index.

If a known symbol or path is missing unexpectedly:

  1. Verify once with path-scoped Grep/Glob.
  2. If code exists but GitNexus still misses it → index suspected stale → suggest node .gitnexus/run.cjs analyze from repo root.
  3. Continue with path-scoped Grep + targeted Read.
  4. Suggest re-analysis once when it would materially improve further work.

Distinguish suspected stale vs confirmed unavailable (MCP down, no index).

Repo literals (grep-first OK)

Exact strings where Grep before GitNexus is correct:

  • handoff_* tool names, env vars (HANDOFF_*), npm scripts (test:result-artifacts)
  • paths: src/mcp/tools/index.ts, .planning/active/

Anti-patterns (this repo)

Read the full file on GitHub · 63 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 · 63 lines · 601 tokens per session scan A 07bca45b09e6

Subscribe to this mod's changes

code-search is a cursor rule published in the GitHub repository trankhanh040147/chatgpt-mcp (0 stars, last pushed yesterday), licensed MIT. It adds 601 tokens to every session, about $0.0030 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-09-04.