Install
$ agentstack add skill-xiaoconstantine-sgrep-sgrep ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
sgrep - Smart Code & Conversation Search
Use sgrep for semantic and hybrid search across code and agent conversations. It understands intent, not just exact strings.
When to Use
Code Search
- Finding code by concept: "error handling", "authentication logic", "rate limiting"
- Searching for specific terms with semantic context: use
--hybrid - Best code-search accuracy after indexing: use
--hybrid --colbert - Exploring unfamiliar codebases
- When ripgrep patterns keep missing relevant code
Conversation Search
- Finding past discussions with Claude Code, Codex CLI, Cursor, OpenCode, or Pi
- Recalling how you solved a similar problem before
- Building context from previous sessions for new tasks
- Searching across all your coding agent interactions
Commands
# First time only
sgrep setup
sgrep setup --with-rerank # optional, only for --rerank
# Index current directory; builds compact TQ-MSE chunk/file vectors by default
sgrep index .
# Optional ColBERT segment codec override
sgrep index . --colbert-codec tqmse
sgrep index . --colbert-codec int8
sgrep index . --colbert-codec pq6
# Legacy compatibility: also persist full SQL vectors
sgrep index . --sql-vectors
# Watch mode keeps SQL vectors for incremental updates; rerun index to compact
sgrep watch .
# Balanced semantic + lexical code search (default)
sgrep "database connection pooling"
sgrep "how are errors handled"
# Fast semantic-only search
sgrep --profile fast "error handling"
# Best code-search accuracy
sgrep --profile quality "JWT validation"
sgrep --profile quality "authentication middleware"
# With code context
sgrep -c "authentication middleware"
# JSON output
sgrep --json "rate limiting"
Conversation Search
# Index conversations; refreshes compact TQ-MSE turn vectors
sgrep conv index
sgrep conv index --source codex
sgrep conv index --source claude
sgrep conv index --source opencode
sgrep conv index --source pi
sgrep conv index --watch
sgrep conv index --force
# Search conversations
sgrep conv "authentication flow"
sgrep conv "JWT refresh_token" --hybrid
sgrep conv "database migration" --agent claude --since 7d
sgrep conv "bug fix" --project payment-service --after 2026-01-01 --before 2026-06-01
sgrep conv "exact phrase" --exact
sgrep conv "auth" --json -n 1
# View, export, context, and copy helpers
sgrep conv view
sgrep conv view --turn 3 --no-color
sgrep conv export --format markdown -o conversation.md
sgrep conv export --format json -o conversation.json
sgrep conv context
sgrep conv context --turns 10 --copy
sgrep conv copy --turn 2 --code-only
sgrep conv status
Semantic vs Hybrid
| Mode | Best For | Example | |------|----------|---------| | --profile fast | Lowest-latency semantic exploration | "how does auth work" | | --profile balanced (default) | Semantic + exact-term recall | "JWT token validation" | | --profile quality | Highest code-search accuracy | "authentication middleware" |
Use the default balanced profile for most agent searches and --profile quality when ranking quality matters more than minimum latency.
Search Hierarchy
- sgrep → Balanced semantic + lexical discovery
- sgrep --profile fast → Lowest-latency semantic discovery
- sgrep --profile quality → Rerank candidates with precomputed late interaction
- ast-grep → Match structural patterns in those files
- ripgrep → Exact text for specific symbols
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: XiaoConstantine
- Source: XiaoConstantine/sgrep
- License: Apache-2.0
- Homepage: http://xiaocui.me/sgrep/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.