code_search
code_search lets the AI grep code quickly—lighter and faster than unified_search.code_search, tuned for:
| scope | Finds | Backend |
|---|
scope="sandbox" | Code temporarily downloaded/generated in the current session sandbox | ripgrep + ast-grep |
scope="kb" | Zero/light-index code in the KB (no need to wait for heavy indexing) | ripgrep + ast-grep over local cache |
Heavy-index code features (trigram, cross-repo navigate, vector semantic) use unified_search.code_search. code_search does not cover those.
| Scenario | Tool |
|---|
| AI just cloned a repo to sandbox and needs a fast lookup | code_search(scope="sandbox") |
| KB attached a zero/light code KB; text/AST grep | code_search(scope="kb", kb_ids=[...]) |
| Cross-repo “who calls this function” needs the semantic graph | unified_search.code_search(mode="navigate") |
| Natural language code search needs vectors | unified_search.code_search(mode="semantic") |
| mode | Engine | Best for |
|---|
text | ripgrep | Literals, regex, filenames |
ast | ast-grep | Structural queries (“every try/except without logging”) |