---
title: "Cortex for Codex"
canonical: https://workspace.socra.com/integrations/codex
---

Cortex

# Cortex for Codex

Give Codex your project standards and the reasons behind them. Cortex makes the relevant knowledge available before your agent changes code.

[Learn more](https://workspace.socra.com/integrations/codex#how-it-works)

[Connect Codex](https://cortex.socra.com/setup?method=plugin&agent=codex&step=marketplace)

Plugin · [All integrations](https://workspace.socra.com/integrations)

Knowledge in Cortex

Your project requirements

Your team’s standards

The reasons behind each decision

Flash the relevant Module and its dependencies

Codex

Knowledge available before the next action

How Cortex supplies knowledge to a connected agent

## Give Codex the reasons behind the code

The repository shows Codex what exists. Decisions about what should change, and why, may live in another conversation or with another person on your team.

A Module stores current knowledge about how one part of a system should work and why. When your agent flashes a Module, Cortex returns it with its declared dependencies. Your agent then checks that knowledge against the work in front of it.

[Learn more](https://workspace.socra.com/docs/cortex/concepts/modules-and-map)

## Keep the knowledge your next task will need

Save a useful decision with its reason in a Module. When the requirement changes, update that Module so a later flash retrieves the current knowledge. Version history keeps earlier revisions available.

[Learn more](https://workspace.socra.com/docs/cortex/guides/turn-agents-into-experts)

### You supply the judgment

Explain the requirement and why it matters. Review what belongs in the shared knowledge.

### Your agent retrieves it when needed

The agent finds and flashes the relevant Module before acting, then checks current evidence.

## See a recorded Cortex call

In this recorded Codex session, an agent retrieves a Module and its dependencies. Open the full chat to inspect the returned knowledge and the response that follows.

[Learn more](https://chatgpt.com/s/cx_6a9ce0495f28819191ba1b694a64dc57)

![Recorded Codex session: Cortex returns workspace-customer with five Modules and 2,216 tokens.](https://workspace.socra.com/images/cortex/workspace-customer-chat.webp)

September 5, 2026 · Codex · 5 Modules · 2,216 tokens

## Create knowledge your agent can use again

See how a Module, a dependency, and a flash work together. After connecting Cortex, you can send these prompts to your agent.

Illustrative example: a scheduling app for tutors. Replace the details with your own project and review what your agent saves.

1. ### Create a Module

   Start with what you are building. A Module gives that knowledge a name your agent can find again.

   product holds the purpose of the app and the reason behind it.

   Create product

   Copy

   ```
Help me create a product Module in Cortex. We build a scheduling app for independent tutors. Tutors need to manage lessons between teaching sessions. Check for an existing Module first. Save the knowledge and its reason, then tell me what changed and why.
```
2. ### Add a dependency

   Describe the customer in a separate Module. Make it depend on product because understanding the customer requires knowing what the app does.

   product-customer depends on product. The dependency points to the knowledge it needs.

   Connect product-customer

   Copy

   ```
Create a product-customer Module in Cortex. Our customers are independent tutors who manage their schedules on a phone between lessons. Add product to its Dependencies. Check existing Modules first. Save the knowledge and dependency, then tell me what changed and why.
```
3. ### Flash the connected knowledge

   Once both Modules are saved, ask your agent to flash product-customer. Cortex includes product first, then the customer knowledge that depends on it.

   The agent receives both Modules in one flash. It can use that knowledge when the next task needs it.

   Flash product-customer

   Copy

   ```
Flash product-customer from Cortex. Show me the returned knowledge and identify which Modules were included.
```

### What this flash includes

product

The app’s purpose. Included as a dependency.

product-customer

Who uses the app. The Module you asked to flash.

Dependencies come first. Each Module is included once.

[Learn more](https://workspace.socra.com/docs/cortex/get-started/first-workflow)

## Connect Codex to Cortex

Start with one agent. Follow the guide through Account authorization, instructions, and a real connection check.

1. ### Install Cortex

   Add the Socra marketplace and install the Cortex plugin. Guided setup walks through installation, Account authorization, and the first connection check.

   [Connect Codex](https://cortex.socra.com/setup?method=plugin&agent=codex&step=marketplace)

   Installation commands

   Copy

   ```
codex plugin marketplace add socra/agent-plugins --ref main
codex plugin add cortex@socra
codex mcp login cortex
```
2. ### Choose your Cortex Account

   The MCP login opens Socra sign-in. Select the Account you use in Cortex, then return to Codex and check the connection with /mcp.

   New to Cortex? [Create your Account](https://cortex.socra.com/login?intent=create&ref=cortex-codex). If the agent is already connected to the intended Account, continue.
3. ### Set up tools and guidance

   The plugin includes Cortex guidance through a SessionStart hook. Review and trust the Cortex hook if Codex asks, then start a new session.

   Run /mcp to check that Cortex is connected. For fewer confirmations, set default\_tools\_approval\_mode = "approve" under \[plugins."cortex@socra".mcp\_servers.cortex\] in your Codex config. The guide shows the complete configuration and how to remove Cortex tool restrictions. Your organization’s policy still applies. [Follow guided setup](https://cortex.socra.com/setup?method=plugin&agent=codex&step=marketplace).
4. ### Check the connection

   Start a new session and send this prompt. Confirm a real Cortex call returns a Module list. An empty list is valid. Check persistent guidance separately; a text-only answer or an access error does not verify the connection.

   Connection check

   Copy

   ```
Use Cortex to list the Modules I can access. Make a real Cortex tool call; an empty list is valid. Separately, report whether this new conversation received persistent Cortex guidance and what it requires. Do not change anything.
```

[Learn more](https://workspace.socra.com/docs/cortex/integrations/coding-agents#codex)

## Good to know

### What does Cortex add to Codex?

Before a change, Codex can flash the Module that governs the work. Cortex returns its declared dependencies too, so your agent can read the relevant standard and then check the repository against it.

### Can I use the same knowledge with another agent?

Yes. Connect each agent to the same Cortex Account. Each can retrieve the Modules it has permission to access. Setup is separate for each agent.

### What should I know before connecting?

A flash supplies governing knowledge. Codex still needs to inspect current code and run the checks required for the change.

### Who controls the knowledge?

Modules have owners and version history. Account permissions control access. Host approval settings control tool confirmations; instructions guide the agent’s behavior. Review changes to shared knowledge with your agent.

Cortex is part of Workspace. See the current plan, trial, and usage terms before you connect.

[Learn more](https://workspace.socra.com/pricing)

## Use Cortex with your other agents

Connect another agent to the same Account when you need it. Your knowledge stays in Cortex.

[### ChatGPT

Plugin](https://workspace.socra.com/integrations/chatgpt)[### Claude Code

Plugin](https://workspace.socra.com/integrations/claude-code)[### Cursor

Plugin](https://workspace.socra.com/integrations/cursor)[### GitHub Copilot

Plugin](https://workspace.socra.com/integrations/github-copilot)[### Claude

MCP connector](https://workspace.socra.com/integrations/claude)[### Grok

MCP connector](https://workspace.socra.com/integrations/grok)[### MCP

Remote HTTP](https://workspace.socra.com/integrations/mcp)[### the CLI

Socra CLI](https://workspace.socra.com/integrations/cli)
