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
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "pastdotdev",
"source": "./plugins/past",
"description": "Your Claude Code sessions become memory, and every session starts briefed.",
"version": "0.3.1",
"version": "0.4.0",
"author": {
"name": "past.dev",
"url": "https://past.dev"
Expand Down
37 changes: 29 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Claude Code
every prompt prompt recall into context: ten memories, the block naming the tool
on demand mcp past_recall, the model's own recall, on a local MCP server
every turn stop stamps the activity file, keeps one waiter on the session
compaction precompact sends the session so far
compaction precompact sends the sittings that closed; the one still open at most once an hour
session end end hands the send to a detached process (flush)
detached idle the waiter: sends once Claude Code's process is gone, or after idleMinutes
|
Expand Down Expand Up @@ -64,6 +64,12 @@ Use `updateState` for every change. Keep transcript hashes and pending sessions
the key's per-minute budget. Do not remove it.
4. **Send when a session ends, goes idle, closes or compacts; never from `Stop` itself.** `Stop`
fires every turn, and a session that grew sends its last sitting again as a new revision.
- `PreCompact` sends the sittings that closed since the last send, once each, and the one still
open only when the session's last send is an hour old (`COMPACTION_RESEND_MS`). A session that
never goes quiet compacts every few minutes, and sent whole at each one it was a new paid
revision every time; the transcript on disk loses nothing at a compaction. The held sitting
keeps its old hash in `state.json` and the whole hash stays as it was, so it goes with the
session's end or idle send.
- `Stop` only stamps `~/.past/activity/<session>.json` and keeps one detached waiter (`idle`
mode) per session. The waiter sends once the last turn is `idleMinutes` old (720 by
default), measured on the wall clock: it sleeps in one-minute slices, because a timer does
Expand Down Expand Up @@ -125,9 +131,11 @@ Use `updateState` for every change. Keep transcript hashes and pending sessions
`renderTranscript` prints are part of the content hash. A changed byte makes `backfill` send
every session already in past.dev again, as a paid revision. The same holds for `SOURCE`, `AGENT`
and `SPEAKER` at the top of the script. `sittingId` and the cut (`sittingsOf`,
`silenceMeter`) are fixed for a related reason: changed, they move the boundaries of every
`silenceMeter`, the size measured on the turns' own text) are fixed for a related reason: changed, they move the boundaries of every
session that grows afterwards, its sittings are sent again under their new ids, and the old ones
stay in past.dev beside them. A person's `sittingMinutes` cannot do that (rule 12).
stay in past.dev beside them. A person's `sittingMinutes` and `sittingKilobytes` cannot do that (rule 12). The one exception
made so far is the branch a sitting is rendered with (rule 12, 5 November 2026), bounded to
sessions that switched branches and still grow.
11. **`~/.past` is the person's alone, and the key never travels in the clear unnoticed.** The
folder is made `700` and every file in it is created `600` (`privateDir`, `writePrivate`):
never written open and narrowed afterwards, since a file that holds the key would be readable
Expand All @@ -143,11 +151,24 @@ Use `updateState` for every change. Keep transcript hashes and pending sessions
their results included (`silenceMeter`), and over nothing else: other lines, such as a pull
request's status, are written while nobody is there. So a prompt stays with its reply while the
agent works; one tool call that writes nothing for longer than a sitting is the case that parts
them. Each sitting is one data point timed at its first turn. A session only grows at its end,
so a sitting never changes once the next has begun.
- `state.json` pins `sittingMinutes` per session at its first send. A changed value applies to
the sessions sent after it: moving the boundaries of one already in past.dev would send its
sittings again under shifted ids and leave the old ones beside them.
them. A new sitting also starts once the one so far holds `sittingKilobytes` of prose (50 by
default, 10 at least), measured on the turns' own text, and only once the agent has answered:
between two of its turns, or before the person's next prompt, never between a prompt and its
first answer. So a session that never goes quiet, an agent in a loop for hours, is cut all the
same, and what a send of it carries again is one sitting rather than the whole. Each sitting is
one data point timed at its first turn. A session only grows at its end, so a sitting never
changes once the next has begun.
- `state.json` pins `sittingMinutes` and `sittingKilobytes` per session at its first send. A
changed value applies to the sessions sent after it: moving the boundaries of one already in
past.dev would send its sittings again under shifted ids and leave the old ones beside them.
A session sent in sittings before the size existed is pinned to no size (`0`), for the same
reason.
- A sitting is rendered and labelled with the branch current at its first turn (`turn.branch`,
the transcript's `gitBranch` at that entry); the whole session, whose hash is what recognises
one sent whole, keeps the last. Until 5 November 2026 every sitting carried the session's
last branch, so a switch mid-session changed every sitting's head line and sent every closed
sitting again as a paid revision. A session that never switched renders as it did; one that
switched and still grows sends its closed sittings once more, under their own branch.
- The first sitting keeps the id a whole session had (`claude-code:<sessionId>`); the others
are `claude-code:<sessionId>:<n>`. A session sent whole before sittings existed is left
alone while it is unchanged (its whole hash still matches), and when it grows its first
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ session opens recall what past.dev knows about this project ──► in
every prompt recall what past.dev knows about this prompt ──► into context
any time Claude asks past.dev itself, with past_recall ──► into context
every reply nothing is sent; the session is marked active
compaction the session so far is sent, before its detail is summarised away
compaction the sittings that closed are sent; the one still open at most once an hour
session over the session is sent: closed, its window quit, or quiet for 12 hours
```

Expand All @@ -76,7 +76,7 @@ up to ten memories; the tool returns up to a hundred, within 2,000 tokens. A rec
characters ("yes", "go on") recalls nothing.

**A session is sent in sittings.** Where a conversation went quiet for 30 minutes, the next turn
starts a new sitting. Each sitting is dated at its own first turn, so a decision made on the third
starts a new sitting; so does the next one after 50 KB of prose, once Claude has answered. Each sitting is dated at its own first turn, so a decision made on the third
day of a long conversation 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.
Expand Down Expand Up @@ -120,8 +120,9 @@ slug from the console's **Audiences** page. `/pastdotdev:connect --audience proj

`~/.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, and `deny` lists paths whose
sessions are never read. `PAST_API_KEY`, `PAST_IDENTITY` and `PAST_API_URL` override the file.
`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.
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 `/pastdotdev:connect`. Use
Expand Down
2 changes: 1 addition & 1 deletion plugins/past/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pastdotdev",
"displayName": "past.dev",
"version": "0.3.1",
"version": "0.4.0",
"description": "Your Claude Code sessions become memory, and every session starts briefed.",
"author": { "name": "past.dev", "url": "https://past.dev" },
"homepage": "https://github.com/pastdotdev/claude-code-plugin",
Expand Down
15 changes: 11 additions & 4 deletions plugins/past/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ prompt or session.
| `SessionStart` | a session opens | recalls this project's history and puts it in context |
| `UserPromptSubmit` | every prompt | recalls the ten memories closest to the prompt and puts them in context |
| `Stop` | after each reply | starts or resets the idle timer; sends nothing itself |
| `PreCompact` | the context is about to be compacted | sends the session so far, before the detail is summarised away |
| `PreCompact` | the context is about to be compacted | sends the sittings that closed since the last send; the one still open at most once an hour |
| `SessionEnd` | a session closes | sends the session's prose to past.dev |

A session also counts as over after 12 hours without a new turn (`idleMinutes` in
Expand All @@ -46,7 +46,9 @@ window instead of the conversation (quitting VS Code or the app) skips `SessionE
notices the conversation's process is gone and sends it within a minute.

**A session is sent in sittings.** A new sitting starts where the session went quiet for 30
minutes (`sittingMinutes`): nobody wrote and the agent ran nothing. Each sitting is dated at its own
minutes (`sittingMinutes`): nobody wrote and the agent ran nothing. One also starts once the
sitting so far holds 50 KB of prose (`sittingKilobytes`), after the agent's reply, so a session that
never pauses is cut all the same. Each sitting is dated at its own
first turn, and what past.dev remembers takes the date of the sitting it came from, so something said
on the third day of a conversation that ran for three days is dated that day. A prompt and its reply stay
together while the agent works on it, however long. When a session continues, only its last sitting
Expand All @@ -58,8 +60,9 @@ an open session leaves the list by itself once it is in past.dev unchanged and i
to send.

**Compaction is the moment this matters most.** When the window fills, Claude Code summarises
everything before the boundary and drops the detail. `PreCompact` sends the session first, so the
prose is durable; `SessionStart` then fires again with source `compact`, and its recall is aimed at
everything before the boundary and drops the detail. `PreCompact` sends the sittings that closed since
the last send, and the one still open at most once an hour, since the transcript on disk keeps every
turn; `SessionStart` then fires again with source `compact`, and its recall is aimed at
what this session was doing rather than at the project at large — which is exactly what the model
has just lost.

Expand Down Expand Up @@ -113,6 +116,7 @@ something was tried before, and it looks.
"ingest": true,
"idleMinutes": 720,
"sittingMinutes": 30,
"sittingKilobytes": 50,
"deny": ["/Users/you/clients/acme"]
}
```
Expand All @@ -124,6 +128,9 @@ something was tried before, and it looks.
- `sittingMinutes` is how long a session stays quiet before what follows starts a new sitting (30
by default, 5 at least). Shorter dates what past.dev remembers more closely, in more and smaller
data points. A session keeps the length it was first sent with.
- `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 the agent's reply. A session keeps the size it was
first sent with.
- `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 Down
Loading
Loading