Skip to main content
CodeNib

Searchable codebase wikis and context for coding agents

Point it at any repo, get a searchable Wiki and an MCP server for your coding agent.

arXiv 2607.25431 Hugging Face: #2 Paper of the Day

Quickstart  ·  Website  ·  Discord  ·  Documentation  ·  CodeGraph  ·  MCP  ·  Agent Integrations  ·  Languages

CI PyPI version Claude Code supported Codex supported License: Apache 2.0 Python 3.10+ CodeNib 0.2.2

python -m pip install "codenib[graph,mcp]==0.2.2"
codenib codegraph init /path/to/your/repo

That one command detects the repository languages, installs the pinned package-level graph providers it can manage, builds BM25 plus a source-linked symbol graph, and registers the resulting MCP server with installed Codex and Claude Code clients. It is local, open source, requires no model or cloud, and does not write configuration or indexes into the target repository.

News

  • 2026-08-21 — CodeNib 0.2.2 repository source authority. Authenticated indexing now admits absolute symlinks only when they resolve inside the same pinned checkout, and exact root-relative exclusions persist across indexing, CodeGraph, MCP, Wiki, and Web runtimes. Release notes
  • 2026-08-13 — CodeNib 0.2.1 CodeGraph onboarding. One command prepares a repository graph and connects it to Codex and Claude Code, with idempotent status, safe uninstall, and installed-wheel MCP graph verification. CodeGraph guide
  • 2026-08-08 — RepoNavigator Jump adapter. The published single-tool RepoNavigator contract now resolves symbol definitions through a persisted SCIP occurrence or injected LSP signal, with graph-only resolution disclosed as a degraded fallback. Support boundary
  • 2026-08-05 — CodeNib 0.2.0. Build a static Wiki and reusable context artifact once, then serve it through Pages or the official MCP package. Hybrid retrieval and managed SCIP/LSP providers ship in the same CLI. Release notes
  • 2026-08-05 — SweRank recipe. Run SweRank retrieval and reranking over a local checkout. Example
  • 2026-08-04 — Native repository explorer. CodeNib's planner now targets the SWE-Explore source-region protocol. Validation
  • 2026-08-03 — Native LocAgent policy. LocAgent runs directly on CodeNib views without LocAgent, LiteLLM, or LlamaIndex dependencies. Support matrix
  • 2026-08-02 — OrcaLoca SearchAgent. OrcaLoca's six-tool search loop now reuses CodeNib's symbol graph. Support matrix

System Architecture

Layer Responsibility
View compiler Chunk source and materialize BM25, dense, graph, and navigation views; reuse current artifacts and atomically rebuild affected views
View manifest Record repository identity, source fingerprint, builder profile, capabilities, status, and artifact location independently for each view
Context serving Execute lexical, semantic, hybrid, reranked, and structural query plans while preserving repository-relative source locations
Agent runtime Expose capability-aware MCP and LSP-shaped tools, assemble bounded evidence, and return citations that agents and humans can inspect
repository change
  -> reuse current views or rebuild affected views
  -> publish a capability-bearing manifest
  -> plan repository queries
  -> deliver bounded, source-linked context

On a later commit, CodeNib reuses views whose source and builder identities are still current. A requested view affected by source or policy changes currently rebuilds in an isolated generation; file- and symbol-level delta repair remains disabled until it can use the same pinned source authority.

Quickstart

Requires Python 3.10+ and Git. For an agent-ready CodeGraph with no model or API key, install the graph and MCP extras and run one command:

python -m pip install "codenib[graph,mcp]==0.2.2"
codenib codegraph init /path/to/repository

codegraph init detects Codex and Claude Code, installs only the detected languages' package-managed providers, builds reusable bm25 and symbol_graph views, and asks each native client CLI to own its configuration. Run codenib codegraph status /path/to/repository to diagnose the complete path or codenib codegraph uninstall /path/to/repository to remove only the managed client registrations. The index remains reusable.

