ripgrep
Enhanced code search with custom ripgrep binary supporting ES module extensions and advanced patterns.
от oimiragieo★ 48 звёзд на GitHub
Установить ripgrep в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Ripgrep Skill
Enhanced code search with ripgrep binary. NOTE: Prefer `pnpm search:code` for discovery/ranking and smaller output payloads; prefer raw `rg` for fastest exact literal matching. - Hybrid code search via `pnpm search:code` (BM25 text + semantic vector ranking) - Raw ripgrep for exhaustive pattern sweeps (every match, not ranked top-N) - Advanced regex patterns (PCRE2 with -P flag) - Custom file type definitions via .ripgreprc - Integration with .gitignore and custom ignore patterns⚡ RECOMMENDED: Hybrid Code Search
Use the hybrid search system for day-to-day code discovery:
- Text search works instantly with no setup (ripgrep-based BM25)
- Semantic search requires a one-time index build:
pnpm code:index:reindex(~12 min with GPU, ~17 min CPU) - GPU-accelerated embedding via fastembed (NVIDIA CUDA auto-detected)
- Memory-safe: embeddings run in isolated subprocess to work around ONNX Runtime memory leak
- Hybrid scoring: Reciprocal Rank Fusion (RRF) combines text matches + semantic similarity
Prerequisites
# Build the semantic index (one-time, or after major codebase changes)
pnpm code:index:reindex
# Verify .env has embeddings enabled (should be default)
# HYBRID_EMBEDDINGS=on
# LANCEDB_EMBEDDING_MODE=fastembed
Without the index build, pnpm search:code falls back to text-only matching. Concept queries like "authentication flow" will return poor results without embeddings.
Search Commands
# Project structure (directory tree + entry points + dependency graph + Mermaid)
pnpm search:structure
# Token budget analysis (file sizes + token estimates + refactor advice)
pnpm search:tokens .claude/lib # directory analysis
pnpm search:tokens path/to/file.cjs # single file analysis
# Semantic + text hybrid search (concept discovery, ranked results)
# Repeated/similar queries served from cache (~5ms hit vs ~800ms miss)
pnpm search:code "authentication logic"
pnpm search:code "export class User"
# One-shot search + compress + dedup pipeline (for large context tasks)
pnpm search:compress "how does routing work"
# Get file content with line numbers
pnpm search:file src/auth.ts 1 50
# Cache observability (daemon must be running)
pnpm search:code --cache-stats # view hits, misses, entries
pnpm search:code --cache-clear # flush cached results
pnpm search:structure — Know Where Things Are
Run this FIRST before any edit, refactor, or onboarding task. It gives a complete map:
- Directory Tree — folder hierarchy up to 3 levels deep (excludes node_modules, .git)
- Entry Points — all ESM
exportand CJSmodule.exportsdeclarations with file:line references - Top Dependencies — most-imported modules (both
importandrequire) with counts, split by:📦External packages (node:test, path, fs, child_process)📁Local modules (which internal files are imported most — these are the architectural hotspots)
- Mermaid Diagram — visual dependency graph with:
- Directory subgraphs showing export counts per folder
- External dependency subgraph
- Most-imported local modules highlighted as hub nodes
How agents should use this:
- Before editing: run
pnpm search:structureto find which directory owns the code you need to change - To find hotspots: the
📁local dependencies with highest counts are the most-connected modules — changes there have the widest blast radius - To find entry points: the exports list shows which files expose public APIs — start reading there
- To understand architecture: the Mermaid diagram shows which directories are most interconnected
- Before refactoring: the dependency counts tell you how many files will be affected by a rename/move
pnpm search:tokens [path] — Know What Fits in Context
Run this before deciding HOW to read a file or directory. It tells you:
- Token estimates per file and per directory (~4 chars per token)
- Actionable advice on whether to Read directly, use offset/limit, or use search:code instead
- Largest files that need special handling
- Directory rankings by token size — prioritize which subdirs to explore
# Check a specific file
pnpm search:tokens .claude/lib/memory/lancedb-client-impl.cjs
# Output: Size: 41.1KB | Tokens: ~10.5K | Advice: △ MEDIUM — use Read with offset/limit
# Check a directory
pnpm search:tokens .claude/lib
# Output: 333 files, 2.0MB, ~527K tokens (too large to read all — use search:code)
# Check the whole project
pnpm search:tokens .
# Output: 12478 files, 61MB, ~16M tokens with per-directory breakdown
Token Budget Legend:
✓ OK(<8K tokens) — safe toReadthe entire file△ MEDIUM(8-32K) — useReadwithoffset/limitparameters, orsearch:file⚠ LARGE(32-100K) — prefersearch:codeover full Read; only read targeted sections⚠ OVER(>100K) —
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Read - 02
Write - 03
Edit
Вложенные файлы
- commands/ripgrep.md
- hooks/post-execute.cjs
- hooks/pre-execute.cjs
- references/.ripgreprc
- references/GUIDE.md
- references/README.md
- references/research-requirements.md
- rules/ripgrep.md
- schemas/input.schema.json
- schemas/output.schema.json
- scripts/main.cjs
- scripts/quick-search.mjs
- scripts/search.mjs
- templates/implementation-template.md
FAQ
Что делает скилл ripgrep?
Enhanced code search with custom ripgrep binary supporting ES module extensions and advanced patterns.
Как установить скилл ripgrep?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ripgrep запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…