mcp-ripgrep: Instructions file for Codex

AGENTS.md

mcp-ripgrep AGENTS.md is an instructions file for Codex, OpenCode from AtefAndrus/mcp-ripgrep. It costs 887 tokens per session, scanned A, a copy of mcp-ripgrep CLAUDE.md, MIT.

Project instructions for mcp-ripgrep, a server that lets tools search files with ripgrep.

In plain words
What is it for?
Use them when adding search tools, running tests, checking types, formatting code, or updating the parameter table.
Why use it?
They give contributors the commands, architecture rules, testing approach, and security constraints needed to change the project safely.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is AtefAndrus/mcp-ripgrep's own configuration. It tells Codex and OpenCode how to work on mcp-ripgrep itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-ripgrep configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AtefAndrus/mcp-ripgrep. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AtefAndrus/mcp-ripgrep/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/AtefAndrus/mcp-ripgrep

Made for: Codex, OpenCode.

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 mcp-ripgrep AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/atefandrus/mcp-ripgrep/agents-md.svg)](https://agentmods.dev/instructions/atefandrus/mcp-ripgrep/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/atefandrus/mcp-ripgrep/agents-md"><img src="https://agentmods.dev/badge/instructions/atefandrus/mcp-ripgrep/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 887 This file is loaded in full into every session.
When invoked 887 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 100% copy Near-identical to another mod 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.00887 $0.00887
Opus 5 $0.00443 $0.00443
Sonnet 5 $0.00177 $0.00177
Haiku 4.5 $0.00089 $0.00089

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

Security

Grade A, and why

mcp-ripgrep AGENTS.md 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 3d 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.

Origin

This is a copy

100% identical to mcp-ripgrep CLAUDE.md — 47 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

AGENTS.md · 47 lines

What it actually says

mcp-ripgrep

ripgrep の検索機能を提供する MCP サーバー。

コマンド

bun install          # 依存関係インストール
bun test             # テスト実行
bun test tests/builder.test.ts  # 単体テストのみ
bun test tests/mcp.test.ts      # MCP 統合テストのみ
bunx tsc --noEmit    # 型チェック
bunx biome check .   # Lint
bunx biome check --write .  # Lint + フォーマット自動修正
bunx tsc             # ビルド (dist/ に出力)
bun run scripts/generate-param-table.ts --write  # README パラメータ対応表を再生成

アーキテクチャ

  • ツール定義は src/tools/ に 1 ファイル 1 ツールで配置。新ツール追加時は既存ツール (例: src/tools/search.ts) をテンプレートとして使い、src/server.ts に register 呼び出しを追加する
  • コマンド構築 (src/rg/builder.ts) と実行 (src/rg/executor.ts) は分離されている。builder は純粋関数で { command, args[] } を返すだけなので、rg バイナリなしで単体テスト可能
  • builder はシェルを介さず spawn("rg", args) 用の引数配列を構築する。この設計はセキュリティ上の要件 (後述) による

テスト

  • bun:test を使用。テストファイルは tests/ 直下に配置
  • builder テスト (tests/builder.test.ts) は rg バイナリ不要。executor テスト以降は rg が必要
  • MCP 統合テスト (tests/mcp.test.ts) は InMemoryTransport + Client でプロトコルレベル検証。新ツール追加時はここにテストケースを追加する
  • テストフィクスチャは tests/fixtures/ に配置

注意事項

  • ツールのパラメータを追加・削除・変更したら bun run scripts/generate-param-table.ts --write を実行して README の対応表を更新する。CI では検証されないため忘れやすい
  • caseSensitivetrue/false/undefined の三値で挙動が変わる (builder.ts:10-17)。if (caseSensitive) のような二値判定をすると undefined (smart-case) のパスが壊れる
  • executor.ts の exit code 判定: rg は「マッチなし」を exit code 1 で返す。code 0-1 は正常、2 以上がエラー
  • path-guard.tspath.resolve() + プレフィックス一致で検証する。fs.realpathSync は意図的に使っていない (symlink は未解決)
  • リリースは git tag vX.Y.Z && git push origin vX.Y.Z で自動公開。publish ワークフローが npm に --provenance 付きで publish する

セキュリティ

このサーバーは MCP 経由でユーザー入力 (検索パターン、パス) をそのまま rg プロセスに渡す。シェルインジェクション防止が最重要。

  • shell: true は絶対に使わない。spawn の第2引数に配列で引数を渡す
  • 文字列結合やテンプレートリテラルでコマンド文字列を組み立てない
  • パターンとパスは -- セパレータの後に配置する (フラグインジェクション防止)
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. 3d ago First seen · 47 lines · 887 tokens per session scan A a3ef52b6ebd5

Subscribe to this mod's changes

mcp-ripgrep AGENTS.md is an instructions file published in the GitHub repository AtefAndrus/mcp-ripgrep (0 stars, last pushed 6d ago), licensed MIT. It adds 887 tokens to every session, about $0.0044 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to mcp-ripgrep CLAUDE.md, differing in 47 lines, and is treated as a copy.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens