# nickcrew/claude-cortex architecture

> Architecture diagram of the GitHub repository nickcrew/claude-cortex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nickcrew/claude-cortex
- Repository: https://github.com/nickcrew/claude-cortex

## Overview

Cortex is a multi-model development orchestration framework, with a Python CLI/TUI for managing its capabilities. The principal workflow is an agent implementation followed by an independent review, remediation, and re-review; agent-loops also documents test-audit and lint gates. Other major branches include skill recommendations, asset management, hooks, MCP, context export, and the TUI. The README documents the workflow and CLI surface; source-index references support several internal links. Unsampled modules are represented only where their capabilities are documented, so their internal wiring is not inferred.

Main entry points: [`claude_ctx_py/cli.py`](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/cli.py) (Cortex CLI), [`skills/agent-loops`](https://github.com/nickcrew/claude-cortex/tree/main/skills/agent-loops) (Agent Loops), [`claude_ctx_py/skill_recommender.py`](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/skill_recommender.py) (Skill Recommender), [`claude_ctx_py/core/asset_installer.py`](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/asset_installer.py) (Asset Installer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Quality Workflows"]
  node_agentloops["Agent Loops"]
  node_implementer["Implementing Agent"]
  node_reviewer["Independent Reviewer"]
  node_testaudit["Test Audit"]
  node_lintgate["Lint Gate"]
end

subgraph group_recommend["Skill Intelligence"]
  node_recommender["Skill Recommender"]
  node_intelligence["Semantic Matching<br/>[semantic.py]"]
  node_intelligencecore["Context Learning<br/>[base.py]"]
  node_reviewparser["Review Learning<br/>[review_parser.py]"]
end

subgraph group_manage["Cortex Management"]
  node_assetdiscovery["Asset Discovery<br/>[asset_discovery.py]"]
  node_assetinstaller["Asset Installer<br/>[asset_installer.py]"]
  node_hooks["Hooks Management<br/>[hooks.py]"]
  node_mcp["MCP Management<br/>[mcp.py]"]
  node_mcprepo["MCP Registry<br/>[mcp_registry.py]"]
  node_context["Context Export<br/>[context_export.py]"]
end

subgraph group_interface["User Interfaces"]
  node_cli["Cortex CLI<br/>[cli.py]"]
  node_tui["Terminal UI<br/>[main.py]"]
end

node_user(("Developer"))
node_providers["Model Providers"]
node_assets["Cortex Assets"]

node_user -->|"runs commands"| node_cli
node_cli -->|"runs workflows"| node_agentloops
node_agentloops -->|"implements change"| node_implementer
node_agentloops -->|"requests review"| node_reviewer
node_reviewer -->|"uses model"| node_providers
node_agentloops -->|"audits tests"| node_testaudit
node_agentloops -->|"checks lint"| node_lintgate
node_cli -->|"offers recommendations"| node_recommender
node_recommender -->|"uses matching"| node_intelligence
node_recommender -->|"uses context"| node_intelligencecore
node_reviewparser -->|"feeds learning"| node_recommender
node_cli -->|"manages assets"| node_assetdiscovery
node_assetinstaller -->|"discovers assets"| node_assetdiscovery
node_assetinstaller -->|"installs hooks"| node_hooks
node_assetinstaller -->|"installs assets"| node_assets
node_cli -->|"manages hooks"| node_hooks
node_cli -->|"manages MCP"| node_mcp
node_mcp -->|"uses registry"| node_mcprepo
node_cli -->|"exports context"| node_context
node_user -->|"launches UI"| node_tui
node_tui -->|"browses assets"| node_assetdiscovery
node_tui -->|"manages hooks"| node_hooks

click node_cli "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/cli.py"
click node_agentloops "https://github.com/nickcrew/claude-cortex/tree/main/skills/agent-loops"
click node_implementer "https://github.com/nickcrew/claude-cortex/tree/main/agents"
click node_reviewer "https://github.com/nickcrew/claude-cortex/tree/main/agents"
click node_testaudit "https://github.com/nickcrew/claude-cortex/tree/main/skills/test-review"
click node_lintgate "https://github.com/nickcrew/claude-cortex/tree/main/skills/agent-loops"
click node_recommender "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/skill_recommender.py"
click node_intelligence "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/intelligence/semantic.py"
click node_intelligencecore "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/intelligence/base.py"
click node_reviewparser "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/review_parser.py"
click node_assetdiscovery "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/asset_discovery.py"
click node_assetinstaller "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/asset_installer.py"
click node_hooks "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/hooks.py"
click node_mcp "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/mcp.py"
click node_mcprepo "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/mcp_registry.py"
click node_context "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/context_export.py"
click node_tui "https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/tui/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agentloops,node_implementer,node_reviewer,node_testaudit,node_lintgate toneBlue
class node_recommender,node_intelligence,node_intelligencecore,node_reviewparser toneAmber
class node_assetdiscovery,node_assetinstaller,node_hooks,node_mcp,node_mcprepo,node_context toneMint
class node_cli,node_tui toneRose
class node_user,node_providers,node_assets toneIndigo
```

## Components

### Quality Workflows

- [Agent Loops](https://github.com/nickcrew/claude-cortex/tree/main/skills/agent-loops): `skills/agent-loops`
- [Implementing Agent](https://github.com/nickcrew/claude-cortex/tree/main/agents): `agents`
- [Independent Reviewer](https://github.com/nickcrew/claude-cortex/tree/main/agents): `agents`
- [Test Audit](https://github.com/nickcrew/claude-cortex/tree/main/skills/test-review): `skills/test-review`
- [Lint Gate](https://github.com/nickcrew/claude-cortex/tree/main/skills/agent-loops): `skills/agent-loops`

### Skill Intelligence

- [Skill Recommender](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/skill_recommender.py): `claude_ctx_py/skill_recommender.py`
- [Semantic Matching](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/intelligence/semantic.py): `claude_ctx_py/intelligence/semantic.py`
- [Context Learning](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/intelligence/base.py): `claude_ctx_py/intelligence/base.py`
- [Review Learning](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/review_parser.py): `claude_ctx_py/review_parser.py`

### Cortex Management

- [Asset Discovery](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/asset_discovery.py): `claude_ctx_py/core/asset_discovery.py`
- [Asset Installer](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/asset_installer.py): `claude_ctx_py/core/asset_installer.py`
- [Hooks Management](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/hooks.py): `claude_ctx_py/core/hooks.py`
- [MCP Management](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/mcp.py): `claude_ctx_py/core/mcp.py`
- [MCP Registry](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/mcp_registry.py): `claude_ctx_py/core/mcp_registry.py`
- [Context Export](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/core/context_export.py): `claude_ctx_py/core/context_export.py`

### User Interfaces

- [Cortex CLI](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/cli.py): `claude_ctx_py/cli.py`
- [Terminal UI](https://github.com/nickcrew/claude-cortex/blob/main/claude_ctx_py/tui/main.py): `claude_ctx_py/tui/main.py`

### Other components

- **Developer**
- **Model Providers**
- **Cortex Assets**

## Connections

- Developer → Cortex CLI: runs commands (evidence: `README.md`)
- Cortex CLI → Agent Loops: runs workflows (evidence: `README.md`)
- Agent Loops → Implementing Agent: implements change (evidence: `README.md`)
- Agent Loops → Independent Reviewer: requests review (evidence: `README.md`)
- Independent Reviewer → Model Providers: uses model (evidence: `README.md`)
- Agent Loops → Test Audit: audits tests (evidence: `README.md`)
- Agent Loops → Lint Gate: checks lint (evidence: `README.md`)
- Cortex CLI → Skill Recommender: offers recommendations (evidence: `README.md`)
- Skill Recommender → Semantic Matching: uses matching (evidence: `claude_ctx_py/skill_recommender.py`)
- Skill Recommender → Context Learning: uses context (evidence: `claude_ctx_py/skill_recommender.py`)
- Review Learning → Skill Recommender: feeds learning (evidence: `claude_ctx_py/review_parser.py`)
- Cortex CLI → Asset Discovery: manages assets (evidence: `README.md`)
- Asset Installer → Asset Discovery: discovers assets (evidence: `claude_ctx_py/core/asset_installer.py`)
- Asset Installer → Hooks Management: installs hooks (evidence: `claude_ctx_py/core/asset_installer.py`)
- Asset Installer → Cortex Assets: installs assets (evidence: `README.md`)
- Cortex CLI → Hooks Management: manages hooks (evidence: `README.md`)
- Cortex CLI → MCP Management: manages MCP (evidence: `README.md`)
- MCP Management → MCP Registry: uses registry (evidence: `claude_ctx_py/core/mcp_installer.py`)
- Cortex CLI → Context Export: exports context (evidence: `README.md`)
- Developer → Terminal UI: launches UI (evidence: `README.md`)
- Terminal UI → Asset Discovery: browses assets (evidence: `claude_ctx_py/tui/main.py`)
- Terminal UI → Hooks Management: manages hooks (evidence: `claude_ctx_py/tui/main.py`)
