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.
Prerequisites
- Node.js 20+ and a terminal
- Claude Code installed in your repo
- A Cortex account (create one when you sign in)
Install the CLI
npm install -g @mxbenjaminbeguin/cortexAuthenticate
Log in to store an API token locally (in ~/.cortex/credentials.json):
cortex loginConnect 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 initThis 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 hooksUse 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, warningsNew learnings captured during sessions show up as proposed memories in your inbox. Approve them and they become available to every future session.
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.
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 →