Download a binary from the GitHub releases. A v*.*.* tag publishes these archives and a SHA256SUMS file:
| Platform | Archive |
|---|---|
| Linux x86_64 | wikifier-<version>-x86_64-unknown-linux-gnu.tar.gz |
| macOS Apple silicon | wikifier-<version>-aarch64-apple-darwin.tar.gz |
| macOS Intel | wikifier-<version>-x86_64-apple-darwin.tar.gz |
| Windows x86_64 | wikifier-<version>-x86_64-pc-windows-msvc.zip |
Check SHA256SUMS, unpack, and put wikifier (wikifier.exe on Windows) on your PATH.
# Linux x86_64, 5.0.0
curl -fsSL -O https://github.com/IronAdamant/wikifier/releases/download/v5.0.0/SHA256SUMS
curl -fsSL -O https://github.com/IronAdamant/wikifier/releases/download/v5.0.0/wikifier-5.0.0-x86_64-unknown-linux-gnu.tar.gz
sha256sum --check --ignore-missing SHA256SUMS
tar -xzf wikifier-5.0.0-x86_64-unknown-linux-gnu.tar.gz
./wikifier --versionOr build from source. [dependencies] is empty:
git clone https://github.com/IronAdamant/wikifier
cd wikifier
cargo build --release
./target/release/wikifier --versionpip install wikifier still installs the archived Python 4.7 package.
A zero-dependency codebase wiki for AI agents. Token-efficient maps so LLMs look things up instead of re-reading full sources.
Wikifier is an agent-to-agent tool: it builds a living map of a project (health matrix, dependency graph, short file summaries) and agents keep that map current as they work. Humans can peek via a small dashboard; the product is the agent loop, not a general docs site or IDE.
Agents working in this repository start at AGENTS.md. The day-to-day contract is skills/run.md.
Works from small scripts to large monorepos. Deep import/include maps (zero-dependency parsers):
| Language | Extensions | Notes |
|---|---|---|
| Python | .py |
comment-masked regex; relative imports and same-tree module paths; an indented import is flagged conditional |
| JavaScript / TypeScript | .js .ts .jsx .tsx .mjs .cjs .mts .cts |
comment-masked regex; named re-exports followed to depth 8; import() flagged dynamic |
| Rust | .rs |
mod, use, crate::, self::, super::, and package or lib names from the root Cargo.toml and from [workspace] members (globs included). - becomes _. A member name points at that member's library. crate:: stays inside the crate that owns the file, including tests/ and src/bin/ |
| Go | .go |
import / import blocks |
| C / C++ | .c .h .cpp .cc .cxx .hpp .hh |
#include (local + system) |
| C# | .cs |
using namespaces |
| Java | .java |
import / import static |
JavaScript and TypeScript resolution also reads tsconfig.json paths, package.json exports, and npm workspaces. Health/journal still work for any monitored path. The non-Python parsers are pragmatic regex (not full cargo/go.mod/classpath/-I resolution). On huge monorepos, split scope deliberately:
| File | Surface |
|---|---|
map_paths.txt |
Package roots for import maps (update-maps walk). Prefer package dirs (src/, packages/foo/) β not a wiki-only file list. |
monitored_paths.txt |
Wiki / health watch list (can be individual .md files). Does not define the map. |
Or pass --directory=pkg/ / --max-files=N per run. Raise dirty cap with WIKIFIER_CHECK_CHANGES_MAX (default 2000) only when needed. Never set project_root to a multi-repo parent of clones.
Context windows are finite. Re-reading a large file to answer βwhat is this and who depends on it?β wastes tokens.
| Artifact | Role |
|---|---|
file_health.md |
π’ / π‘ / π΄ matrix β what to trust, what to fix first |
library.md |
File tree, Mermaid dependency map, import tables, cycles + confidence |
*.wiki.md |
Short per-file βwhat this is forβ notes (agent-maintained prose) |
journal/ + pending_updates.md |
Semantic why trail + work queue (audit, not a full issue tracker) |
Map first, wiki depth second: update-maps builds the structural map automatically. Rich per-file wiki text is filled by agents as they work β not a free full-repo βunderstand everythingβ pass on init.
cargo build --release # std-only Rust binary β no crates.io dependencies
./target/release/wikifier --version
cd /path/to/your/project
./path/to/wikifier init # seeds lean path-list templates
# Edit monitored_paths.txt + map_paths.txt to package roots (not bare ".") on real trees
wikifier update-maps # full structural map β library.md + import cache
wikifier health --summary # matrix counts
wikifier suggest-next # or MCP suggest_next_actions β π΄/π‘ onlyAlways set an explicit root for external trees: WIKIFIER_PROJECT_ROOT=/abs/path wikifier β¦
MCP session_bootstrap β readiness: blocked? That means lean scope and/or the map are missing (often bare . monitor + never ran update-maps) β not a broken install. Fix: write lean monitored_paths.txt / map_paths.txt, then update-maps. Agent contract: skills/run.md Β§ Readiness.
Full protocol: skills/run.md (Agent Protocol v0.7 β package 5.0.0).
wikifier session-bootstrap # one-shot: root, health, attention, actions[], names-only map_index
wikifier check-changes # content-honest dirty; red ghosts (missing paths)
# prioritize π΄ then *actionable* π‘ β do NOT re-wiki π’ Green files
wikifier prepare-edit path/file.py # wiki + status + deps/dependents preflight
# ... edit only those sources ...
wikifier record-change "path/file.py" "why this changed" # required
# ... refresh that fileβs wiki summary only ...
wikifier mark-green "path/file.py" # refused if the wiki misses public symbols you added/removed
# many files at once (reasons per path, glob or dir/; git supplies the file list):
wikifier record-changes -r "src/api/=retry on 429" -r "tests/=cover retries" --only src/ --only tests/ --green
wikifier update-maps # only if imports/structure changed (warm 0-dirty is cheap)
# removals:
wikifier record-deletion "path/gone.py" "why removed"Core 6 (prefer every session β MCP or library/CLI):
session_bootstrap β check_changes β prepare_edit β suggest_next_actions (json actions[]) β record_change β mark_green.
Advanced intel as needed: list_paths (names-only folder expand), get_dependencies, get_dependents, get_cycles, barrels/diagnostics. Always pass project_root= / WIKIFIER_PROJECT_ROOT for external trees. Never point project_root at a multi-repo parent folder (e.g. a directory of clones).
Map split: update-maps writes two views from the same import cache β human library.md (File Tree + mermaid, dashboard only) and sharded agent folder cards (.wikifier_staging/maps/, depth-1). Bootstrap returns the root card; list_paths expands one folder; prepare_edit follows file-to-file links. Do not read library.md mermaid for orientation.
- Import analysis β comment-masked regex for Python, JS/TS, Rust, Go, C/C++, C#, and Java. Named JS/TS re-exports are followed to depth 8. Edges carry conditional, dynamic, and via-barrel flags, and a confidence read from those flags.
- Incremental pipeline β
update-mapsparses files whose size or mtime changed, then writes thewk_cachetext index, reverse edges,library.md, and sharded folder cards. - Two path lists β
map_paths.txt= map package roots;monitored_paths.txt= extra watch list (docs, scripts).check-changesalways watches mapped files and anything ever marked Green, so a narrow list never hides edits. - Green you can trust β
mark-greenchecks the wiki against Python, JS/TS, and Rust public symbols and refuses when a public name is missing, a removed name is still in backticks, or the public surface changed while the wiki file did not. Rust names are unrestrictedpubitems, including methods and associated items on a public type and the items written in a trait impl for that type.pub(crate),pub(super),pub(self), andpub(in ...)stay out of that set. Go, C/C++, C#, and Java are recorded as unchecked.verify-wikisre-checks every Green wiki.health --summaryincludesgreen_breakdown. - Partial-map honesty β
--max-filesreturnsmap_complete=falseandfiles_remaining_dirty. Run the same command again to resume. Already-parsed files are stat-skipped. - Cache β
.wikifier_staging/wk_cache.wikifier cache-statusreports the backend and the file count. An empty cache importsimport_cache.sqlitethrough thesqlite3CLI, orimport_cache.json. - Selective agent work β health and
suggest-nextstay on π΄ and actionable π‘. Diagnostics list ACS reason codes andactionable_low_conf_edges. - Scale β dependents and dependencies read one edge index. Unchanged files are skipped by size and mtime.
--fullrehashes. - MCP β
wikifier mcpin the same binary. A failed tool call setsisError. Calls stop atWIKIFIER_MCP_DEADLINE_S(default 60 seconds). - Zero core dependencies β empty
[dependencies]inCargo.toml. - Honest failures β a missing
project_root, missing file, or lock timeout is an error result, never a silent fallback.wikifier.shlaunches the Rust binary.
Full / heavy runs (historical order-of-magnitude):
| Project | Scale | Full / heavy update-maps |
|---|---|---|
| llama_index | ~3.8k Python files | ~8.5s class full |
| Babylon.js | ~3.9k TS files, barrel-heavy | minutes full; scoped re-runs tens of seconds |
| Large trees (e.g. LLVM-scale) | tens of thousands of files | map_paths / --directory / --max-files β never unscoped one-shot |
Warm 0-dirty re-runs after 4.6.7 (same machine class; scoped; candidates reused β agent session path). These numbers are from the Python package. This repo's map roots are now src/ and tests/.
| Project | Scope | Warm update-maps |
n |
|---|---|---|---|
| Wikifier (self, Python era) | map_paths: wikifier/ + tests/ |
~30 ms | 50 |
| llama_index | llama-index-core |
~76 ms | 724 |
| rust | library/std |
~79 ms | 719 |
| airflow | airflow-core |
~180 ms | 1920 |
| Babylon.js | packages |
~400 ms | 3895 |
Residual floor on large scopes is mtime/stat + live count under MapScope (not full JSON re-walk). Sub-100ms is not a hard SLA on every 1k+ tree.
Python 4.7 at 24812ef versus the Rust binary recorded in scripts/benchmark_results.md (that binary reported 4.7.0). 5.0.0 is that program. 5 runs, median milliseconds (minβmax). Machine: Intel Xeon, 4 cores, 15.6 GiB RAM, Linux 6.12.94+, Python 3.12.3, rustc 1.83.0. Cold deletes .wikifier_staging first. Warm is the next update-maps. Full notes, peak RSS, and commands are in that file. Reproduce with scripts/benchmark_parity.sh.
| Command | small Python | small Rust | medium Python | medium Rust | large Python | large Rust |
|---|---|---|---|---|---|---|
startup (--version) |
63 (61β66) | 2 (1β2) | same pair | same pair | same pair | same pair |
| cold update-maps | 123 (121β126) | 8 (7β13) | 167 (163β168) | 62 (59β73) | 12675 (12540β13094) | 3142 (3114β3305) |
| warm update-maps | 69 (67β72) | 4 (3β5) | 73 (72β74) | 4 (4β5) | 422 (417β433) | 246 (243β253) |
| session-bootstrap | 66 (64β67) | 2 (1β2) | 65 (64β67) | 2 (1β2) | 270 (269β278) | 21 (21β21) |
| check-changes | 64 (62β65) | 3 (2β3) | 70 (69β75) | 5 (5β6) | 1232 (1217β1266) | 74 (73β76) |
| health --summary | 60 (60β62) | 2 (1β2) | 60 (59β63) | 1 (1β2) | 109 (108β114) | 8 (8β9) |
| verify-wikis | 60 (60β61) | 2 (1β2) | 62 (60β67) | 1 (1β2) | 106 (103β108) | 8 (7β8) |
| cycles | 60 (60β61) | 2 (1β2) | 61 (60β63) | 2 (2β2) | 63 (61β64) | 54 (53β55) |
Resolved file edges after a warm map: small 2 and 2, medium (this repo) 44 Python and 98 Rust, large (Django django/ + tests/, 2939 Python files) 9074 and 9074. Rust cold update-maps peak RSS was 3384 / 4424 / 40012 kbytes; Python was 27544 / 28392 / 97564 kbytes. The release binary is 2197456 bytes.
Small is three modules under src/pkg. Medium is src/ and tests/. Large is a shallow clone of Django.
cargo test checks internal edges on the frozen accuracy layouts:
| Fixture | 4.6.13 precision / recall | 4.7.0 precision / recall |
|---|---|---|
| Django app (absolute app imports) | 1.00 / 0.29 | 1.00 / 1.00 |
src/-layout package |
1.00 / 0.14 | 1.00 / 1.00 |
| TS monorepo (workspaces, paths, barrels) | 1.00 / 1.00 | 1.00 / 1.00 |
| Comment / string / regex traps | 0.29 / 0.67 | 1.00 / 1.00 |
Tests: cargo test (std-only Rust; accuracy fixtures, cache lookups, and the agent-loop commands).
| Command | Purpose |
|---|---|
wikifier init [--target DIR] |
Bootstrap project + human index.html |
wikifier session-bootstrap |
Session start: health, attention, actions[], names-only map_index |
wikifier check-changes |
Content-honest scan β health / pending |
wikifier prepare-edit <file> |
Preflight: status, wiki snippet, deps, dependents |
wikifier list-paths [prefix] |
Depth-1 folder card (names only). --recursive / --depth=0 for a subtree. Then prepare-edit for file links. |
wikifier record-change <file> "reason" |
Log why (required after edits) |
wikifier mark-green <file> [--force] |
Check the wiki against the code, then mark it current (--force + reason overrides) |
wikifier record-changes [-r PATH=WHY]β¦ [--only P]β¦ [--green] [--dry-run] |
Record every file git reports as changed, reasons per path/glob/dir/; nothing written if any reason is missing |
wikifier verify-wikis [dir] |
Re-check every Green wiki against its code (exit 1 on failures) |
wikifier record-deletion <file> "reason" |
Mark removed paths π΄, drop them from the graph, prune barrel refs |
wikifier dependencies <file> [--full] / dependents <file> |
What a file imports (compact; --full for per-edge confidence records) / who imports it (JSON) |
wikifier suggest-next |
Next actions (JSON actions[]; --text for prose). Includes low-confidence edges when any exist |
wikifier update-maps [--directory=src/] [--max-files=N] |
Rebuild graph + human library.md + agent folder maps (warm 0-dirty is fast; honors map_paths.txt) |
wikifier cache-status |
wk_cache backend and mapped file count |
wikifier health [--summary|--format text] |
Health matrix. Default is JSON. --summary is counts only. --text or --format text is prose |
wikifier validate |
Missing wiki rows + ghost paths |
wikifier cycles [--no-analysis] [--max-items N] |
Circular deps, break hints, severity, and who is most depended on |
wikifier heal-stubs [--dry-run] |
Promote Initial stubs whose wiki is at least 350 characters |
wikifier monitor / daemon |
Background maintenance (WIKIFIER_DAEMON_MAPS=0 for check-only) |
wikifier serve |
Localhost dashboard with Run/Stop |
The same operations live in src/api.rs. Agents call the CLI or wikifier mcp. wikifier.sh / wikifier.ps1 / wikifier.bat launch the Rust binary (WIKIFIER_BIN overrides the path). pip install wikifier still installs the archived Python 4.7 package.
WIKIFIER_PROJECT_ROOT=/abs/path/to/project wikifier mcpThis repo's .mcp.json launches wikifier with argument mcp. Tool names and the daily loop are in skills/run.md.
wikifier init drops a single index.html. Prefer wikifier serve (e.g. http://localhost:8787/index.html) β file:// canβt load project files. The markdown artifacts and CLI/MCP tools stay the source of truth; the UI is a read-only window.
wikifier serve also exposes a read-only JSON API (/__wikifier/api/file?path=β¦, dependencies, dependents, cycles, journal, bootstrap, diagnostics) that the dashboard uses for per-file dependencies and history. This repo also contains a proposed redesign, index.v2.html and diagnostics.v2.html, to compare side by side with the current pages (http://localhost:8787/index.v2.html); they are not deployed by init.
In: agent-maintained codebase wiki, dependency intelligence, token-saving lookup for LLMs and coding agents.
Out: general human documentation systems, IDE plugins, βdocs for everyoneβ product growth.
Agent navigability: Prefer the protocol (skills/run.md) and the MCP Core 6 over reading the parsers or the cache. Tests live in tests/*.rs.
- Releases Β· PyPI Β· GitHub
- Agent protocol:
skills/run.md - Changelog:
CHANGELOG.md - Dogfood notes:
Findings/(historical plans and research inFindings/archive/)
