← Back to Skills Marketplace
yanxingang

Code Search

by Yanxingang · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
494
Downloads
0
Stars
4
Active Installs
1
Versions
Install in OpenClaw
/install code-search
Description
Search codebase contents, filenames, or directory structures using ripgrep, fd, and tree with filters for file types, context, depth, and result limits.
README (SKILL.md)

Code Search Skill

Fast code search toolkit for exploring codebases. Provides structured grep (content search), glob (filename search), and tree (directory structure) via ripgrep, fd, and tree CLI tools.

When to Use

  • Searching for function/class/variable definitions or usages in code
  • Finding files by name or extension pattern
  • Understanding project directory structure
  • Exploring unfamiliar codebases
  • Looking for configuration files, imports, error messages

Prerequisites

Run dependency check first:

bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh check

Commands

All commands go through a single entry point:

bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh \x3Ccommand> [options]

grep — Search file contents

# Basic search
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh grep "func main" --path /some/project

# Literal text (no regex interpretation)
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh grep "fmt.Println(" --literal --path /some/project

# Filter by file type
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh grep "import" --type go --path /some/project

# With context lines
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh grep "TODO" --context 2 --path /some/project

# Limit results
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh grep "error" --max 20 --path /some/project

Options:

  • --path \x3Cdir> — Search directory (default: current dir)
  • --type \x3Cext> — File type filter: go, py, ts, js, etc. (repeatable)
  • --literal — Treat pattern as literal text, not regex
  • --max \x3Cn> — Max results (default: 100)
  • --context \x3Cn> — Show N lines of context around matches (default: 0)

glob — Search filenames

# Find all Go files
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh glob "*.go" --path /some/project

# Find test files
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh glob "*_test.go" --path /some/project

# Find config files
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh glob "*.{json,yaml,yml,toml}" --path /some/project

# Filter by type
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh glob "config" --type f --path /some/project

Options:

  • --path \x3Cdir> — Search directory (default: current dir)
  • --type \x3Cf|d> — f=files only, d=directories only
  • --max \x3Cn> — Max results (default: 200)

tree — Directory structure

# Default (3 levels deep)
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh tree --path /some/project

# Shallow view
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh tree --path /some/project --depth 1

# With file sizes
bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh tree --path /some/project --depth 2 --size

Options:

  • --path \x3Cdir> — Target directory (default: current dir)
  • --depth \x3Cn> — Max depth (default: 3)
  • --size — Show file sizes

check — Verify dependencies

bash /root/.openclaw/workspace/skills/code-search/scripts/search.sh check

Output Format

All commands output structured text with clear delimiters:

  • [SEARCH RESULTS: grep] / [SEARCH RESULTS: glob] / [DIRECTORY TREE]
  • [END RESULTS] / [END TREE]
  • [TRUNCATED: ...] when results exceed the limit
  • [ERROR] ... on failures

Notes

  • All operations are read-only — no files are modified
  • Automatically ignores .git, node_modules, pycache, vendor, build artifacts
  • Respects .gitignore rules
  • Results sorted by modification time (newest first) for grep and glob
Usage Guidance
This skill appears to do what it says: a read-only wrapper around ripgrep, fd, and tree. Before using it: (1) ensure you trust the skill source because it will run shell commands on your filesystem and can reveal file contents (including secrets) if you point it at sensitive directories; (2) install ripgrep/fd/tree from trusted package sources if needed (the design doc includes manual curl examples—prefer distro packages or verified GitHub release assets); (3) consider limiting its use to specific project paths rather than system/root directories; (4) if you are concerned about autonomous agent actions, keep autonomous invocation disabled or only invoke the skill manually. Overall there are no mismatches between the description, the instructions, and the included script.
Capability Analysis
Type: OpenClaw Skill Name: code-search Version: 1.0.0 The OpenClaw AgentSkills skill bundle for 'code-search' is benign. The `SKILL.md` instructions are clear, focused on code search, and contain no prompt injection attempts. The core `scripts/search.sh` script correctly uses shell arrays (`"${args[@]}"`) when invoking external commands (`rg`, `fd`, `tree`), effectively preventing shell injection vulnerabilities. All operations are explicitly stated and confirmed to be read-only, with no evidence of data exfiltration, persistence mechanisms, or other malicious activities. The dependency checks and installation instructions are also benign, merely providing guidance without attempting unauthorized installations.
Capability Assessment
Purpose & Capability
Name/description match the implementation: the SKILL.md and scripts provide grep/glob/tree commands implemented by search.sh and rely on rg/fd/tree, which is exactly what the skill claims to do.
Instruction Scope
Runtime instructions call the included shell script with explicit subcommands; the script performs only read-only searches, checks for dependencies, and prints structured output. It does not read unrelated configuration, attempt network exfiltration, or reference unexpected external endpoints at runtime.
Install Mechanism
This is instruction-only (no install spec). The repository includes a shell script only; design docs mention possible curl-based downloads for installing rg/fd as optional manual guidance, but the skill itself does not automatically download or extract remote payloads.
Credentials
The skill requires no environment variables, credentials, or config paths. All requested operations are local, and any permissions needed are typical for read access to the workspace and for installing CLI tools if the user chooses to follow install guidance.
Persistence & Privilege
always is false and the skill does not request persistent system-wide changes. The script does not modify other skills or system configuration; it only checks for binaries and reads files.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install code-search
  3. After installation, invoke the skill by name or use /code-search
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: grep/glob/tree via ripgrep, fd, tree
Metadata
Slug code-search
Version 1.0.0
License
All-time Installs 4
Active Installs 4
Total Versions 1
Frequently Asked Questions

What is Code Search?

Search codebase contents, filenames, or directory structures using ripgrep, fd, and tree with filters for file types, context, depth, and result limits. It is an AI Agent Skill for Claude Code / OpenClaw, with 494 downloads so far.

How do I install Code Search?

Run "/install code-search" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Code Search free?

Yes, Code Search is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Code Search support?

Code Search is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Code Search?

It is built and maintained by Yanxingang (@yanxingang); the current version is v1.0.0.

💬 Comments