Cortex

io.github.DanielBlomma由 GitHub 帳號 DanielBlomma 發布v0.4.2更新於 Oct 24, 2026

Local repo context for coding assistants with semantic search and graph relationships.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

Cortex 在本機為程式碼儲存庫建立程式碼、符號與規則的索引,讓編碼助理取得附引用的脈絡,而不必讀完整個儲存庫。

可以做什麼
對程式碼、規則與架構決策做語意搜尋,並從結果追蹤符號、呼叫端與相依關係。在重構前評估變更影響範圍,讀取生效的儲存庫規則與棄用標記。檢視某個檔案或實體的慣例設定與鄰近實作模式。為特定任務取得附引用的編碼前指引,並對照事實來源規則與本機模式審查目前的 Git 差異。重新整理索引,並查看索引狀態、背景同步狀態與安裝診斷。
適用情境
適合編碼助理在較大儲存庫中工作、容易靠猜測或讀取大量無關檔案的情況。用於回答前先檢索、重構前先評估影響,以及在完成變更前審查差異。
執行需求
以本機程序執行,透過 npm 全域安裝。需要 Node.js 20.9 以上版本與 Git。初始化指令會索引儲存庫、修改 AGENTS.md、安裝 Git 鉤子並啟動背景監看程序。未宣告帳號、API 金鑰或環境變數。
安裝前請注意
初始化會變更專案:在 AGENTS.md 加入說明並安裝 Git 鉤子,背景監看程序會持續索引變更。README 表示流程在本機進行,慣例與指引功能不呼叫模型或網路服務,但索引及其檔案會寫入本機。指引與差異審查被描述為僅供檢視,不具政策權威。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Cortex,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Cortex]

Cortex

Give AI coding agents the right context from your repository.

[npm version] [license]

Cortex builds a local map of your code, symbols, relationships, and project rules. Coding agents query that map through the CLI instead of guessing or reading the whole repository.

Your code stays on your machine. MCP is not required.

Start

Requires Node.js 20.9+ and Git.

bash
npm install --global @danielblomma/cortex-mcpcd your-projectcortex init --bootstrap

This indexes the repository, adds Cortex instructions to AGENTS.md, installs Git hooks, and starts the background watcher.

Check the setup:

bash
cortex doctor

Use

bash
# Find relevant code.cortex search "where is authentication handled?" --json
# Follow relationships from a search result.cortex related <entity-id> --json
# See what a change may affect.cortex impact "authentication" --json
# Read repository rules.cortex rules --json
# Compare a changed file with nearby patterns.cortex pattern-evidence src/auth.ts --json
# Inspect deterministic active conventions for a file or indexed entity.cortex conventions src/payments/retry.ts --json
# Get cited, deterministic context before implementing a code task.cortex guidance src/payments/retry.ts --task "add bounded retry handling" --json
# Review the staged, unstaged, and non-ignored untracked candidate against HEAD.cortex review --diff --json
# Refresh context after significant changes.cortex update

Agents can run these commands directly. cortex init adds instructions that tell them to search before answering and check impact before refactoring. They do not need an MCP connection.

What Cortex adds

Without Cortex, an agent often searches by filename and reads many unrelated files. Cortex gives it structured repository context:

  • semantic search across code, rules, and architecture decisions;
  • symbol definitions and file relationships;
  • caller and dependency traversal;
  • impact analysis before refactoring;
  • active rules, deprecations, and source-of-truth signals;
  • deterministic, subsystem-scoped convention profiles with cited reusable symbols;
  • incremental updates after Git and filesystem changes.

The pipeline is local and straightforward:

text
repository -> local index -> Cortex CLI -> coding agent

Commands you will use

CommandPurpose
cortex search "..." --jsonFind relevant code and context
cortex related <entity-id> --jsonFollow relationships from a result
cortex impact "..." --jsonEstimate the blast radius of a change
cortex rules --jsonShow active repository rules
cortex pattern-evidence <file> --jsonFind nearby implementation patterns
cortex conventions <file-or-entity> --jsonInspect bounded repository convention profiles
cortex guidance <file-or-entity> --task <text> --jsonGet bounded cited pre-coding guidance
cortex review --diff --jsonReview the current Git candidate with cited local evidence
cortex updateRefresh changed context
cortex statusShow index status
cortex doctorDiagnose the local setup
cortex watch statusCheck background synchronization
cortex dashboardOpen the local status dashboard

Run cortex help for the complete command list.

cortex conventions uses only the local index. It returns bounded, live-backed version-1 profiles and does not call a model, planner, provider, or network service. See Repository convention profiles for the exact eligibility, limit, hashing, persistence, and safety contract.

Before implementing a code task, use cortex guidance as cited additive context—not policy authority. Continue to use normal search, related, and impact when needed, and never skip explicit active rules or conflicts. The command is local-only and inspection-only; see the exact versioned contract in Pre-coding guidance.

After coding and before finalization, use cortex review --diff. It separates exact source-of-truth violations from heuristic local-pattern warnings and is inspection-only. See Deterministic diff review.

Keep the index fresh

Git hooks and the watcher normally update Cortex automatically.

bash
cortex statuscortex watch statuscortex update

Run cortex update manually after a large change or when results look stale.

Large repositories

Make lexical and graph search available first while semantic indexing continues in the background:

bash
cortex bootstrap --background --profile interactivecortex indexing status --json

This mode supports macOS, Linux, and WSL. Native Windows should use normal foreground bootstrap.

Upgrade

bash
npm install --global @danielblomma/cortex-mcp@latestcortex init --forcecortex bootstrapcortex update

Project configuration and rules are preserved. See CHANGELOG.md for version-specific notes.

Optional MCP compatibility

The normal Cortex workflow uses the CLI. If a client explicitly requires MCP, run cortex connect.

DeepSeek Harness integration

Cortex supports DeepSeek Harness through the V1 explicit tools and skills integration. Cortex 2.6.0 contains and validates the integration source against the pinned Harness 0.1.1-rc.2 release. Separate npm bundle distribution is deferred and currently unavailable.

The bundle provides four agent-scoped tools (cortex_search, cortex_related, cortex_impact, and cortex_rules) and five Cortex behavior skills (change-impact, context-review, pattern-review, repo-research, and using-cortex). Retrieval is local, repository-scoped, explicit, and user-controlled. The integration does not automatically initialize, update, or watch a repository.

V2 proactive/assistive retrieval remains planned and experimental; it is not included in Cortex 2.6.0. See the V1-to-V2 integration plan for details.

Links

License

MIT

來源:README.md,提交 0e4ff52

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.2最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。