This release is a pre-release and may not be stable for production use.
CodeCortex Context Engine 🧠
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
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 codecortex_context_engine-0.1.0a1.tar.gz.
File metadata
- Download URL: codecortex_context_engine-0.1.0a1.tar.gz
- Upload date:
- Size: 123.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d9337dd0330c8163b875c5a5a4d8ce5fbb13d630cb40a710d951d74e62f7f1d
|
|
| MD5 |
efeb07d6efb6b2d68541f2c94cc8ac3f
|
|
| BLAKE2b-256 |
c467a3c4fb26d3e97a91f1cad0774d41b3657196783d2f385fbde145d8e839e1
|
Provenance
The following attestation bundles were made for codecortex_context_engine-0.1.0a1.tar.gz:
Publisher:
release.yml on BehnamJalaliCo/CodeCortex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codecortex_context_engine-0.1.0a1.tar.gz -
Subject digest:
1d9337dd0330c8163b875c5a5a4d8ce5fbb13d630cb40a710d951d74e62f7f1d - Sigstore transparency entry: 2659490732
- Sigstore integration time:
-
Permalink:
BehnamJalaliCo/CodeCortex@09fce6e0c3d16e1503f28e906aa4c2f05fb5f462 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BehnamJalaliCo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09fce6e0c3d16e1503f28e906aa4c2f05fb5f462 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file codecortex_context_engine-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: codecortex_context_engine-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 129.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9403147ee01514d1eb35361bf84e38a212b622af9af0672c7f1884f4c12a3a6
|
|
| MD5 |
f8a1ecbfddf732900d6cf2416c21cf7d
|
|
| BLAKE2b-256 |
47f710536a0be941f60c60f584cab30848d22a9194b516578aa50de996ce693d
|
Provenance
The following attestation bundles were made for codecortex_context_engine-0.1.0a1-py3-none-any.whl:
Publisher:
release.yml on BehnamJalaliCo/CodeCortex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codecortex_context_engine-0.1.0a1-py3-none-any.whl -
Subject digest:
e9403147ee01514d1eb35361bf84e38a212b622af9af0672c7f1884f4c12a3a6 - Sigstore transparency entry: 2659490971
- Sigstore integration time:
-
Permalink:
BehnamJalaliCo/CodeCortex@09fce6e0c3d16e1503f28e906aa4c2f05fb5f462 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BehnamJalaliCo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09fce6e0c3d16e1503f28e906aa4c2f05fb5f462 -
Trigger Event:
workflow_dispatch
-
Statement type: