Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 125 additions & 17 deletions AGENTS.md

Large diffs are not rendered by default.

40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ You need Codex and Node 16 or later.
ones it skips: until this step the plugin does nothing. In a terminal session, `/hooks` lists
the five past.dev hooks and trusts them. In the desktop app, the plugin's page offers **Trust all**,
and so does **Settings › Hooks**; if those pages show no hooks, run `/hooks` once in a terminal
session, since the trust is shared. An update of the plugin keeps it.
session, since the trust is shared. Codex asks for this review again after each update of the
plugin: see "After an update" below.

4. **Connect it.**

Expand Down Expand Up @@ -93,6 +94,23 @@ new sitting; so does the next one after 50 KB of prose, once Codex has answered.
long thread is remembered on that day, and past.dev can tell which of two statements came later. A
session that continues sends its last sitting and the new ones again, nothing earlier.

**After an update.** Codex keeps your trust against the plugin's files, so it sets the five hooks aside each time the
plugin updates, and it installs an update by itself. A terminal session then opens on "5 hooks are
new or changed": choose **Trust all and continue**. In the desktop app, the past.dev plugin's page
says the hooks need review and offers **Trust all**. A run with no screen says nothing.

Until you review them:

- nothing is recalled at session start or before a prompt;
- `past_recall` still answers, and its answer tells Codex that the hooks wait, so that Codex tells
you;
- your sessions are still sent to past.dev, each once it has been quiet for its sitting length (30
minutes by default). This holds only where the hooks ran on this machine before: a plugin whose
hooks you never trusted sends nothing.

`$past:status` says whether the hooks wait. To stop sending while they do, set `"ingest": false` in
`~/.past/config.json`, or disable the plugin.

**Recall happens in the hooks.** A tool recalls only when the model decides to call one; a hook
recalls on every prompt. For questions about history, `$past:search` lets Codex also search past.dev on
demand, and Codex may pick it by itself when you ask what was decided or whether something was
Expand All @@ -104,7 +122,17 @@ Your prompts and Codex's replies, with the names of the project's folder and its
session's id, the model Codex ran on with its reasoning effort, and the identity you connected
with. The folder's path stays on your machine. Recall
sends queries: one when a session starts, the first 1,000 characters of each prompt, and the
questions Codex asks `past_recall`. Nothing else.
questions Codex asks `past_recall`.

Beside each sitting and each recall go a few facts about the model, which past.dev uses to show
what it saved you on the project's Dashboard: the model's name, the token counts Codex recorded
for the sitting (input, cached input, cache writes and output for each model), how you pay for the
model (by the token or with a subscription) and whether Codex's own memory is on. How you pay is
read from
whether an API key is set in the environment, never from its value, and never from the file that
holds your sign-in. Once, after the update to 0.5.0, the plugin also sends the token counts of the
sittings it had already sent: their ids and the counts, with no text. `"modelUsage": false` in
`~/.past/config.json` sends none of this. Nothing else leaves.

What you type is sent with the key it was typed under, and with no other. Nothing typed before you
connect is sent, and what was typed under one project's key never goes to another project: a
Expand Down Expand Up @@ -153,8 +181,9 @@ slug from the console's **Audiences** page. `$past:connect --audience project` w
`~/.past/config.json` holds the connection and a few switches: `recall` and `ingest` turn either
half off, `idleMinutes` (720) is how long a session stays quiet before it is sent,
`sittingMinutes` (30) is how long a pause starts a new sitting, `sittingKilobytes` (50) how much
prose does, and `deny` lists paths whose sessions are never read. `PAST_API_KEY`, `PAST_IDENTITY`
and `PAST_API_URL` override the file.
prose does, `modelUsage` sends the model's token counts and how it is paid for, and `deny` lists
paths whose sessions are never read. `PAST_API_KEY`, `PAST_IDENTITY` and `PAST_API_URL` override
the file.
Each setting is described in the [plugin's README](plugins/past/README.md#configuration).

For a self-hosted past.dev, pass your deployment's URL as the third argument of `$past:connect`. Use
Expand All @@ -168,6 +197,9 @@ than in the conversation.
- **The hooks never ran.** Status says when they last did. If they never have, they are not
trusted yet (step 3). If they are trusted and still never run, Codex did not find `node`: it runs
hooks in a login shell, which reads `~/.zprofile` but not `~/.zshrc`.
- **The hooks wait for a review.** Status says so after an update of the plugin, with the day they
last ran. Review them as in step 3; until then your sessions are still sent, and nothing is
recalled before a prompt ("After an update").
- **Nothing is recalled.** Status has to show a key and an identity: recall needs both. A new
project has nothing to recall until its first sessions are in; `$past:ingest` sends the current
one now.
Expand Down
2 changes: 1 addition & 1 deletion plugins/past/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "past",
"version": "0.4.1",
"version": "0.5.0",
"description": "Your Codex sessions become memory, and every session starts briefed.",
"author": { "name": "past.dev", "url": "https://past.dev" },
"homepage": "https://github.com/pastdotdev/codex-plugin",
Expand Down
2 changes: 1 addition & 1 deletion plugins/past/.mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"command": "node",
"args": ["bin/past-hook.mjs", "mcp"],
"cwd": ".",
"env_vars": ["PAST_API_KEY", "PAST_IDENTITY", "PAST_API_URL"],
"env_vars": ["PAST_API_KEY", "PAST_IDENTITY", "PAST_API_URL", "CODEX_HOME"],
"default_tools_approval_mode": "approve"
}
}
Expand Down
41 changes: 37 additions & 4 deletions plugins/past/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,26 @@ Codex runs no hook until you have trusted it, and says nothing about the ones it
this step the plugin does nothing. In a terminal session, `/hooks` lists the five past.dev hooks and
trusts them. In the desktop app, the past.dev plugin's page offers **Trust all**, and so does
**Settings › Hooks**; if those pages show no hooks, run `/hooks` once in a terminal session, since
the trust is shared. An update of the plugin keeps the trust.
the trust is shared. Codex asks for this review again after each update of the plugin.

