Skip to content

Configuration

Defaults are sufficient for most cases. The variables below are organised by area; the ones you're most likely to reach for are marked .

Logging

VariableDefaultEffect
LOG_LEVELinfoStderr log verbosity (debug / info / warn / error).

Project scanning

VariableDefaultEffect
CODEWIKI_INCLUDE_DEV_DEPSoffAlso scan devDependencies (useful when test-tool docs matter).
CODEWIKI_DISABLE_WATCHoffDon't watch manifest changes (CI/CD friendly).
CODEWIKI_SCAN_MAX_DEPTH8Max BFS depth for recursive subdir scan in list_project_dependencies.
CODEWIKI_MAX_WALK_DEPTH32Max depth for the upward manifest walk from cwd toward $HOME.
CODEWIKI_MAX_MANIFEST_BYTES1048576Hard cap on manifest file size (untrusted-input hardening).
CODEWIKI_MAX_WORKSPACE_MEMBERS256Cap on workspace members per project.
CODEWIKI_MAX_WATCHED_PATHS512Cap on chokidar watch list size.
CODEWIKI_MAX_BOM_DEPTH5Maven BOM recursion depth limit (cycle-safe).

Cache TTLs

VariableDefaultEffect
CODEWIKI_PAGE_TTL_MS86400000 (24 h)How long a single CodeWiki page stays fresh before the SHA probe.
CODEWIKI_REPO_TTL_MS604800000 (7 d)How long a name → owner/repo resolution stays fresh.
CODEWIKI_WIKI_STATUS_TTL_MS86400000 (24 h)How long the per-repo coverage probe stays fresh.
CODEWIKI_FORCE_INMEMORYoffForce in-memory cache (skip better-sqlite3 even when available).

HTTP and Playwright

VariableDefaultEffect
CODEWIKI_MAX_CONCURRENT_PAGES3Max concurrent Playwright page loads per origin.
CODEWIKI_RATE_LIMIT_INTERVAL_MS4000Per-origin minimum interval between page loads.
CODEWIKI_PAGE_LOAD_TIMEOUT_MS30000Per-page wall-clock cap.
CODEWIKI_FETCH_TIMEOUT_MS5000HTTP request timeout for non-Playwright fetches.
CODEWIKI_PLAYWRIGHT_INSTALL_TIMEOUT_MS180000Wallclock cap on the boot-time npx playwright install.

Retrieval (RAG)

VariableDefaultEffect
CODEWIKI_EMBED_MODELXenova/bge-small-en-v1.5ONNX embedding model.
CODEWIKI_EMBED_MODEL_DIM384Embedding dimensionality. Must match the model.
CODEWIKI_CHUNK_MAX_TOKENS512Max tokens per chunk.
CODEWIKI_CHUNK_OVERLAP_TOKENS64Chunk overlap.
CODEWIKI_INDEX_TTL_MS86400000 (24 h)How long a per-repo index stays valid before a SHA probe.
CODEWIKI_INDEX_BUILD_TIMEOUT_MS15000The race deadline find_chunks runs against the indexer. On timeout, returns status: 'index_building'.
CODEWIKI_RERANK_MODELXenova/ms-marco-MiniLM-L-6-v2ONNX cross-encoder reranker.
CODEWIKI_RERANK_TOP_N50Candidate count passed to the reranker.
CODEWIKI_RERANK_DOWNLOAD_TIMEOUT_MS15000Reranker model download timeout.
CODEWIKI_RERANKER_CIRCUIT_BREAKER_MS60000Cool-down before retrying after a reranker failure.
CODEWIKI_FORCE_NO_BM25offVector-only mode (BM25 branch skipped).
CODEWIKI_FORCE_PUREJS_VECTORoffForce pure-JS cosine even when sqlite-vec is available.
CODEWIKI_RRF_K60Reciprocal Rank Fusion k constant.
CODEWIKI_DISABLE_MODEL_WARMUPoffSkip boot-time embedder + reranker warmup.
CODEWIKI_DISABLE_KGoffSkip knowledge graph build; find_neighbors is unregistered entirely.

Resource governance and metrics

VariableDefaultEffect
CODEWIKI_NODE_HEAP_MB1536V8 old-space heap cap (self-reexec wrapper).
CODEWIKI_DISABLE_HEAP_CAPoffSkip the heap-cap wrapper entirely (rollback).
CODEWIKI_HEARTBEAT_INTERVAL_MS30000Interval for the runtime_heartbeat stderr metric.
CODEWIKI_DISABLE_HEARTBEAToffDisable the heartbeat metric.
CODEWIKI_METRIC_AGGREGATEoffAggregate tool_latency_ms lines instead of emitting one per call.
CODEWIKI_METRIC_FLUSH_INTERVAL_MS30000Flush interval for aggregated metrics.

Diagnostics

VariableDefaultEffect
CODEWIKI_STDOUT_TRIPWIREoffSide-observe wrapper around stdout; warns on non-JSON-RPC bytes. Never reroutes.

Troubleshooting

MCP -32000 on cold start

The very first run of npx codewikitap shows the MCP client reporting -32000 and reconnecting.

Cause: usually a stalled or denied npx playwright install --only-shell chromium inside the codewikitap process (corporate proxy, offline sandbox, npm registry unreachable).

Fix:

  1. Run the install manually once:

    bash
    npx playwright install --only-shell chromium
  2. Restart codewikitap. Subsequent runs use the on-disk binary and reach transport.connect() within milliseconds.

  3. If the install fails and you need the server to come up immediately with browser-using tools degraded, set CODEWIKI_PLAYWRIGHT_INSTALL_TIMEOUT_MS=5000. The MCP handshake succeeds and browser tools (get_page, find_chunks cache-miss, find_neighbors cache-miss) return a rate_limited retry envelope until the install completes. Non-browser tools (list_project_dependencies, resolve_repo) work unaffected.

sqliteVec: false and queries feel slow

The runtime_capabilities log line on boot shows sqliteVec: false.

Cause: the sqlite-vec native extension wasn't installed for your platform (macOS SIP, sandboxed container, Windows ARM, Alpine musl all break the prebuilt).

Fix: install the matching prebuilt or rebuild from source:

bash
npm rebuild sqlite-vec

Vector ranking still works (pure-JS cosine in vector_store.ts) — it's just ~5–10× slower on large repos. The math is equivalent.

betterSqlite3: false and the cache is lost across restarts

The runtime_capabilities log line shows betterSqlite3: false.

Cause: better-sqlite3 is an optional native dep; on platforms without a published prebuilt and without a C++ toolchain, install skips it.

Effect: in-memory cache; queries still work, but restart loses everything (chunks, vectors, KG edges).

Fix: install the platform-matching prebuilt, or install a build toolchain (Xcode CLI / VS Build Tools / apt install build-essential) and rerun pnpm install.

Bulk-indexing many repos at once feels slow

CodeWiki is an Angular SPA with active bot detection. CodeWikiTap self-throttles to one page load per four seconds per origin (CODEWIKI_RATE_LIMIT_INTERVAL_MS=4000). Typical interactive use never feels this; bulk-indexing many repos at once will.

If you're indexing many repos at once, pre-warm with get_page({ prepareOnly: true }) calls so the actual find_chunks requests later hit warm indexes.

"MCP server registered but agent doesn't see tools"

The config file was written but the agent didn't reload. Restart the agent (full quit, not just a window close — some agents cache MCP server lists for the session).


That's everything. For things this guide didn't cover, the source is on GitHub and the CHANGELOG tracks every release.