Przejdź do treści
Biblioteka skilli
Programowanie · Research

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.

Repozytorium
langwatch ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co sprawdzić przed instalacją
  • 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

find wheresearch the codewhich file handlesgrep forsgrepsemantic searchsearch by meaningindex the repo

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

  1. Which tool
  2. The helper
  3. Install
Sekcje z nagłówków SKILL.md, w oryginale · 73 linii, 676 słów
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

RepozytoriumWynikLicencja
Ta strona · langwatch/langwatch100Apache-2.0
edmundmiller/dotfiles100MIT
atretyak1985/swarmery100Apache-2.0
athola/claude-night-market100MIT
elastic/sourcerer100Apache-2.0
brettatoms/agent-skills100MIT
agentscope-ai/agentscope-java90Apache-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.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.