Documentation

Set up Cortex

Cortex gives Claude Code your team's operational memory through the Model Context Protocol. Connect a repo once, then every Claude Code session can retrieve approved memories, repo context, and risk warnings before it acts.

1

Prerequisites

  • Node.js 20+ and a terminal
  • Claude Code installed in your repo
  • A Cortex account (create one when you sign in)
2

Install the CLI

npm install -g @mxbenjaminbeguin/cortex
3

Authenticate

Log in to store an API token locally (in ~/.cortex/credentials.json):

cortex login
4

Connect your repo

From the root of your repository, link it to a Cortex workspace. This writes a local config and generates the Claude Code assets.

cortex init

This creates:

.cortex/config.json          # repo link
CLAUDE.md                       # guidance for the agent
.mcp.json                       # registers the Cortex MCP server
.claude/settings.json           # SessionStart / PreToolUse / SessionEnd hooks
5

Use it in Claude Code

Open Claude Code in the repo. It discovers the cortex MCP server and can call these tools:

search_memory(query)      → approved memories for this repo
get_repo_context()        → stack, commands, risks, warnings

New learnings captured during sessions show up as proposed memories in your inbox. Approve them and they become available to every future session.

6

Use it in Claude Desktop (optional)

Claude Desktop runs MCP servers globally, so tell Cortex which repo to serve with --repo (the repo ID is on its dashboard page). Add it to your Claude Desktop config:

// macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "cortex": { "command": "cortex", "args": ["mcp", "--repo", "<repoId>"] }
  }
}

Restart Claude Desktop and the search_memory / get_repo_context / propose_memories tools become available. Note: the automatic hooks (context injection, risk warnings, session capture) are Claude Code-only — Desktop gets the manual tools.

7

Review & approve memory

Manage memory in the web app — review the inbox, approve or reject proposals, and browse the approved library. Approved memories are the only ones exposed to agents.

Open the dashboard →
Memory is always scoped to a repo and never leaks across workspaces. Proposed memories are treated as suggestions until a human approves them.