--- title: "past.dev for Codex" description: "Codex sessions become memory, and every prompt reaches the model with what past.dev recalls for it." canonical: https://past.dev/docs/plugins/codex last-updated: 2026-10-12 --- # past.dev for Codex > Codex sessions become memory, and every prompt reaches the model with what past.dev recalls for it. Product: past.dev Plugins. Source: https://past.dev/docs/plugins/codex ### Requirements - The Codex CLI, or local threads in the ChatGPT desktop app, on macOS or Linux. - Node 16 or later on the path of a login shell. Codex runs hooks in a login shell, which does not read `~/.zshrc`. - A project API key and an identity. > **Where Codex runs no hooks** > > The Codex IDE extension and Codex cloud tasks run no hooks, so the plugin does nothing there. Connect the [MCP server](/docs/mcp/overview) for those. ### Install the Codex plugin Run these two lines in a terminal. The first line adds the plugin's repository as a marketplace. The second line installs the plugin. ```terminal codex plugin marketplace add pastdotdev/codex-plugin codex plugin add past@past ``` In the ChatGPT desktop app, open Plugins, then Manage, then Marketplace. Add a marketplace with the source `pastdotdev/codex-plugin`, then install past.dev from its page. ### Trust the hooks Codex runs no hook until you trust it, and it does not say when it skips one. Until you do this step, the plugin recalls nothing and sends nothing. In a terminal session, run `/hooks` and trust the five past.dev hooks. In the desktop app, open the past.dev plugin and select Trust all. The trust is shared between the two, and an update of the plugin keeps it. ### Connect the Codex plugin ```codex $past:connect ``` The project API key starts with `past_sk_`. Create it on the API keys screen of the console at https://app.past.dev. Do not use the project id or the organization's `past_mk_` management key: a plugin cannot ingest or recall with them. The identity is the email or id that every memory from your sessions is attributed to. Recall answers as this identity, so recall stays off until you set one. Without an audience, every reader in the project can see what you send. Add `--audience ` to the connect command to narrow it to one audience from the console. `--audience project` widens it again. Codex runs commands in a sandbox with no network, so it asks before it runs this command outside the sandbox. Approve it. To keep the key out of the conversation, set `PAST_API_KEY` and `PAST_IDENTITY` in your environment instead. The desktop app reads them from a login shell, so put them in `~/.zprofile`. ### When Codex sessions are sent - Within a minute after the Codex process that ran the session stops, for example at the end of a `codex exec` run or when you quit the desktop app. - After 12 hours with no new turn. - Before Codex compacts the context. - At the next session start, for an earlier session that never reached past.dev. Codex can import sessions from another agent. The plugin never sends the imported part of a thread. What you say in the thread after the import is sent like any Codex session. ### Codex skills | Skill | What it does | | --- | --- | | `$past:connect` | Stores the key, the identity and the audience in `~/.past/config.json`. | | `$past:status` | Shows the connection, when the hooks last ran, and what was sent. | | `$past:cut [session]` | Prints exactly what would be sent from this session, or from the session you name. | | `$past:ingest [session]` | Sends one session now. | | `$past:backfill` | Lists the Codex sessions on this machine with their credit cost, then sends them when you agree. | | `$past:search` | Searches past.dev. Codex can choose it when you ask about earlier work. | ### If nothing is recalled 1. Run `$past:status` and read when the hooks last ran. 2. If the hooks never ran, trust them with `/hooks`. 3. If the hooks are trusted and still never run, make `node` available on the path of a login shell. ### Remove the Codex plugin Run `codex plugin remove past@past`, then delete `~/.past` if no other past.dev plugin uses it. Revoke the key on the API keys screen to stop it at once from the server side. Data that was already sent stays in past.dev until you delete it. Source code and issues: [pastdotdev/codex-plugin](https://github.com/pastdotdev/codex-plugin).