Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CodeCortex Context Engine 🧠

CI CodeQL OpenSSF Scorecard License Python

Context intelligence infrastructure for AI coding agents.

CodeCortex builds a task-specific view of a codebase from repository structure, semantic symbols, dependencies, Git history, impact, memory, and compressed context — then exposes it through one MCP surface.

Map. Understand. Edit. Compress. Remember.

Alpha. The architecture and local workflows are usable today. Performance claims are published only from reproducible benchmark artifacts produced by repository workflows.

Why CodeCortex

Large repositories force coding agents to repeatedly rediscover architecture, read irrelevant files, and spend context on information that should already be structured. CodeCortex sits between an agent and its codebase and routes each request to the smallest useful intelligence surface.

Coding Agent
    │
    ▼
CodeCortex MCP / Gateway
    │
    ├── Adaptive Router
    ├── Repository + Dependency Intelligence
    ├── Semantic Symbol + Refactor Intelligence
    ├── Hybrid Retrieval + Context Compression
    ├── Project + Team Memory
    ├── Git + PR + Impact Intelligence
    ├── Architecture Drift
    └── Validation + Task Tracing

The orchestration, routing, repository intelligence, symbol intelligence, context processing, memory, multi-repository workspace, change intelligence, observability, evaluation, and product integration layers live in this repository. Optional external adapters are configuration-driven and disabled by default.

Install

Python 3.11–3.13 is supported.

git clone https://github.com/BehnamJalaliCo/CodeCortex.git
cd CodeCortex
pip install -e ".[dev]"
cortex init .

The release pipeline is prepared to publish the Python distribution as codecortex-context-engine.

One MCP surface

cortex mcp --path /path/to/repository

The MCP surface includes repository mapping, semantic search, symbols, references, dependency analysis, impact analysis, architecture inference, context construction, project/team memory, PR intelligence, traces, validation, and guarded semantic editing.

Semantic edits

cortex edit rename src/auth.py AuthService SessionService
cortex edit replace src/auth.py AuthService/refresh --body-file ./replacement.txt
cortex edit insert-before src/auth.py AuthService --body-file ./imports.txt
cortex edit insert-after src/auth.py AuthService --body-file ./helper.txt

Paths are constrained to the project root and symbol-body mutations perform a semantic preflight read.

Native language intelligence

Python uses the standard AST. The optional native parser extra provides Tree-sitter grammars across TypeScript, JavaScript, Go, Rust, Java, C, C++, C#, PHP, and Ruby.

pip install "codecortex-context-engine[parsers]"

Core commands

cortex index
cortex semantic "authentication refresh"
cortex impact AuthService
cortex architecture
cortex architecture-drift
cortex symbol-history src/auth.py 10 80
cortex pr main --head HEAD
cortex workspace-add backend ../backend
cortex workspace-search "payment service"
cortex benchmark
cortex dashboard
cortex doctor

Quality and security

CodeCortex uses layered validation: CI across Python 3.11–3.13, CodeQL, dependency auditing, Bandit, security-boundary tests, OpenSSF Scorecard, CycloneDX SBOMs, checksums, Sigstore signing, and GitHub build-provenance attestations.

Repository-wide branch coverage has a measured baseline and a 90% long-term target. See docs/QUALITY.md for the current evidence and policy.

Reproducible performance evidence

python scripts/run_production_benchmark.py

Missing token, file-read, or cost metrics remain null; CodeCortex does not fabricate them. Public performance claims should be backed by reproducible benchmark artifacts.

Observatory

cortex dashboard -p /path/to/repository

The local read-only dashboard shows backend health, routing distribution, context tokens saved, engine latency, graph hotspots, recent task traces, architecture drift, benchmark history, and a PR-risk API. It binds to 127.0.0.1 by default.

Docker

docker build --target core -t codecortex:core .
docker build --target full -t codecortex:full .
docker compose up dashboard

Project standards

  • CONTRIBUTING.md — contribution workflow.
  • CODE_OF_CONDUCT.md — community expectations.
  • GOVERNANCE.md — decision-making and maintainership.
  • SUPPORT.md — support channels.
  • SECURITY.md — private vulnerability reporting and security defaults.
  • CITATION.cff — citation metadata.
  • COMMERCIAL.md — commercial support and licensing model.
  • docs/QUALITY.md — measurable quality targets.
  • docs/OPENSSF.md — OpenSSF badge readiness and external enrollment.
  • ROADMAP.md — shipped and future work.

Licensing

CodeCortex is licensed under Apache-2.0. Separate paid support, managed offerings, enterprise terms, and commercial agreements for material the licensor has the right to license may be offered independently; see COMMERCIAL.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codecortex_context_engine-0.1.0a1.tar.gz (123.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codecortex_context_engine-0.1.0a1-py3-none-any.whl (129.4 kB view details)

Uploaded Python 3

File details

Details for the file codecortex_context_engine-0.1.0a1.tar.gz.

File metadata

File hashes

Hashes for codecortex_context_engine-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 1d9337dd0330c8163b875c5a5a4d8ce5fbb13d630cb40a710d951d74e62f7f1d
MD5 efeb07d6efb6b2d68541f2c94cc8ac3f
BLAKE2b-256 c467a3c4fb26d3e97a91f1cad0774d41b3657196783d2f385fbde145d8e839e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecortex_context_engine-0.1.0a1.tar.gz:

Publisher: release.yml on BehnamJalaliCo/CodeCortex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecortex_context_engine-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for codecortex_context_engine-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9403147ee01514d1eb35361bf84e38a212b622af9af0672c7f1884f4c12a3a6
MD5 f8a1ecbfddf732900d6cf2416c21cf7d
BLAKE2b-256 47f710536a0be941f60c60f584cab30848d22a9194b516578aa50de996ce693d

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecortex_context_engine-0.1.0a1-py3-none-any.whl:

Publisher: release.yml on BehnamJalaliCo/CodeCortex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.
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