Repositories can persist exact root-relative subtree exclusions when generated or vendored content should not be indexed:

codenib codegraph init /path/to/repository \
  --exclude-dir ios/Pods \
  --exclude-dir generated/api

Paths use repository-relative POSIX spelling (/) and name exact subtrees, not globs. Repeat --exclude-dir to replace the complete custom exclusion set. Later init and index runs reuse that policy from the manifest; use --clear-exclude-dirs to return to the default source surface. CodeNib does not implicitly treat .gitignore as an indexing policy, because tracked and local ignored source can still be intentional input.

Zoekt supports the default source policy only when its fixed commit tree exactly matches the authenticated checkout and contains no tracked path that the default policy excludes. It does not currently support a non-empty custom exclusion set. A command that explicitly requests the zoekt view, including --preset full, fails closed when either condition is unmet; use the CodeGraph, fast, or semantic paths instead. In 0.2.2 the authenticated MCP search_zoekt runtime requires Linux /proc so the child process can inherit the exact retained shard generation; other platforms fail closed instead of reopening a mutable shard path.

For a browser Wiki with hybrid BM25+dense retrieval, install the semantic extra:

python -m pip install "codenib[semantic]==0.2.2"
codenib wiki /path/to/repository

Both paths keep reusable state under ~/.codenib/repositories and leave the target checkout unchanged. Set CODENIB_HOME to relocate state. The 0.2.2 release notes record the upgrade boundary and installed-product evidence.

Preview the CodeGraph operations without installing, indexing, or configuring an agent:

codenib codegraph init /path/to/repository --dry-run

For a structural view, CodeNib detects the repository languages and manages only their package-level providers; operating-system and project prerequisites remain explicit:

python -m pip install "codenib[graph]==0.2.2"
codenib toolchain install /path/to/repository --scope graph
codenib doctor /path/to/repository --require graph

Export that indexed commit as a serverless Wiki when a live Ask backend is not needed:

codenib export /path/to/repository --output /tmp/repository-wiki

The export contains a versioned provenance manifest, precomputed Wiki pages, source citations, and available page-level dependency data. It contains no provider credential; interactive Ask and runtime graph exploration remain on the local or MCP serving path.

For a repository-hosted Wiki, CodeNib also ships a reusable GitHub workflow that builds or reuses the same manifest, deploys the static site to Pages, and uploads the matching commit-addressed context artifact. Its default semantic route builds BM25 and vector views with a cached local Hugging Face model and needs no API key. An explicit fast route avoids the model download; a BYO OpenAI-compatible endpoint can replace local embedding. Query-time search remains in the local or MCP runtime. See GitHub Pages. The published BM25/vector artifact can then be verified against an exact local checkout and served through MCP without rebuilding the repository views.

See the Quickstart for ports, advanced indexing, and troubleshooting.

CodeNib Wiki showing the source-linked reverse proxy guide for Caddy

Serve An Agent

The recommended path configures installed Codex and Claude Code clients through their native CLIs:

python -m pip install "codenib[graph,mcp]==0.2.2"
codenib codegraph init /path/to/repository

Ask the agent to start with explore_context for bounded, source-verified repository context and use dependency_subgraph for caller impact or callee dependencies. The MCP server also exposes ranked BM25, regex, definition, reference, route, and bounded source-read tools. See the CodeGraph guide for client scopes, diagnostics, uninstall behavior, and language prerequisites, and the MCP Server for the complete tool contract.

The same planner is available directly to Python agents:

from codenib.agent import RepositoryContextExplorer

with RepositoryContextExplorer.from_repository(
    "/path/to/repository", policy="auto"
) as explorer:
    result = explorer.explore("where is request retry behavior implemented?", top_k=10)

Each result includes source-validated evidence plus the selected plan, capabilities, loaded views, fusion, graph, and reranking trace.

What CodeNib Provides

