Local-first codebase intelligence for CLI workflows.
Sia Code indexes your repo and lets you:
- search code fast (lexical, semantic, or hybrid)
- trace architecture with multi-hop research
- store/retrieve project decisions and timeline context
- Works directly on local code (
.sia-code/index per repo/worktree) - Great for symbol-level search (
--regex) and architecture questions (research) - Supports 12 AST-aware languages (Python, JS/TS, Go, Rust, Java, C/C++, C#, Ruby, PHP)
- Integrates well with LLM CLI agents
# pip
pip install sia-code
# or uv tool
uv tool install sia-code
# verify
sia-code --version# in your project
sia-code init
sia-code index .
# search
sia-code search --regex "auth|login|token"
# architecture trace
sia-code research "how does authentication work?"
# index health
sia-code status| Command | What it does |
|---|---|
sia-code init |
Initialize .sia-code/ in current project |
sia-code index . |
Build index |
sia-code index --update |
Incremental re-index |
sia-code index --clean |
Rebuild index from scratch |
sia-code search "query" |
Hybrid search (default) |
sia-code search --regex "pattern" |
Lexical search |
sia-code research "question" |
Multi-hop relationship discovery |
sia-code memory sync-git |
Import timeline/changelog from git |
sia-code memory search "topic" |
Search stored project memory |
sia-code config show |
Print active configuration |
- Default command is hybrid:
sia-code search "query" - Lexical mode:
sia-code search --regex "pattern" - Semantic-only mode:
sia-code search --semantic-only "query"
Use --no-deps when you want only your project code.
sia-code memory sync-git is the fastest way to build project memory from git history.
- Scans tags into changelog entries
- Scans merge commits into timeline events
- Stores
files_changedand diff stats (insertions,deletions,files) - Optionally enhances sparse summaries using a local summarization model
How semantic summary generation works:
sync-gitcollects git context (tags, merges, commit ranges, diff stats)- It gathers commit subjects for each release/merge window
- A local model (default
google/flan-t5-base) generates a concise summary sentence - The enhanced summary is stored in memory and later exposed by
memory changelog
sia-code memory sync-git
sia-code memory changelog --format markdownThis repo includes a compact reusable skill at:
skills/sia-code/SKILL.md
Integration guide:
docs/LLM_CLI_INTEGRATION.md
In short: copy that skill file into your LLM CLI skill directory, then load sia-code in your session.
Config path:
.sia-code/config.json
Useful commands:
sia-code config show
sia-code config get search.vector_weight
sia-code config set search.vector_weight 0.0Note: backend selection is auto by default (sqlite-vec for new indexes, legacy usearch supported).
Yes - Sia Code works with multiple git worktrees and multiple LLM CLI instances.
Scope resolution order:
SIA_CODE_INDEX_DIR(explicit path override)SIA_CODE_INDEX_SCOPE(shared,worktree, orauto)autofallback:- linked worktree -> shared index at
<git-common-dir>/sia-code - normal checkout -> local
.sia-code
- linked worktree -> shared index at
# Shared index across worktrees/agents
export SIA_CODE_INDEX_SCOPE=shared
# Isolated index per worktree
export SIA_CODE_INDEX_SCOPE=worktree
# Full explicit control
export SIA_CODE_INDEX_DIR=/absolute/path/to/sia-indexTypical worktree workflow:
# in main checkout (build shared index once)
export SIA_CODE_INDEX_SCOPE=shared
sia-code init
sia-code index .
# create feature worktree
git worktree add ../feat-auth feat/auth
cd ../feat-auth
# reuse same shared index, then incrementally refresh
sia-code status
sia-code index --updateWhen a worktree is merged/removed:
sharedscope: index stays in git common dir and remains usableworktreescope: index lives in that worktree directory and is removed with it- after merge, run
sia-code index --updatein the remaining checkout
Practical guidance:
- Many readers/searchers are fine in shared mode
- Prefer one active index writer per shared index
- For strict branch/agent isolation, use
worktree - Teams on different machines should keep local indexes and sync context via git +
sia-code memory sync-git
docs/CLI_FEATURES.md- concise CLI command referencedocs/CODE_STRUCTURE.md- repo/module mapdocs/ARCHITECTURE.md- core runtime architecturedocs/INDEXING.md- indexing behavior and maintenancedocs/QUERYING.md- search modes and tuningdocs/MEMORY_FEATURES.md- memory workflowdocs/BENCHMARK_RESULTS.md- benchmark summary
MIT