code-search
/code-search
Dobiera narzędzie do szukania kodu w repozytorium: ripgrep, wyszukiwanie semantyczne sgrep przy gotowym indeksie oraz gopls i rush ts dla dokładnych referencji.
- Autor
- langwatch ↗
- Repozytorium
- langwatch ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 1
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
- 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: sgrep.sh
Co robi i kiedy
Dobiera narzędzie do szukania kodu w repozytorium: ripgrep, wyszukiwanie semantyczne sgrep przy gotowym indeksie oraz gopls i rush ts dla dokładnych referencji.
Wyzwalacze z opisu
Argumenty
/code-search [status <dir> | query <dir> "<question>" | index <dir>]
Oryginalny opis (EN)
Pick the right tool to find code in this repository: ripgrep when you know the word, sgrep (search by meaning) when an index is ready, ripgrep while an index builds, gopls and `rush ts` for exact references. Use when someone says 'find where', 'search the code', 'which file handles', 'grep for', 'sgrep', 'semantic search', 'search by meaning', 'index the repo', 'is the index ready', 'code search', or before sweeping an unfamiliar area of the tree.
Jak działa
- Which tool
- The helper
- Install
Podgląd SKILL.md
---
name: code-search
description: "Pick the right tool to find code in this repository: ripgrep when you know the word, sgrep (search by meaning) when an index is ready, ripgrep while an index builds, gopls and `rush ts` for exact references. Use when someone says 'find where', 'search the code', 'which file handles', 'grep for', 'sgrep', 'semantic search', 'search by meaning', 'index the repo', 'is the index ready', 'code search', or before sweeping an unfamiliar area of the tree."
user-invocable: true
argument-hint: '[status <dir> | query <dir> "<question>" | index <dir>]'
---
# Code search
Measured on this repository, 2026-10-14 (busy host, so times are rough):
| Tool | Setup | Per search | Finds the right code |
| -------------------- | -------------------------- | ------------------------ | ------------------------------------ |
| `rg` | none | 0.06-0.8 s | given the word, in non-ignored files |
| `git grep` | none | 0.07-2.4 s | same; tracked files only |
| `grep -r` | none | 18-34 s | same, but walks every `node_modules` |
| sgrep, no index | n/a | won't run | n/a |
| sgrep, indexed | `modules/` 26 min, ~500 MB | 0.1-0.3 s | about half, by meaning |
| gopls `references` | none | 4-15 s | exact |
| `rush ts references` | none | ~30 s cold, then seconds | exact; needs file and line |
## Which tool
```
know the identifier? ── yes ──▶ rg -n -w <identifier> <dir>
know a literal string or code? ── yes ──▶ rg -n -F '<string>' <dir>
│ no
▼
sgrep.sh status <dir> ── ready ──▶ sgrep.sh query <dir> "<question>"
│ then confirm with rg on the names it found
│ building / none
▼
guess two or three likely words ──▶ rg -n -i -e a -e b <dir>
need every caller of a Go symbol, exactly? ──▶ gopls references file.go:line:col
```
- **ripgrep first.** It needs nothing and never misses a literal match in the files it searches
(everything not excluded by `.gitignore` or `.rgignore`; see below). Never `grep -r`.
Give `rg` an explicit path: with no path and no terminal it reads stdin and hangs.
- **sgrep only when the index is ready.** A query against a missing or half-built index is
wrong or empty, so the helper refuses (exit 3) and you use `rg`. sgrep answers roughly half
the "where is X done" questions; treat its hits as leads and confirm them with `rg`.
- **While an index builds, use `rg`.** Don't wait for it.
- **Exact references:** `gopls references` for Go. `rush ts references --file F --line N --symbol S`
for TypeScript, and `rush ts rename` / `rename-file` for renames and moves. Always give the file
and line: a lookup by name alone loads every project and is slow here.
- sgrep skips tests, generated and vendored files itself; pass `-t` to include tests.
- `rg` skips the generated files listed in the root `.rgignore` (lockfiles, snapshots, generated
clients and READMEs). Searching for something that only lives there, such as a handled-error
code in `codes.generated.ts`? Add `--no-ignore-dot`. After adding a `linguist-generated` line
to `.gitattributes`, regenerate `.rgignore` with the command in its header.
## The helper
`.claude/skills/code-search/sgrep.sh` wraps sgrep so you don't handle its embedding server:
| Command | Does |
| ------------------------------------------------------------- | -------------------------------------------------------- |
| `sgrep.sh status modules/trace` | `ready: <dir>` (exit 0), or `building` / `none` (exit 3) |
| `sgrep.sh query modules/trace "where spans are written" -n 5` | search the index covering that path; exit 3 = use `rg` |
| `sgrep.sh index modules/trace` | build an index in the background; prints the log path |
| `sgrep.sh stop` | stop the embedding server it started |
Extra arguments after the question go to sgrep (`-n 5`, `-t`, `--profile fast`, `--json`).
Index one area (`modules/<name>`, `services/<name>`), not the root: the whole tree takes
2-3 hours. A Go service of ~300 files takes under two minutes.
The index lives in `~/.sgrep` (outside the checkout), so git never sees it. An index belongs to
one absolute path: a worktree does not share the main checkout's, so `status` there says `none`.
Indexes stay until removed (`modules/` is about 500 MB); `sgrep.sh stop` stops the server only.
`sgrep list` shows them; `cd <dir> && sgrep clear` deletes one.
## Install
`brew install xiaoconstantine/tap/sgrep` (after `brew trust --formula xiaoconstantine/tap/sgrep`).
If brew refuses over outdated Command Line Tools, download the release tarball named in the
formula, check its sha256 against the formula, and put the binary at `.bin/sgrep/sgrep`.
Needs `llama-server` (`brew install llama.cpp`); the helper downloads the model on first index.
Pliki w paczce (2)
- SKILL.md 5 KB
- sgrep.sh 4 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · langwatch/langwatch | 100 | Apache-2.0 |
| edmundmiller/dotfiles | 100 | MIT |
| atretyak1985/swarmery | 100 | Apache-2.0 |
| athola/claude-night-market | 100 | MIT |
| elastic/sourcerer | 100 | Apache-2.0 |
| brettatoms/agent-skills | 100 | MIT |
| agentscope-ai/agentscope-java | 90 | Apache-2.0 |
Migawka bazy z 13.11.2026 · wersja paczki d4f21e917a35 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100sgrep
Wyszukuje kod i rozmowy z agentami według znaczenia, łącząc wyszukiwanie semantyczne z dosłownym, gdy szukasz po intencji. - 95file-search
Szuka plików i treści w kodzie przez fd, ripgrep i fzf, w tym wyszukiwanie rozmyte. - 100file-search
Przeszukuje bazy kodu szybko: tekst przez ripgrep, a wzorce strukturalne przez ast-grep, który rozumie składnię. - 95mgrep-code-search
Wyszukuje kod semantycznie przez mgrep, gdy repozytorium ma ponad 30 plików lub zagnieżdżone katalogi, uzupełniając grep i ripgrep. - 100rg-code-search
Szybko przeszukuje kod narzędziem ripgrep (rg): korzysta z wyrażeń regularnych, filtruje pliki i pomaga w analizie wielu plików naraz. - 90ripgrep
Pomaga pisać polecenia ripgrep do wyszukiwania tekstu i wyrażeń regularnych, z filtrowaniem plików i diagnozą pominiętych plików.