Command Palette

Search for a command to run...

Назад к скиллам
скилл № 57004

ripgrep

Enhanced code search with custom ripgrep binary supporting ES module extensions and advanced patterns.

БесплатноЗапускает вложенные скрипты
oimiragieoот 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:

  1. Directory Tree — folder hierarchy up to 3 levels deep (excludes node_modules, .git)
  2. Entry Points — all ESM export and CJS module.exports declarations with file:line references
  3. Top Dependencies — most-imported modules (both import and require) 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)
  4. 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:structure to 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 to Read the entire file
  • △ MEDIUM (8-32K) — use Read with offset/limit parameters, or search:file
  • ⚠ LARGE (32-100K) — prefer search:code over full Read; only read targeted sections
  • ⚠ OVER (>100K) —
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

  1. 01Read
  2. 02Write
  3. 03Edit

Вложенные файлы

  • 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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ripgrep с