Codex¶
Codex connects to the same Spongram brain as Claude Code, through an adapter plugin published in
the public marketplace ezeeFlop/claude-plugins. The adapter registers Spongram's MCP endpoint in
Codex and ships the memory rules as skills; it has no hooks. This page describes what the adapter
does, how the server treats a Codex client, and how the two clients share one memory.
The adapter is developed and versioned in the marketplace repository, not in the Spongram server.
Its README.md there is the reference for installation details; this page summarises it and
documents the server side.
What the server does for Codex¶
The adapter sends X-Spongram-Client: codex on every request. On the server this has exactly two
effects, the same as for Claude Code:
| Effect | Detail |
|---|---|
| Persona variant | An active persona is delivered in its voice variant (tone, form of address, language, memory rule), under a priority sentence that names Codex: the project's conventions and Codex's development instructions take precedence over the persona. |
| Client tag | An add_memory whose source_description has no client= tag receives client=codex. An existing client= tag is never changed. Controlled by SPONGRAM_CLIENT_TAG_ENABLED, on by default. |
With topic scoping on, a write tagged client=codex that carries no project= tag is filed under
project=global, as for Claude Code, and not under project=desktop-inbox: Codex is a code
client, and its adapter normally supplies the project.
The header authorises nothing and does not partition memory. See client contract.
Everything else is the standard MCP surface: the same endpoint, the same brain key, the same
tools, the same scope argument on searches. No server setting is specific to
Codex and no migration is needed to add it next to Claude Code.
Requirements¶
The adapter's guided setup targets macOS:
- macOS with the login Keychain;
- Python 3.10 or later;
- a recent local Codex (command-line tool or application) that supports HTTP MCP servers with a header helper and the configuration API.
A secure setup for Linux and Windows is not implemented by the adapter. On those systems, declare
Spongram as an HTTP MCP server in Codex by hand, with the endpoint and headers described in
other MCP clients, and add X-Spongram-Client: codex.
Install and connect¶
codex plugin marketplace add ezeeFlop/claude-plugins
codex plugin add spongram-codex@sponge-theory-codex
Installing the plugin does not connect anything. Start a new Codex session and ask it to
"Configure Spongram", or invoke the spongram-setup skill. Codex then runs the adapter's setup
script, which opens local macOS dialogs:
- Instance URL. The public URL of your Spongram server. A previously saved Codex profile, or an unambiguous Spongram profile of an installed Claude Code plugin, supplies the default.
- Brain key. If a key for that URL is already in the Keychain, choose between reusing it and
entering another. Otherwise type the
spt_brain_xxxkey in a masked field, without theBearerprefix. - Verification. The script calls
initializeandtools/liston the server. It reads and writes no memory. - Registration. The script saves the non-secret settings and registers a user-level HTTP MCP
server named
spongramin Codex.
Start a new session afterwards and check the spongram server in Codex's /mcp view.
The key is typed into a system dialog. It never goes through the conversation, a command argument, an environment variable or a plain-text file. Cancelling a dialog saves nothing.
For a terminal you operate yourself, the same setup exists as
python3 <plugin-root>/scripts/configure.py --terminal.
Where the connection is stored¶
| Location | Content |
|---|---|
| macOS Keychain | The brain key, in an entry owned by the Codex adapter. |
~/.spongram/codex/connection.json |
The instance URL and a non-secret reference to the Keychain entry. |
~/.spongram/codex/runtime/ |
Private copies of the scripts that read the Keychain. |
Codex config.toml |
The MCP server URL, the X-Spongram-Client: codex header, and the command of the header helper that supplies the Authorization header at run time. |
The MCP server is registered at user level, separately from the plugin. The adapter contains no fixed server URL, so a self-hosted address works without editing the plugin.
Sharing the key with Claude Code¶
When the Claude Code plugin is installed on the same machine for the same instance URL, setup can reuse its key. It copies that one key into the Codex-owned Keychain entry and leaves Claude Code's own storage untouched.
The copy is independent afterwards. A key regenerated on the server and updated in Claude Code is not updated in Codex: run the setup again in Codex to enter the new key.
Maintenance commands¶
| Command | Effect |
|---|---|
python3 <plugin-root>/scripts/configure.py --status |
Says whether a profile is saved. Does not validate the key. |
python3 <plugin-root>/scripts/check_connection.py |
Authenticates and lists the tools. Reads and writes no memory, and refuses HTTP redirects so the key is not sent to another host. |
python3 <plugin-root>/scripts/configure.py --migrate |
After a plugin update: keeps the URL and the key, verifies the server, refreshes the helper scripts. |
python3 <plugin-root>/scripts/configure.py --remove |
Removes the MCP registration, the profile and the Codex-owned key. |
Run --remove before uninstalling the plugin. Because the MCP server is registered separately,
uninstalling the plugin alone leaves the connection in place.
What the adapter ships¶
| Component | Role |
|---|---|
Skill spongram |
The memory rules: when to write, when to recall, how to tag, which tools exist. |
Skill spongram-setup |
The guided connection described above. |
lib/project_context.py |
The project identity of the session, byte-identical to the Claude Code plugin's copy. |
scripts/ |
Setup, connection check, Keychain access, and the explicit code-map upload. |
Differences from Claude Code¶
Codex has the same tools and the same brain, without the automation that Claude Code hooks provide:
| Capability | Claude Code plugin | Codex adapter |
|---|---|---|
MCP tools, behavioural contract, scope |
Yes | Yes |
| Project context | Injected at session start by a hook | Computed on demand: the skill tells Codex to run lib/project_context.py --client codex |
| Recent memory at session start | Injected by a hook | Codex searches when the task calls for it |
| Reminder to save | Yes | No |
| Capture of the conversation at compaction or exit | Yes | No |
| Code-map refresh | Automatic, git post-commit hook |
Explicit command, no git hook installed |
| Slash commands | Yes | No: recall and statistics go through the MCP tools |
| Edits to project instruction files | None | None |
In practice, memory in Codex is written when the model follows the skill, or when you ask for it: at the end of a task worth remembering, tell Codex to save a concise summary.
Code map from Codex¶
Querying an existing map needs nothing: the code_map_* tools work over MCP. Uploading a map is an
explicit step:
python3 <plugin-root>/scripts/codemap.py build /path/to/repo
python3 <plugin-root>/scripts/codemap.py update /path/to/repo
The upload needs the extractor package, at the version pinned in the adapter's README, installed in a dedicated Python environment; the adapter does not install it. A map uploaded from Codex has the same identity as one uploaded from Claude Code, so both clients read and refresh the same map. See code map.
One brain for both clients¶
Use the same instance URL and the same brain key in Claude Code and in Codex. The group_id is set
by the server from the key, so both clients read and write one graph.
- Same project. Both adapters compute the slug with the same module and the same order:
SPONGRAM_PROJECT, then the nearest.spongram.json, then the main repository's name, then the directory name. A committed.spongram.jsongives both clients the same project without any per-client setting. If you useSPONGRAM_PROJECT, set the same value for both. See tagging and scope. - Provenance, not partition. Writes are tagged
client=codexorclient=claude-code. The tag records where a memory came from. Searches never filter on it: a decision recorded from Claude Code is recalled in Codex, and the reverse. - Same scope rules. When the server's
tools/listshows thescopeargument, both clients passscope.project, and the server keeps the current project,project=global, the active persona and untagged memories. When it does not, read scoping is off on that server and the client has to judge provenance from the tags itself: an unscoped result is not isolated by project. - Same aliases. Project aliases are stored per brain, so a grouping made from one client applies to the other.
- Same persona. A brain has one active persona. Both code clients receive its
voicevariant.
Project tags organise memory inside a brain. They are not an access boundary: isolation between users comes from the brain key only.
What leaves the machine¶
- Authorised writes and explicit code-map uploads are sent to the configured Spongram server.
- Memories returned by a search are sent to Codex and become part of the context given to its model provider.
- Nothing is captured automatically: the adapter has no session hooks and no transcript capture.