## After an update

Codex keeps your trust against the plugin's files, so it sets the five hooks aside each time the
plugin updates, and it installs an update by itself. A terminal session then opens on "5 hooks are
new or changed": choose **Trust all and continue**. In the desktop app, the past.dev plugin's page
says the hooks need review and offers **Trust all**. A run with no screen says nothing.

Until you review them:

- nothing is recalled at session start or before a prompt;
- `past_recall` still answers, and its answer tells Codex that the hooks wait, so that Codex tells
you;
- your sessions are still sent to past.dev, each once it has been quiet for its sitting length (30
minutes by default). This holds only where the hooks ran on this machine before: a plugin whose
hooks you never trusted sends nothing.

`$past:status` says whether the hooks wait. To stop sending while they do, set `"ingest": false` in
`~/.past/config.json`, or disable the plugin.

## Connect

Expand Down Expand Up @@ -77,7 +96,16 @@ afterwards is sent like any Codex session.

## What leaves this machine

The prompts, the replies, and the project and branch names. That is all.
The prompts, the replies, the project and branch names, and the model each sitting ran on with
its reasoning effort.

Beside them, while `modelUsage` is on: the token counts Codex recorded for each sitting (input,
cached input, cache writes and output for each model), how the model is paid for (by the token or
with a subscription) and whether Codex's own memory is on. past.dev uses them to show what it saved
on the project's Dashboard. How the model is paid for is read from whether an API key is set in the
environment, never from its value, and never from the file that holds your sign-in. Once, after the
update to 0.5.0, the token counts of the sittings already sent go too: their ids and the counts,
with no text. That is all.

Not sent: tool calls and their output, file contents, diffs, command output, subagent threads, and
anything Codex or a hook injected rather than a person typing it. Strings that look like keys,
Expand Down Expand Up @@ -126,6 +154,7 @@ narrows it to an audience from the console; `--audience project` widens it back.
"idleMinutes": 720,
"sittingMinutes": 30,
"sittingKilobytes": 50,
"modelUsage": true,
"deny": ["/Users/you/clients/acme"]
}
```
Expand All @@ -140,6 +169,8 @@ narrows it to an audience from the console; `--audience project` widens it back.
- `sittingKilobytes` is how much prose a sitting holds before the next turn starts a new one (50
by default, 10 at least), the cut waiting for Codex's reply. A session keeps the size it was
first sent with.
- `modelUsage: false` stops the token counts, how the model is paid for and whether Codex's own
memory is on from being sent. past.dev then has less to work out what it saved from.
- `deny` holds path fragments. A session whose working directory matches one is ignored
completely — nothing is read and nothing is sent.
- `PAST_API_KEY`, `PAST_IDENTITY` and `PAST_API_URL` override the file.
Expand All @@ -148,7 +179,8 @@ narrows it to an audience from the console; `--audience project` widens it back.

## If nothing is recalled

Ask for `$past:status`. It says when the hooks last ran. If they never ran, they are not trusted
Ask for `$past:status`. It says when the hooks last ran. If they wait for a review, the plugin was
updated since: review them again ("After an update"). If they never ran, they are not trusted
yet. If they are trusted and still never run, Codex did not find `node`: it runs hooks in a login
shell, which does not read `~/.zshrc`.

Expand All @@ -160,7 +192,8 @@ Node 16 or later, on the path of a login shell.

Everything lives in `~/.past/`, a folder only you can open: `config.json` (the connection),
`state.json` (what was sent, as content hashes), `activity/` (one small file per open session, for
the idle timer) and `hosts/` (when the hooks last ran).
the idle timer) and `hosts/` (when the hooks last ran, and the watcher that sends your sessions
while the hooks wait for a review).

## Removing it

Expand Down
Loading
Loading