rawq — Agent Usage Guide
rawq is a context retrieval engine that performs semantic and lexical hybrid search over codebases. It returns ranked code chunks with file paths, line ranges, scope labels, and confidence scores, helping AI agents understand project context.
About this skill
rawq functions as an advanced search tool for code repositories, blending the power of semantic (embedding-based) and lexical (BM25) search techniques. It's designed to help AI agents navigate and comprehend codebases by retrieving relevant code snippets based on conceptual queries rather than just exact keywords. The output includes not just the code, but also vital metadata such as file paths, precise line ranges, scope labels (e.g., function or class names), and a confidence score indicating relevance. AI agents can leverage rawq in various scenarios, such as understanding the overall architecture of a new codebase (`rawq map`), locating specific logical implementations without knowing the exact file or function name (e.g., "where is retry logic implemented?"), or analyzing the impact of changes (`rawq diff`). It excels where traditional `grep` falls short, particularly when the agent needs to grasp abstract concepts or fuzzy matches. By providing rich contextual information, rawq significantly reduces the effort required for agents to perform tasks like debugging, feature development, or code refactoring across large or unfamiliar projects. Users benefit from rawq's ability to interpret natural language queries for conceptual searches, making it more intuitive than keyword-based tools. It also supports filtering options, like specifying programming languages, to narrow down results and improve relevance, ensuring the agent receives the most pertinent information to complete its task effectively.
Best use case
The primary use case for rawq is to enable AI agents and developers to efficiently explore, understand, and extract specific conceptual information from complex or unfamiliar codebases. It benefits anyone needing to quickly locate code relating to abstract ideas or broad functionalities without knowing exact identifiers, making it invaluable for initial codebase exploration, bug identification, and feature implementation planning.
rawq is a context retrieval engine that performs semantic and lexical hybrid search over codebases. It returns ranked code chunks with file paths, line ranges, scope labels, and confidence scores, helping AI agents understand project context.
A ranked list of relevant code chunks, including file paths, line ranges, scope labels, and confidence scores, providing precise context for further action.
Practical example
Example input
rawq search "how does the app handle authentication failures" . --lang rust
Example output
```text
src/auth/handlers.rs:45-58 (fn handle_auth_failure) - 0.92
```rust
fn handle_auth_failure(req: &Request, res: &mut Response) {
log::warn!("Authentication failed for request from {}", req.ip());
res.status(StatusCode::UNAUTHORIZED).body("Authentication Required");
}
```
src/config/errors.rs:12-20 (enum AuthError) - 0.88
```rust
enum AuthError {
InvalidCredentials,
TokenExpired,
RateLimited,
}
```When to use this skill
- When you don't know the exact file or string but need to find specific logic or concepts in a codebase.
- To understand the overall structure or purpose of a codebase (`rawq map`).
- To analyze the impact of recent changes across a project (`rawq diff`).
- For conceptual searches using natural language, like 'how does the app handle authentication failures'.
When not to use this skill
- When you already know the exact file path and line number to read (use `read`).
- When you know the exact string to search for and simple keyword matching is sufficient (use `grep`).
- For simple keyword queries that lack descriptive intent, as these are less effective with rawq's semantic capabilities.
How rawq — Agent Usage Guide Compares
| Feature / Agent | rawq — Agent Usage Guide | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | medium | N/A |
Frequently Asked Questions
What does this skill do?
rawq is a context retrieval engine that performs semantic and lexical hybrid search over codebases. It returns ranked code chunks with file paths, line ranges, scope labels, and confidence scores, helping AI agents understand project context.
How difficult is it to install?
The installation complexity is rated as medium. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# rawq — Agent Usage Guide
Context retrieval engine. Semantic + lexical hybrid search over codebases. Returns ranked code chunks with file paths, line ranges, scope labels, and confidence scores.
## When to use rawq
Use rawq when you don't know where to look. Use grep/read when you already know the file or exact string.
| Situation | Tool |
|-----------|------|
| "Where is retry logic implemented?" | `rawq search` |
| "Find the function named `parse_config`" | `rawq search` or `grep` |
| "Read line 42 of src/main.rs" | `read` |
| "What does this codebase do?" | `rawq map` |
| "What changed and how does it affect X?" | `rawq diff` |
## Query style matters
rawq blends semantic (embedding) and lexical (BM25) search. **How you phrase the query changes which mode dominates.**
**Use natural language for concepts** — this is where rawq beats grep:
```bash
rawq search "how does the app handle authentication failures" .
rawq search "database connection pooling and retry logic" .
rawq search "where are environment variables validated" .
```
**Use identifiers only for exact symbol lookup:**
```bash
rawq search "fn parse_config" .
rawq search "class DatabaseClient" .
```
**Do NOT use grep-style keyword queries with rawq.** These produce worse results:
```bash
# BAD — grep-style keywords, rawq can't infer intent
rawq search "auth error" .
rawq search "db pool" .
# GOOD — natural language, rawq understands the concept
rawq search "how does authentication error handling work" .
rawq search "database connection pool management" .
```
The more descriptive your query, the better semantic search works. Single keywords trigger lexical-dominant mode which is just BM25 — no better than grep.
## Use filtering options
Agents often search the entire codebase when they already know constraints. Use filters to narrow results and improve relevance:
```bash
# Filter by language — skip irrelevant file types
rawq search "parse config" . --lang rust
rawq search "API endpoint" . --lang typescript
# Exclude patterns — skip tests, generated code, vendored deps
rawq search "database" . --exclude "*.test.*" --exclude "vendor/*"
# Force search mode when you know what you need
rawq search -e "reconnect" . # lexical only — exact keyword match
rawq search -s "how does caching work" . # semantic only — concept search
# Re-rank for better precision on ambiguous queries
rawq search "error handling" . --rerank
# Text weight — boost docs/comments when searching for explanations
rawq search "how to configure" . --text-weight 1.0
# Token budget — control how much context is returned
rawq search "auth" . --token-budget 2000 --json
```
## Commands
### search — find relevant code
```bash
rawq search "query" [path] # hybrid search (default)
rawq search "query" [path] --json # structured JSON for parsing
rawq search "query" [path] --lang rust # only Rust files
rawq search "query" [path] --exclude "test*" # skip test files
rawq search "query" [path] --top 5 # limit to 5 results
rawq "query" [path] # shorthand (no subcommand needed)
```
Key flags:
- `--top N` — number of results (default 10)
- `--context N` — surrounding context lines (default 3)
- `--json` — structured output with all fields
- `--stream` — NDJSON streaming (one result per line)
- `--lang X` — filter by language
- `--exclude "glob"` — skip matching files
- `-e` / `-s` — force lexical / semantic mode
- `--rerank` — two-pass keyword overlap re-ranking
- `--text-weight F` — weight for text/markdown chunks (default 0.5, use 1.0 for docs)
- `--token-budget N` — max tokens in results
- `--full-file` — include full file content in results
### map — codebase structure
```bash
rawq map . # definitions with hierarchy
rawq map . --depth 3 # deeper nesting
rawq map . --lang rust # only Rust files
rawq map . --exclude "test*" # skip test directories
rawq map . --json # structured output
```
Use to orient in an unfamiliar codebase before searching. **Filter with `--lang` and `--exclude`** to avoid noise from irrelevant files.
### diff — search within changes
```bash
rawq diff "query" . # unstaged changes
rawq diff "query" . --staged # staged changes
rawq diff "query" . --base main # diff vs branch
```
## JSON output format
```json
{
"schema_version": 1,
"model": "snowflake-arctic-embed-s",
"results": [
{
"file": "src/db.rs",
"lines": [23, 41],
"display_start_line": 23,
"language": "rust",
"scope": "DatabaseClient.reconnect",
"confidence": 0.91,
"content": "...",
"context_before": "...",
"context_after": "...",
"token_count": 45
}
],
"query_ms": 8,
"total_tokens": 45
}
```
## Workflow
1. `rawq map .` — understand the structure
2. `rawq search "descriptive query" . --json` — find relevant code
3. Read the top results' files for full context
4. Act on what you found
rawq narrows down which files matter. Read those files, not everything.Related Skills
laravel-expert
Senior Laravel Engineer role for production-grade, maintainable, and idiomatic Laravel solutions. Focuses on clean architecture, security, performance, and modern standards (Laravel 10/11+).
debug-nw
Debug a Nativewind v5 setup issue. Walks through common configuration problems with metro, babel, postcss, and dependencies.
Go Production Engineering
You are a Go production engineering expert. Follow this system for every Go project — from architecture decisions through production deployment. Apply phases sequentially for new projects; use individual phases as needed for existing codebases.
Database Engineering Mastery
> Complete database design, optimization, migration, and operations system. From schema design to production monitoring — covers PostgreSQL, MySQL, SQLite, and general SQL patterns.
afrexai-code-reviewer
Enterprise-grade code review agent. Reviews PRs, diffs, or code files for security vulnerabilities, performance issues, error handling gaps, architecture smells, and test coverage. Works with any language, any repo, no dependencies required.
API Documentation Generator
Generate production-ready API documentation from endpoint descriptions. Outputs OpenAPI 3.0, markdown reference docs, and SDK quickstart guides.
bili-rs
Development skill for bili-rs, a Rust CLI tool for Bilibili (B站). Use when implementing features, fixing bugs, or extending the bilibili-cli-rust codebase. Provides architecture conventions, API endpoints, coding patterns, and project-specific constraints. Triggers on tasks involving adding CLI commands, calling Bilibili APIs, handling authentication, implementing output formatting, or working with the layered cli/commands/client/payloads architecture.
Puppeteer
Automate Chrome and Chromium with Puppeteer for scraping, testing, screenshots, and browser workflows.
pharaoh
Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so.
git-commit-helper
Generate standardized git commit messages following Conventional Commits format. Use this skill when the user asks to commit code, write a commit message, or create a git commit. Enforces team conventions for type prefixes, scope naming, message length, and breaking change documentation.
ask-claude
Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).
bnbchain-mcp
Interact with the BNB Chain Model Context Protocol (MCP) server. Blocks, contracts, tokens, NFTs, wallet, Greenfield, and ERC-8004 agent tools. Use npx @bnb-chain/mcp@latest or read the official skill page.