clawgrep

Grep-like CLI with hybrid semantic and keyword search. Combines semantic embedding search with keyword matching for high-quality code and document retrieval. Use when searching for content where the exact wording is unknown, or when grep misses results across large codebases or folders. Useful for recursively searching large collections of markdown files, like memories. Output is grep-compatible for easy parsing.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "clawgrep" with this command: npx skills add Schonhoffer/clawgrep

clawgrep

Semantic + keyword file search. Output is grep-compatible. Runs fully locally. On first run, automatically downloads a small ONNX embedding model (~30 MB) from Hugging Face and caches it in the local cache directory. After that, all searches are offline.

Check availability

clawgrep --version

If not found, install from the open-source repository using any of these methods (only one needed):

cargo install clawgrep        # Rust (recommended)
npm install -g clawgrep        # Node.js
pip install clawgrep           # Python

Basic usage

clawgrep --no-color "query" <path>

Always pass --no-color when parsing output programmatically.

Search a workspace

clawgrep --no-color "previous discussion about auth flow" ./memory

Output format

Grep-compatible, one result per line, ranked by relevance (best first):

$ clawgrep --no-color "previous discussion about auth flow" ./memory
memory/2025-06-12-auth-design.md:8:Decided to use OAuth2 with PKCE for all client auth.
memory/2025-06-12-auth-design.md:14:Token refresh should be transparent to the user.
memory/2025-06-10-planning.md:3:Auth flow is the top priority for the sprint.
memory/archive/2025-05-session-notes.md:42:Discussed moving auth to a separate service.
memory/archive/2025-05-session-notes.md:87:Need to revisit token expiry policy.

Each line is file:line:text. Context lines (from -C) use - as the separator instead: file-line-text.

Exit codes

CodeMeaning
0Match found
1No match
2Error

Same as grep. Use -q for existence checks without output.

Choosing search mode

Default weights: 70% semantic, 30% keyword.

Concept search (don't know exact wording):

clawgrep --no-color "decision about migration strategy" ./memory

Exact identifier search (note IDs, tags, serial numbers):

clawgrep --no-color --keyword-weight 0.8 --semantic-weight 0.2 "PROJ-1042" ./memory

Key flags

FlagPurpose
-k NNumber of results (default: 5)
-C NContext lines before and after
-lPrint only matching filenames
-qQuiet; just set exit code
--show-scoreAppend relevance score
--path-boost NBoost filename matches (>1.0 = higher)
--min-score NFilter low-relevance results (0.0–1.0)

See CLI reference for all flags.

Best practices

  1. Use --no-color always when parsing output.
  2. Keep -k small (3–5) to reduce output. Increase only when needed.
  3. Check exit codes instead of parsing stdout when possible.
  4. Let the cache persist — don't use --no-cache unless searching throwaway content. First run indexes; subsequent runs are fast.
  5. Search the narrowest relevant directory, not the whole filesystem.

References (advanced, usually not needed)

The information above should be sufficient for normal use. Only load these if you run into problems or need flags not listed above:

  • CLI reference — all flags, config file format, grep compatibility
  • Examples — more input/output examples for edge cases

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

YiHui GIT MONITOR

通用 Git 项目监控工具。支持 GitHub、GitLab、Gitee 等所有 Git 平台。可以添加、删除、检查任意 Git 仓库的更新,自动拉取代码并生成变更摘要。

Registry SourceRecently Updated
Coding

Workspace Governance

A methodology-first workspace governance skill for AI agents. Focuses on principles, decision framework, and safe execution patterns instead of fixed directo...

Registry SourceRecently Updated
Coding

Nox Influencer - Creator Discovery & Influencer Marketing

Runs NoxInfluencer creator and marketing-ops workflows via CLI, including creator discovery for influencer marketing, creator marketing, UGC, social media ma...

Registry SourceRecently Updated
Coding

Gigo Lobster Doctor

🦞 GIGO · gigo-lobster-doctor: 环境体检模式:只检查 gateway、Python 依赖、题包链路与 PNG 证书能力,不跑正式试吃。 Triggers: 龙虾体检 / 检查龙虾环境 / lobster doctor / check lobster environment.

Registry SourceRecently Updated