Local codebase indexing + remote GLM (Z.AI) via OpenAI-compatible API + Claude plugin hooks.
- Install the Claude plugin by pointing Claude Code to
claude-plugin/. - On first session start, the plugin will run
scripts/bootstrap.sh. - Set
IGREP_API_KEY, then runclaude-plugin/scripts/server_up.sh; index updates on file write/edit.
This repo includes a public Claude Code skill at:
claude-code-skill/igrep-claude-code
Install it by copying that folder into your Claude Code skills directory (e.g. ~/.claude/skills/) or by pointing Claude Code at the folder directly.
If you want Claude Code Grep usage to be routed through igrep, add a
PreToolUse hook in your project .claude/settings.local.json.
See claude-code-skill/igrep-claude-code/references/claude-hooks.md for the
ready-to-paste JSON.
Manual bootstrap:
bash scripts/bootstrap.shManual server start:
export IGREP_API_KEY="<your-zai-key>"
uv run python server/provider_runtime.py --profile glm_47_flash_zaiThe Claude plugin helper claude-plugin/scripts/server_up.sh now starts the
provider in the background by default (set IGREP_SERVER_BACKGROUND=0 to keep
it in the foreground).
export IGREP_API_KEY="<your-zai-key>"
uv run python eval/chat_perf.py --model glm-4.7-flashThis prints a simple tokens-per-second stat for a single request.
Build the hierarchical index (files + section nodes):
uv run igrep index-buildBy default this performs a fast, non-LLM pass. If an API key is configured,
igrep will spawn a background LLM enrichment build and swap it in once ready.
Disable with --no-llm-background or IGREP_LLM_BACKGROUND=0. Use
--llm-index to run the LLM pass in the foreground.
Build an index for a different repo root:
uv run igrep index-build --repo-root test-codebase/stitchcraft/backend --store indexer/store/test-backend-fast.sqlite3 --no-llm-indexFor new repos with LLM enrichment, igrep asks the LLM which top-level runtime /
external dirs to ignore and writes them to indexer/store/llm-runtime-ignores.md.
Code is prioritized by default; runtime dirs are only included when explicitly requested:
export IGREP_API_KEY="<your-zai-key>"
IGREP_CODE_ONLY=1 IGREP_PROGRESS=1 \
uv run igrep index-build \
--repo-root test-codebase/stitchcraft \
--store indexer/store/test-stitchcraft-llm-code.sqlite3 \
--llm-index --llm-max-nodes 6To refresh the LLM-generated ignore list:
IGREP_LLM_IGNORES_REFRESH=1 uv run igrep index-build ...To include runtime/environment-heavy dirs, set:
IGREP_INCLUDE_RUNTIME=1 uv run igrep index-build ...Important app dirs (like frontend and backend) are protected from being
ignored. You can add more via:
IGREP_PROTECT_DIRS="frontend,backend,packages" uv run igrep index-build ...To push LLM enrichment up to the provider rate limit, increase concurrency and retries:
IGREP_LLM_CONCURRENCY=16 IGREP_LLM_MAX_RETRIES=8 uv run igrep index-build --llm-index ...Incrementally update it (fast pass + optional background LLM update):
uv run igrep index-updateParallelize updates (changed files are processed concurrently):
IGREP_UPDATE_WORKERS=32 uv run igrep index-updateSkip huge directories during indexing (also applied to the RG baseline):
IGREP_EXTRA_IGNORE_DIRS="some-big-dir,another-one" uv run igrep index-build ...Search with complete section context:
uv run igrep search "bootstrap submodules" --window 1Target a specific index file (useful for test codebases):
uv run igrep search "createApp" --store indexer/store/test-backend-fast.sqlite3 --no-rlm --limit 0 --window 0By default, search uses two-stage retrieval (RLM) and no Stage-1 limit. To disable Stage 2 and use only the index:
uv run igrep search "bootstrap submodules" --no-rlm --limit 0Two-stage search with RLM (Stage 1 index + Stage 2 refinement, run in parallel):
export IGREP_API_KEY="<your-zai-key>"
uv run igrep search "bootstrap submodules" --rlm --model glm-4.7-flash --max-iterations 8 --rlm-timeout 15 --seed-limit 8Mismatch-first view (RG vs. index differences “in your face”):
export IGREP_API_KEY="<your-zai-key>"
uv run igrep search "mySymbol" --rlm --model glm-4.7-flash --mismatch-only --rlm-timeout 15Line-based hits are now part of the index (symbols, refs, imports, calls, line hits) and are mapped back to PageIndex nodes for compact context.
Find where a symbol is used:
uv run igrep uses build_indexShow dependencies for a file or symbol:
uv run igrep deps indexer/tree_index.py
uv run igrep deps build_indexThese default to a thin output (no full context blocks). If your project needs
noise filtering, set IGREP_NOISE_PREFIXES (or a noise-prefixes.md file) and
the skill will enable it. Add --context for larger context, and --window to
include neighbor sections. Use --include-noise to override the filter.
Run LLM enrichment in the foreground (blocking) for better titles, summaries, and tags:
export IGREP_API_KEY="<your-zai-key>"
IGREP_LLM_INDEX_MAX_NODES=8 uv run igrep index-build --llm-indexYou can also use it on update:
export IGREP_API_KEY="<your-zai-key>"
uv run igrep index-update --llm-index --llm-max-nodes 6To disable background LLM processing entirely:
IGREP_LLM_BACKGROUND=0 uv run igrep index-buildMarkdown sections are parsed with PageIndex and then token-thinned to reduce section count while keeping context. Tune the minimum token budget per node:
IGREP_PAGEINDEX_MIN_TOKENS=160 uv run igrep index-build