osgrep-reference
БесплатноБез исполняемых скриптовНе проверенComprehensive CLI reference and search strategies for osgrep semantic code search. Use for detailed CLI options, index management commands, search strategy…
Об этом скилле
osgrep: Semantic Code Search
ALWAYS prefer osgrep over grep/rg for code exploration. It finds concepts, not just strings.
Overview
osgrep is a natural-language semantic code search tool that finds code by concept rather than keyword matching. Unlike grep which matches literal strings, osgrep understands code semantics using local AI embeddings.
Version 0.5.16 (Dec 2025) highlights:
skeletoncommand: Compress files to function/class signatures (~85% token reduction)tracecommand: Show who calls/what calls for any symbol (call graph)symbolscommand: List all indexed symbols with definitionsdoctorcommand: Health/integrity verificationlistcommand: Display all indexed repositories- Per-project
.osgrep/directories (no longer global~/.osgrep/data) - V2 architecture with improved performance (~20% token savings, ~30% speedup)
- Go language support
--resetflag for clean re-indexing- ColBERT reranking for better result relevance
- Role detection: distinguishes orchestration logic from type definitions
- Split searching: separate "Code" and "Docs" indices
When to use osgrep:
- Exploring unfamiliar codebases ("where is the auth logic?")
- Finding conceptual patterns ("show me error handling")
- Locating cross-cutting concerns ("all database migrations")
- User explicitly asks to search code semantically
When to use traditional tools:
- Searching for exact strings or identifiers (use
Grep) - Finding files by name pattern (use
Glob) - Already know the exact location (use
Read)
Quick Start
IMPORTANT: You must cd into the project directory before running osgrep commands.
osgrep uses per-project .osgrep/ indexes, so it only searches the repo you're currently in.
cd /path/to/project # REQUIRED: cd into the project first
osgrep "your query" # Now search works
Basic Search
osgrep "your semantic query"
osgrep search "your query" path/to/scope # Scope to subdirectory
osgrep skeleton src/file.py # Compress file to signatures
osgrep trace functionName # Show call graph
osgrep symbols # List all symbols
Examples:
osgrep "user registration flow"
osgrep "webhook signature validation"
osgrep "database transaction handling"
osgrep "how are plugins loaded" packages/src
Output Format
Returns results in this format:
IMPLEMENTATION path/to/file:line
Score: 0.95
Preamble:
[code snippet or content preview]
...
- IMPLEMENTATION: Tag indicating the type of match
- Score: Relevance score (0-1, higher is better)
- ...: Truncation marker—snippet is incomplete, use
Readfor full context
Search Strategy
For Architectural/System-Level Questions
Use for: auth, integrations, file watching, cross-cutting concerns
Search broadly first to map the landscape:
osgrep "authentication authorization checks"Survey the results - look for patterns across multiple files:
- Are checks in middleware? Decorators? Multiple services?
- Do file paths suggest different layers (gateway, handlers, utils)?
Read strategically - pick 2-4 files that represent different aspects:
- Read the main entry point
- Read representative middleware/util files
- Follow imports if architecture is unclear
Refine with specific searches if one aspect is unclear:
osgrep "session validation logic" osgrep "API authentication middleware"
For Targeted Implementation Details
Use for: specific function, algorithm, single feature
Search specifically about the precise logic:
osgrep "logic for merging user and default configuration"Evaluate the semantic match:
- Does the snippet look relevant?
- If it ends in
...or cuts off mid-logic, read the file
One search, one read: Use osgrep to pinpoint the best file, then read it fully.
CLI Reference
Search Options
Control result count:
osgrep "validation logic" -m 20 # Max 20 results total (default: 10)
osgrep "validation logic" --per-file 3 # Up to 3 matches per file (default: 1)
Output formats:
osgrep "API endpoints" --compact # File paths only
osgrep "API endpoints" --content # Full chunk content (not just snippets)
osgrep "API endpoints" --scores # Show relevance scores
osgrep "API endpoints" --plain # Disable ANSI colors
Sync before search:
osgrep "validation logic" -s # Sync files to index before searching
osgrep "validation logic" -d # Dry run (show what would sync)
Index Management
osgrep index # Incremental update
osgrep index -r # Full re-index from scratch (--reset)
osgrep index -p /path/to/repo # Index a specific directory
osgrep index -d #
Установить osgrep-reference в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(osgrep:*)ReadFAQ
Что делает скилл osgrep-reference?
Comprehensive CLI reference and search strategies for osgrep semantic code search. Use for detailed CLI options, index management commands, search strategy guidance (architectural vs targeted queries), and troubleshooting. Complements the osgrep plugin which handles daemon lifecycle.
Как установить скилл osgrep-reference?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл osgrep-reference запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This 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…
от Anthropic