Surface Purpose
View compiler Build independently managed views, reuse current generations, and atomically rebuild changed views under one source identity
Agent context runtime Plan capability-aware retrieval and navigation, then assemble bounded source-linked evidence
Retrieval BM25, dense-vector, regex/trigram, Zoekt, fusion, and reranking paths; see the validated model matrix
Structural context SCIP/LSP-backed symbol graphs with source locations and typed edges
MCP and LSP-shaped tools Serve one manifest to coding agents without tying the runtime to one agent framework
Agent compatibility Reuse one manifest across revision-pinned LocAgent, Agentless, CoSIL, and OrcaLoca contracts, plus the published RepoNavigator jump contract over SCIP/LSP definition signals; see the support matrix
Benchmark compatibility Evaluate native exploration against pinned external datasets and scorers, including SWE-Explore; see the dataset and benchmark matrix
Local inspection Audit the same context through Wiki pages, Ask answers, citations, and the Dependency Map
Evaluation harness Measure retrieval, navigation, incremental maintenance, and context policies on the same artifacts

Language support varies by surface. The generated capability matrix records chunking, graph, incremental, and C++ decoder support.

Documentation

Build the documentation site locally with:

python -m pip install -e ".[dev]"
mkdocs serve

Development

git clone https://github.com/sysevol-ai/CodeNib.git
cd CodeNib
make dev
make test

The test suite is split into unit, integration, serial integration, core, graph-consumer, and slow tiers. See CI/CD before running the credential- or toolchain-dependent tiers.

Status

CodeNib 0.2.2 is a beta release. The CLI and manifest format are usable, but public interfaces may still change before a stable release. Historical research artifacts retain their published dataset identifiers; the maintained package, import namespace, commands, and repository use CodeNib. See Naming.

Citation

If you use CodeNib in your research, please cite our arXiv paper:

@misc{yu2026codenibmultiviewdataserving,
      title={CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agents},
      author={Zhongming Yu and Hengjia Yu and Boqin Yuan and Shuting Zhao and Yizhao Chen and Aryan Dokania and Mihir Jagtap and Jiayu Chang and Yitong Ma and Yash Jayswal and Wentao Ni and Hejia Zhang and Zhaoling Chen and Gangda Deng and Jishen Zhao},
      year={2026},
      eprint={2607.25431},
      archivePrefix={arXiv},
      primaryClass={cs.SE},
      url={https://arxiv.org/abs/2607.25431},
}

Project

Website  ·  Changelog  ·  Contributing

License

CodeNib is licensed under the Apache License, Version 2.0.

Release files for codenib 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codenib 0.2.2
File Size Uploaded
codenib-0.2.2.tar.gz 3.2 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for codenib 0.2.2
File Interpreter ABI Platform
codenib-0.2.2-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
codenib-0.2.2-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details

Total release size: 9.8 MB

Release files / codenib-0.2.2.tar.gz

Download URL codenib-0.2.2.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b6e8b92f936edabd45f0dbc67ea4162812ab79259bf8b57bbd79296a036aa8c7
BLAKE2b-256 checksum
How to use checksums
3c477b07a41303a0c339291162463141a860e021b2e969520959f9bfd1b2941d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release files / codenib-0.2.2-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL codenib-0.2.2-cp310-abi3-manylinux_2_28_x86_64.whl
Size 3.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
9ced40f6bb1b55636fbb133c7fc1e0aa371feadcc54d2ad5371c5b7f47d06fce
BLAKE2b-256 checksum
How to use checksums
de0611790dba407057e29eb5728b956f2c0af1dae833423bf24a40d578d18328
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release files / codenib-0.2.2-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL codenib-0.2.2-cp310-abi3-manylinux_2_28_aarch64.whl
Size 3.3 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
909c82a5854fa159197903f3a3c7755578783acbeb1a8261d081f11c82e983e0
BLAKE2b-256 checksum
How to use checksums
037bcd68f7213e492b4e50a181032f66cfc07621728229cc97415ff97cfd5249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.3

3 release files

This release

0.2.2 This release

3 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page