Local-first codebase intelligence with semantic search, multi-hop research, and 12-language AST support
Project description
Sia Code
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
Why teams use it
- 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
Install
# pip
pip install sia-code
# pip with MCP server support
pip install "sia-code[mcp]"
# or uv tool
uv tool install sia-code
# MCP entrypoint from PyPI/local checkout
uv tool install "sia-code[mcp]"
# verify
sia-code --version
sia-code-mcp --help
Quick Start (2 minutes)
# 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 Cheatsheet
| 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 memory working-set "query" |
Build shared working-memory JSON for agents |
sia-code memory trace "query" |
Trace likely causal timeline events for query |
sia-code config show |
Print active configuration |
Search Modes (important)
- 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.
Git Sync Memory + Semantic Changelog
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 working-set "auth flow" --agent planner --session-id ses-123
sia-code memory trace "why did command parsing change" --format table
sia-code memory add-decision "Keep sqlite-vec default" \
-d "Need a stable local-first backend baseline" \
-r "Consistent behavior across environments" \
--link-file sia_code/config.py \
--link-symbol default_backend \
--link-timeline "feature/sqlite-vec->main"
sia-code memory changelog --format markdown
LLM CLI Integration
Primary integration is now the packaged MCP server:
sia-code-mcp
For engineering workflows, the preferred first MCP call is:
engineering_bootstrap
It bundles readiness checks, lightweight search, optional memory retrieval, and guarded multi-hop research so MCP-aware clients can use Sia Code effectively with only a bare MCP server configuration.
Integration guide:
docs/MCP_INTEGRATION.mddocs/LLM_CLI_INTEGRATION.md
Fallback skill file for environments without MCP support:
skills/sia-code/SKILL.md
Configuration
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.0
Note: backend selection is auto by default (sqlite-vec for new indexes, legacy usearch supported).
Multi-Worktree / Multi-Agent Setup
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-index
Typical 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 --update
When 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
Documentation
docs/CLI_FEATURES.md- concise CLI command referencedocs/MCP_INTEGRATION.md- MCP setup and transport notesdocs/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
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sia_code-0.8.0.tar.gz.
File metadata
- Download URL: sia_code-0.8.0.tar.gz
- Upload date:
- Size: 170.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d3aaa0c35284899ee550538943b6983647d0109903f838c420ce4bb5d9186af
|
|
| MD5 |
63c67f530e60ac48c67e7b0ac0e47325
|
|
| BLAKE2b-256 |
f7746b39c58ac2abc275d7f5f114cf15ec4fd74813554ea7194c6bfe984349b2
|
Provenance
The following attestation bundles were made for sia_code-0.8.0.tar.gz:
Publisher:
release.yml on DxTa/sia-code
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sia_code-0.8.0.tar.gz -
Subject digest:
7d3aaa0c35284899ee550538943b6983647d0109903f838c420ce4bb5d9186af - Sigstore transparency entry: 2033468709
- Sigstore integration time:
-
Permalink:
DxTa/sia-code@acf95941c30a2a36d5a17ae9aa7ab42f281234fe -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DxTa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@acf95941c30a2a36d5a17ae9aa7ab42f281234fe -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sia_code-0.8.0-py3-none-any.whl.
File metadata
- Download URL: sia_code-0.8.0-py3-none-any.whl
- Upload date:
- Size: 176.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a8d5bec5057bc1cd9a5f9097b825bd74acf06eee3e4bf114fb5039d7f2483bb
|
|
| MD5 |
f9c8eacddb7a2744bb026c788167fe56
|
|
| BLAKE2b-256 |
c23da64296441ac9527be6f76377173c28d51fd83bc4e72b08e045cd89b4ef1b
|
Provenance
The following attestation bundles were made for sia_code-0.8.0-py3-none-any.whl:
Publisher:
release.yml on DxTa/sia-code
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sia_code-0.8.0-py3-none-any.whl -
Subject digest:
9a8d5bec5057bc1cd9a5f9097b825bd74acf06eee3e4bf114fb5039d7f2483bb - Sigstore transparency entry: 2033469146
- Sigstore integration time:
-
Permalink:
DxTa/sia-code@acf95941c30a2a36d5a17ae9aa7ab42f281234fe -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DxTa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@acf95941c30a2a36d5a17ae9aa7ab42f281234fe -
Trigger Event:
workflow_dispatch
-
Statement type: