---
name: agentscope-ai-code-search
description: "Search a codebase efficiently with ripgrep regular expressions, file globs, and git history search. Use to locate symbols, usages, and definitions instead of reading whole files."
metadata:
  decimalai-skill-id: "87778ad9-e709-43d3-b168-f68316654b0c"
  decimalai-version-id: "db97a8ac-021f-4473-8365-cda44ffaefe7"
  decimalai-version: "1"
  decimalai-body-sha256: "e4c28b3d697686e4c831da921ce1f418cf6ac256fe5cd9d9f6f46d9b20b3d473"
  decimalai-name: "agentscope-ai/code-search"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "coding"
  decimalai-source: "https://app.decimal.ai/s/agentscope-ai-code-search@1/SKILL.md"
---
# Code Search

The built-in `grep` tool matches LITERAL text only. For real regular-expression search and
history-aware lookups, drive ripgrep and git through `execute`.

## Ripgrep (regex)

- Symbol definition: `rg -n "fn\s+\w+\(" src/`, `rg -n --type java "class \w+Service"`.
- Usages of a name: `rg -n "\bmyFunction\b"`.
- Limit by file type: `rg -n --type ts "useEffect\("`.
- List files only: `rg -l "TODO"`; find files by name: `rg --files | rg <name>` or use `glob`.

## Git history search

- When a string was introduced/removed: `git log -S "<string>" --oneline`.
- Who/why a line changed: `git blame -L <start>,<end> <file>`.
- Search tracked files: `git grep -n "<regex>"`.

## Tips

- Prefer a targeted regex over reading whole files when locating symbols or call sites.
- Escape regex metacharacters when you want a literal match, or pass `-F` to ripgrep.
- Narrow scope with a path argument to keep output small (tool output is truncated).
