diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 7742924..dabcec4 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,5 +1,5 @@ { - "name": "past", + "name": "pastdotdev", "description": "Connectors that give Claude Code a memory, built on the past.dev Memory API.", "owner": { "name": "past.dev", @@ -7,10 +7,10 @@ }, "plugins": [ { - "name": "past", + "name": "pastdotdev", "source": "./plugins/past", "description": "Your Claude Code sessions become memory, and every session starts briefed.", - "version": "0.2.1", + "version": "0.3.0", "author": { "name": "past.dev", "url": "https://past.dev" diff --git a/CLAUDE.md b/CLAUDE.md index d9f9290..496f93b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -38,7 +38,7 @@ plugins/past/ hooks/hooks.json SessionStart, UserPromptSubmit, Stop, PreCompact, SessionEnd .mcp.json past_recall: the script's mcp mode, started by Claude Code bin/past-hook.mjs the whole connector, one file, no dependencies - commands/ /past:connect, :status, :cut, :ingest, :backfill + commands/ /pastdotdev:connect, :status, :cut, :ingest, :backfill skills/past/SKILL.md teaches Claude when to search history LICENSE the same license: an install copies this folder and nothing else .github/workflows/check.yml every pull request: the script parses and runs, the manifests validate @@ -52,7 +52,7 @@ Use `updateState` for every change. Keep transcript hashes and pending sessions ## The rules this code keeps 1. **A hook never breaks the session.** Every mode exits 0, prints valid JSON or nothing, and - swallows its own failures. `/past:status` is where a person learns something is wrong, so a + swallows its own failures. `/pastdotdev:status` is where a person learns something is wrong, so a failed send is kept in `state.lastError` for it. 2. **Only prose travels.** A session is ~10 MB on disk and ~30 KB of prose. Tool results, file contents, diffs, subagent threads and harness-injected turns are cut. Sending the transcript @@ -74,7 +74,7 @@ Use `updateState` for every change. Keep transcript hashes and pending sessions Closing a window or quitting the app kills it without a `SessionEnd`; the waiter sees it gone within the minute and sends the session as ended. There is no `ps` on Windows, so no owner there, and the idle timer alone applies. - - `ensureWaiters` (`Stop`, `SessionStart`, `/past:status`) replaces a waiter that died or that + - `ensureWaiters` (`Stop`, `SessionStart`, `/pastdotdev:status`) replaces a waiter that died or that an older `WAITER_VERSION` started — bump it whenever the waiter changes — and a replacement past its deadline sends at once. A waiter that a newer copy started is left alone. - In Claude Code, `SessionEnd` clears the stamp and detaches the send (`flush` mode), because @@ -96,8 +96,8 @@ Use `updateState` for every change. Keep transcript hashes and pending sessions One session is `ingest`, which sends at once — running it is the consent — and may send the current one, which then stays pending. `cut` defaults to the current session, then to the most recently written transcript, never the largest. -7. **Two ways in, one store.** `/past:connect` works wherever Claude Code runs and is the one the - docs lead with. The settings form (`userConfig`, opened by `/plugin configure past@past` in the +7. **Two ways in, one store.** `/pastdotdev:connect` works wherever Claude Code runs and is the one the + docs lead with. The settings form (`userConfig`, opened by `/plugin configure pastdotdev@pastdotdev` in the terminal CLI only; the key masked and kept in the system credential store) is the alternative. Both end in `~/.past/config.json`, which every mode reads. Form values reach hooks only, as `CLAUDE_PLUGIN_OPTION_*`, so they land at the next hook, not when the form @@ -159,11 +159,14 @@ Use `updateState` for every change. Keep transcript hashes and pending sessions 13. **The product is written past.dev.** Every sentence a person reads says past.dev: the READMEs, the manifests' display names, the commands' and the skill's text, what a mode prints. - Identifiers keep `past`: the plugin and marketplace names (`past@past`), the commands - (`/past:connect`), `~/.past`, the key prefix `past_sk_` and the data point ids. So does the - recall block's header, `=== past · recalled from memory ===`: the script drops a block by that - exact text from the sessions it sends, so a changed header would change how old sessions render - and send them all again (rule 10). + An identifier that cannot hold the dot says `pastdotdev`: the plugin and marketplace names + (`pastdotdev@pastdotdev`, since 0.3.0) and so the commands (`/pastdotdev:connect`). A few + identifiers keep `past` because changing them would break what is already in place: `~/.past` + (shared with the other past.dev plugins), the key prefix `past_sk_`, the data point ids, the MCP + server `past` in `.mcp.json` and its tool `past_recall`, and the recall block's header, + `=== past · recalled from memory ===`. The script drops a block by that exact text from the + sessions it sends, so a changed header would change how old sessions render and send them all + again (rule 10). 14. **A hook answers Claude Code's own events alone.** Another agent can load this plugin's hooks and run them on events of its own, about a conversation that is not Claude Code's. Claude Code names the event in every hook's input (`hook_event_name`), so each hook mode checks that it is @@ -205,20 +208,20 @@ cannot read the conversation and can only be recalled from. every memory drawn from the item, `label` names the session, `metadata` carries `conversationId`, `sessionId`, `project`, `gitBranch`, `sitting`. A batch takes up to 1,000 items and 16 MB of content. -- `POST /api/v1/recall` — **`identity` is required**. Recall stays off until `/past:connect` +- `POST /api/v1/recall` — **`identity` is required**. Recall stays off until `/pastdotdev:connect` sets one. The response is one result per document in rank order; the hooks read each result's `content` and `occurredAt`, and the tool also its sources' `excerpts` and `metadata.localTime` and its artifact's `supersededAt`. The prompt hook sends `limit` 10; the tool sends `limit` 100 and `maxTokens` 2,000. - `audience` on ingest — a slug; absent means the whole project. `connect --audience` checks it with `GET /api/v1/audiences/{slug}` (404 when unknown); a later `audience-unknown` refusal is - kept in `state.lastError` for `/past:status`, like every failed send. + kept in `state.lastError` for `/pastdotdev:status`, like every failed send. - `UserPromptSubmit` gives the prompt as `prompt` on stdin. - Claude Code gives a hook `session_id`, `transcript_path`, `cwd` and `hook_event_name`, and takes `hookSpecificOutput.additionalContext` at session start and on a prompt. - A project API key (`past_sk_…`) names its own project. The plugin never sends a project id. - Claude Code starts a plugin's MCP server from the `mcpServers` file its manifest names, expands - `${CLAUDE_PLUGIN_ROOT}` in its arguments, and names its tool `mcp__plugin_past_past__past_recall`. + `${CLAUDE_PLUGIN_ROOT}` in its arguments, and names its tool `mcp__plugin_pastdotdev_past__past_recall`. If any of these contracts changes, this file changes with it. @@ -248,7 +251,7 @@ small `idleMinutes` in that config makes the idle timer testable in seconds. For the tool, pipe JSON-RPC lines (`initialize`, `tools/list`, `tools/call`) into `node plugins/past/bin/past-hook.mjs mcp` in the same throwaway home, with a stand-in answering `POST /api/v1/recall`, and check what the request carried; then install the plugin from the folder into a -throwaway `CLAUDE_CONFIG_DIR` and see `claude mcp list` report `plugin:past:past` connected. +throwaway `CLAUDE_CONFIG_DIR` and see `claude mcp list` report `plugin:pastdotdev:past` connected. **A change to the script is checked against what it sent before.** Run the old script and the new one over the same transcripts, each in a throwaway home with its own stand-in, and compare what each diff --git a/README.md b/README.md index 671c178..bd78abc 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ You need Claude Code and Node 16 or later. ``` /plugin marketplace add pastdotdev/claude-code-plugin - /plugin install past@past + /plugin install pastdotdev@pastdotdev ``` The first line adds this repository as a marketplace. The second line installs the plugin @@ -46,17 +46,17 @@ You need Claude Code and Node 16 or later. 3. **Connect it.** ``` - /past:connect + /pastdotdev:connect ``` The identity is the email or id every memory is attributed to. Recall stays off without one. -4. **Check it.** `/past:status` shows the project it talks to and what it has sent. +4. **Check it.** `/pastdotdev:status` shows the project it talks to and what it has sent. -New sessions are read from then on. `/past:backfill` lists the sessions already on this machine, +New sessions are read from then on. `/pastdotdev:backfill` lists the sessions already on this machine, estimates what sending them costs, and sends them when you confirm. -To keep the key out of the conversation, use `/plugin configure past@past` in the terminal CLI +To keep the key out of the conversation, use `/plugin configure pastdotdev@pastdotdev` in the terminal CLI instead of step 3: a form that masks the key and keeps it in your system's credential store. ## How it works @@ -94,7 +94,7 @@ and anything injected into the conversation rather than typed by a person. Strin keys, tokens or private keys become `[redacted]` before anything leaves, and recall queries are redacted the same way. -`/past:cut` prints exactly what would be sent from this session, sitting by sitting, before +`/pastdotdev:cut` prints exactly what would be sent from this session, sitting by sitting, before anything is. A session is about 10 MB on disk and about 30 KB of prose, and only the prose travels. At 350 @@ -105,16 +105,16 @@ see [past.dev/pricing](https://past.dev/pricing). | Command | What it does | |---|---| -| `/past:connect [api-url]` | connect this machine; `--audience ` sets who sees what you send | -| `/past:status` | what it is connected to, what it has sent, and the last send that failed | -| `/past:cut [session]` | print exactly what would be sent from this session, or from one you name | -| `/past:ingest [session]` | send one session now, without waiting for it to go quiet | -| `/past:backfill` | list and estimate the sessions already on this machine, then send them | +| `/pastdotdev:connect [api-url]` | connect this machine; `--audience ` sets who sees what you send | +| `/pastdotdev:status` | what it is connected to, what it has sent, and the last send that failed | +| `/pastdotdev:cut [session]` | print exactly what would be sent from this session, or from one you name | +| `/pastdotdev:ingest [session]` | send one session now, without waiting for it to go quiet | +| `/pastdotdev:backfill` | list and estimate the sessions already on this machine, then send them | ## Who sees what you send -Everyone in the project, unless you choose an audience: `/past:connect --audience `, with a -slug from the console's **Audiences** page. `/past:connect --audience project` widens it back. +Everyone in the project, unless you choose an audience: `/pastdotdev:connect --audience `, with a +slug from the console's **Audiences** page. `/pastdotdev:connect --audience project` widens it back. ## Settings @@ -124,25 +124,38 @@ half off, `idleMinutes` (720) is how long a session stays quiet before it is sen 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 +For a self-hosted past.dev, pass your deployment's URL as the third argument of `/pastdotdev:connect`. Use `https`: over plain `http` to another machine the key travels unencrypted, and the plugin says so. ## When something looks wrong -Start with `/past:status`. A hook never interrupts a session, so a problem shows up there rather +Start with `/pastdotdev:status`. A hook never interrupts a session, so a problem shows up there rather than in the conversation. - **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 + project has nothing to recall until its first sessions are in; `/pastdotdev:ingest` sends the current one now. - **A send failed.** Status shows the last failed send and what the API answered. - **The hooks stay silent.** They call `node`. Claude Code started from the Dock or a launcher finds the `node` of a login shell, which may be older than your terminal's: Node 16 or later has to come first on that path. +## Moving from past@past + +Before 0.3.0 the plugin was installed as `past@past`. To move to the new name, run these in Claude Code: + +``` +/plugin uninstall past@past +/plugin marketplace remove past +/plugin marketplace add pastdotdev/claude-code-plugin +/plugin install pastdotdev@pastdotdev +``` + +Your connection stays in `~/.past`, so you don't need to connect again, and sessions already sent aren't sent twice. + ## Remove it -`/plugin uninstall past@past`, then delete `~/.past`. Revoking the key in **Build › API keys** +`/plugin uninstall pastdotdev@pastdotdev`, then delete `~/.past`. Revoking the key in **Build › API keys** stops it at once from the server side. What was already sent stays in the project until you delete it in the console. @@ -157,7 +170,7 @@ plugins/past/ .claude-plugin/plugin.json the manifest, with the settings form hooks/hooks.json the five hooks bin/past-hook.mjs the whole plugin: one file, Node 16, no dependencies - commands/ /past:connect, :status, :cut, :ingest, :backfill + commands/ /pastdotdev:connect, :status, :cut, :ingest, :backfill skills/past/SKILL.md teaches Claude when to search past.dev ``` diff --git a/plugins/past/.claude-plugin/plugin.json b/plugins/past/.claude-plugin/plugin.json index 84d64e1..7130fe9 100644 --- a/plugins/past/.claude-plugin/plugin.json +++ b/plugins/past/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { - "name": "past", + "name": "pastdotdev", "displayName": "past.dev", - "version": "0.2.1", + "version": "0.3.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", diff --git a/plugins/past/README.md b/plugins/past/README.md index d95c80e..fe3f619 100644 --- a/plugins/past/README.md +++ b/plugins/past/README.md @@ -6,7 +6,7 @@ Your Claude Code sessions become memory, and every session opens already briefed ``` /plugin marketplace add pastdotdev/claude-code-plugin -/plugin install past@past +/plugin install pastdotdev@pastdotdev ``` The first line adds this repository as a marketplace. The second line installs the plugin from it. @@ -19,13 +19,13 @@ terminal, from the next session on; `/reload-plugins` loads it into a session al Then connect it, wherever Claude Code runs: ``` -/past:connect [api-url] +/pastdotdev:connect [api-url] ``` The project API key starts with `past_sk_` and comes from **Build › API keys** in the [console](https://app.past.dev) (not the project's id, and not the organization's `past_mk_` management key); the identity is who every memory is attributed to, and the API URL is for -self-host only. In the terminal CLI, `/plugin configure past@past` does the same through a form +self-host only. In the terminal CLI, `/plugin configure pastdotdev@pastdotdev` does the same through a form that masks the key and keeps it in your system's credential store; it takes effect at your next prompt or session. @@ -53,7 +53,7 @@ together while the agent works on it, however long. When a session continues, on and the new ones are sent again. `SessionStart` also sends any earlier session that never reached past.dev and has gone idle, which is -what covers a crash or a machine that slept. `/past:status` counts sessions as *sent* and *open*; +what covers a crash or a machine that slept. `/pastdotdev:status` counts sessions as *sent* and *open*; an open session leaves the list by itself once it is in past.dev unchanged and idle, or holds nothing to send. @@ -71,7 +71,7 @@ Not sent: tool results, file contents, diffs, command output, subagent threads, the agent injected rather than a person typing it. Strings that look like keys, tokens or private keys are replaced with `[redacted]` before anything is sent. -Run `/past:cut` to read exactly what would be sent, before you send it. +Run `/pastdotdev:cut` to read exactly what would be sent, before you send it. A session is about 10 MB on disk and about 30 KB of prose. past.dev sends the prose. At 350 bytes to the credit that is roughly 90 credits for a session. @@ -80,13 +80,13 @@ to the credit that is roughly 90 credits for a session. | Command | Does | |---|---| -| `/past:connect` | store the key, identity and audience in `~/.past/config.json`, mode `600` | -| `/past:status` | what it is connected to, what it has sent, and the last send that failed | -| `/past:cut [session]` | print exactly what would be sent from this session, or from one you name | -| `/past:ingest [session]` | send one session now — this one, or one you name | -| `/past:backfill` | list and estimate, then send, every unsent session already on this machine | +| `/pastdotdev:connect` | store the key, identity and audience in `~/.past/config.json`, mode `600` | +| `/pastdotdev:status` | what it is connected to, what it has sent, and the last send that failed | +| `/pastdotdev:cut [session]` | print exactly what would be sent from this session, or from one you name | +| `/pastdotdev:ingest [session]` | send one session now — this one, or one you name | +| `/pastdotdev:backfill` | list and estimate, then send, every unsent session already on this machine | -Without an audience everyone in the project sees what you send. `/past:connect --audience ` +Without an audience everyone in the project sees what you send. `/pastdotdev:connect --audience ` narrows it to an audience from the console; `--audience project` widens it back. **And a recall tool.** The plugin also serves `past_recall`, on a small MCP server of its own @@ -94,7 +94,7 @@ narrows it to an audience from the console; `--audience project` widens it back. when the request depends on something that block does not hold, Claude calls `past_recall` with a question of its own and reads up to a hundred dated memories, within 2,000 tokens. Each call is one recall. Claude Code asks you before the first call: allow it, for the session or for good. -`claude mcp list` shows the server as `plugin:past:past`. +`claude mcp list` shows the server as `plugin:pastdotdev:past`. The bundled skill teaches Claude when to look history up: ask what was decided, or whether something was tried before, and it looks. @@ -140,9 +140,22 @@ Everything lives in `~/.past/`, a folder only you can open: `config.json` (the c `state.json` (what was sent, as content hashes) and `activity/` (one small file per open session, for the idle timer). +## Moving from past@past + +Before 0.3.0 the plugin was installed as `past@past`. To move to the new name, run these in Claude Code: + +``` +/plugin uninstall past@past +/plugin marketplace remove past +/plugin marketplace add pastdotdev/claude-code-plugin +/plugin install pastdotdev@pastdotdev +``` + +Your connection stays in `~/.past`, so you don't need to connect again, and sessions already sent aren't sent twice. + ## Removing it -`/plugin uninstall past@past`, then delete `~/.past`. Revoking the key in **Build › API keys** +`/plugin uninstall pastdotdev@pastdotdev`, then delete `~/.past`. Revoking the key in **Build › API keys** stops it immediately from the server side. What was already sent stays until you delete it in the console. @@ -156,5 +169,5 @@ After `402 out-of-credits`, the plugin pauses the refused operation and keeps un A write refusal does not pause recall. A recall refusal pauses recall separately. On later calls, the plugin checks the balance at most once per five minutes for each paused operation. The plugin resumes when the balance covers the refused call. The server checks the balance again for each request. -Run `/past:status --refresh` after you add credits to check the balance now. +Run `/pastdotdev:status --refresh` after you add credits to check the balance now. A new API key or API URL starts with no pause from the previous connection. diff --git a/plugins/past/bin/past-hook.mjs b/plugins/past/bin/past-hook.mjs index a8068c2..fa24a12 100755 --- a/plugins/past/bin/past-hook.mjs +++ b/plugins/past/bin/past-hook.mjs @@ -49,7 +49,7 @@ const SYNTHETIC = [ ]; // How a person runs one of the plugin's commands. -const commandOf = (name) => `/past:${name}`; +const commandOf = (name) => `/pastdotdev:${name}`; // The command that opens Claude Code's settings form for the plugin. const SETTINGS_FORM = '/plugin configure'; // Claude Code names a transcript after its session. @@ -112,7 +112,7 @@ function loadConfig() { // The settings form Claude Code shows when the plugin is enabled (`userConfig` in plugin.json) // reaches hooks only, as environment variables; commands Claude runs through Bash never see it. // So a hook copies what the form holds into config.json, the one store every mode reads — but -// only a value that changed since the last copy, so a later /past:connect is not overwritten at +// only a value that changed since the last copy, so a later /pastdotdev:connect is not overwritten at // the next session start. Whichever of the two changed last wins. The state keeps a hash of what // was copied, never the value. Clearing a form field clears nothing: the file keeps the last value. const PLUGIN_OPTIONS = { @@ -131,14 +131,14 @@ function adoptPluginOptions() { const value = (process.env[variable] || '').trim(); if (!value) continue; if (field === 'apiKey' && !value.startsWith('past_sk_')) { - // Refused, but said out loud: /past:status reports it, so a wrong paste is not a mystery. + // Refused, but said out loud: /pastdotdev:status reports it, so a wrong paste is not a mystery. const problem = value.startsWith('past_mk_') ? 'management' : 'not-a-key'; if (state.optionProblem !== problem) { state.optionProblem = problem; changed = true; } continue; } if (field === 'apiKey' && state.optionProblem) { delete state.optionProblem; changed = true; } const hash = createHash('sha256').update(value).digest('hex'); - // A value already copied is left alone so a later /past:connect wins, unless the file lost it + // A value already copied is left alone so a later /pastdotdev:connect wins, unless the file lost it // (deleted or edited by hand): then the form is the only place it still lives. if (copied[field] === hash && file[field]) continue; file[field] = value; @@ -758,7 +758,7 @@ async function ingestSession(config, state, sessionId, transcriptPath, context, }, 30000); if (!result || result.error) { - // Hooks stay silent by design, so the failure is kept for /past:status to report. + // Hooks stay silent by design, so the failure is kept for /pastdotdev:status to report. let code = ''; try { code = JSON.parse(result.body).code || ''; } catch { /* not JSON */ } const lastError = { at: new Date().toISOString(), status: result ? result.error : 'unreachable', code }; @@ -1024,7 +1024,7 @@ async function modeStop(config) { /** * Every open session has exactly one live waiter of the current version. A waiter that died (a * reboot, a killed process) or that an older version started is replaced; a replacement whose - * deadline has already passed sends at once. Stop, SessionStart and /past:status all run this, so + * deadline has already passed sends at once. Stop, SessionStart and /pastdotdev:status all run this, so * a session that went overdue while nothing watched it is sent the next time any of them runs. * A waiter that a newer copy of the plugin started is left alone: an older copy can still be * running beside it. @@ -1159,7 +1159,7 @@ const credits = (bytes) => Math.ceil(bytes / 350); const creditsOf = (parts) => parts.reduce((sum, part) => sum + credits(part.bytes), 0); // Sending the history already on disk: every unsent session of this project, or of every project -// with --all. One session is /past:ingest. The session this command runs in is never part of it: +// with --all. One session is /pastdotdev:ingest. The session this command runs in is never part of it: // the hooks send it when it goes idle or ends, and sending it now as well would pay for it twice. async function modeBackfill(config, argv) { const all = argv.includes('--all'); @@ -1244,7 +1244,7 @@ function targetSession(argv, cwd) { } // Sending one session now, by hand: the save beside the auto-save. It is usually a session that -// was just read with /past:cut. The session this runs in can be sent too; it stays open, and if it +// was just read with /pastdotdev:cut. The session this runs in can be sent too; it stays open, and if it // grows its last sitting is sent again when it goes idle or ends, with any sitting begun since. async function modeIngest(config, argv) { if (!config.apiKey) { console.log(`Not connected. Run ${commandOf('connect')} first.`); return; } @@ -1391,7 +1391,7 @@ async function modeStatus(config, argv) { /** * Checks an audience slug with the project's own key. It answers true, false (no such audience), - * or null when the API could not be asked — then the slug is kept and /past:status reports a + * or null when the API could not be asked — then the slug is kept and /pastdotdev:status reports a * refusal at the first send. */ async function audienceExists(config, slug) { @@ -1488,7 +1488,7 @@ try { else console.log('Usage: past-hook '); } catch { // A hook that throws must still not break the session. The failure is swallowed on purpose; - // /past:status is where a person finds out something is wrong. + // /pastdotdev:status is where a person finds out something is wrong. } // An older Node writes to a pipe asynchronously, and an exit cuts off what the pipe has not taken // yet: a long `cut` lost everything past its first eight kilobytes. So the exit waits for both streams. diff --git a/plugins/past/commands/backfill.md b/plugins/past/commands/backfill.md index 18b116b..1ba6078 100644 --- a/plugins/past/commands/backfill.md +++ b/plugins/past/commands/backfill.md @@ -3,14 +3,14 @@ description: Send the Claude Code history already on this machine to past.dev argument-hint: [--all] --- -Send every unsent session already on this machine to past.dev. One session is `/past:ingest `. +Send every unsent session already on this machine to past.dev. One session is `/pastdotdev:ingest `. The arguments given, if any: `$ARGUMENTS` 1. Run `node "${CLAUDE_PLUGIN_ROOT}/bin/past-hook.mjs" backfill --current ${CLAUDE_SESSION_ID}` first. It sends nothing. It lists each session (date, id, prose size, credits, sittings, first prompt) and the total. Each sitting is one data point. The session you are in is always left out: it is sent when it goes idle or ends. 2. Show the user that list and **ask them to confirm**. Sending history to a server is not - something to do on their behalf. If they want only some of it, `/past:ingest ` sends one. + something to do on their behalf. If they want only some of it, `/pastdotdev:ingest ` sends one. 3. Only if they agree, run the same command with `--confirm` added. `--all` covers every project on the machine instead of this one. Include it in step 1 as well, diff --git a/plugins/past/commands/connect.md b/plugins/past/commands/connect.md index 38e3f46..fed5279 100644 --- a/plugins/past/commands/connect.md +++ b/plugins/past/commands/connect.md @@ -16,7 +16,7 @@ one was: node "${CLAUDE_PLUGIN_ROOT}/bin/past-hook.mjs" connect [api-url] [--audience ] ``` -If only an audience was given (`/past:connect --audience `), run +If only an audience was given (`/pastdotdev:connect --audience `), run `node "${CLAUDE_PLUGIN_ROOT}/bin/past-hook.mjs" connect --audience `: it changes who sees what is sent from now on and keeps the key. `--audience project` goes back to the whole project. @@ -27,15 +27,15 @@ the key in the conversation. Tell the user the two ways to connect instead: - **This command with its arguments**, wherever Claude Code runs: - `/past:connect [api-url]`. The key is redacted before a session is + `/pastdotdev:connect [api-url]`. The key is redacted before a session is sent to past.dev, but it stays in this machine's local transcript. -- **In the terminal CLI, `/plugin configure past@past`**, a form that masks the key and keeps it +- **In the terminal CLI, `/plugin configure pastdotdev@pastdotdev`**, a form that masks the key and keeps it in the system's credential store. It takes effect at the next prompt or session. The **audience** decides who in the project sees the sessions sent from this machine. Without one, everyone in the project does. It is an audience slug from the console (**Audiences**); the command checks it exists. When the user connects without one, say so in one line and how to -narrow it later: `/past:connect --audience `. +narrow it later: `/pastdotdev:connect --audience `. The **project API key** starts with `past_sk_`. It is created in the past.dev console under **Build › API keys** and shown once. It is not the project's id or handle, and not the @@ -43,5 +43,5 @@ organization's management key (`past_mk_…`). The identity is the email or id every memory is attributed to; recall stays off without one. The API URL is only for a self-hosted or staging deployment. -After it succeeds, tell them two things: new sessions are read from now on, and `/past:backfill` +After it succeeds, tell them two things: new sessions are read from now on, and `/pastdotdev:backfill` sends the history already on this machine. diff --git a/plugins/past/commands/cut.md b/plugins/past/commands/cut.md index 95746f1..4a587cd 100644 --- a/plugins/past/commands/cut.md +++ b/plugins/past/commands/cut.md @@ -25,7 +25,7 @@ sittings, one data point each: a new one starts where the session went quiet for (30 by default), and each begins with its own heading. The first line names the session and its sittings, and reports the size on disk, the size sent, and what sending it now costs. The last line says what happens next and, unless it is already in past.dev, the command that sends this session now -(`/past:ingest`). Relay that line as it is. +(`/pastdotdev:ingest`). Relay that line as it is. Then, unless the last line says the session is already in past.dev, ask the user one yes/no question: **"Send this session to past.dev now? About N credits."**, with N from the first line. If they say diff --git a/plugins/past/commands/ingest.md b/plugins/past/commands/ingest.md index 2d480a4..8524c3b 100644 --- a/plugins/past/commands/ingest.md +++ b/plugins/past/commands/ingest.md @@ -4,7 +4,7 @@ argument-hint: [session-id | transcript-path] --- Send one session to past.dev right away, instead of waiting for it to go idle or end. It is usually -the session just read with `/past:cut`. The arguments given, if any: `$ARGUMENTS` +the session just read with `/pastdotdev:cut`. The arguments given, if any: `$ARGUMENTS` If the user named a session (an id, or its first characters) or a transcript path, run: @@ -20,5 +20,5 @@ node "${CLAUDE_PLUGIN_ROOT}/bin/past-hook.mjs" ingest --session ${CLAUDE_SESSION The user asked for this send by running the command, so do not ask again. Relay the output as it is: what was sent and its cost, or why nothing was. A session still open is sent again when it -goes idle or ends if it grows, and the output says so. To see the content first, `/past:cut` +goes idle or ends if it grows, and the output says so. To see the content first, `/pastdotdev:cut` shows exactly what would be sent. diff --git a/plugins/past/commands/status.md b/plugins/past/commands/status.md index b6f67b6..bd0614c 100644 --- a/plugins/past/commands/status.md +++ b/plugins/past/commands/status.md @@ -4,7 +4,7 @@ description: Show what past.dev is connected to and what it has sent Run `node "${CLAUDE_PLUGIN_ROOT}/bin/past-hook.mjs" status` and show the output to the user as it is. -If the key or the identity is missing, say which one and point at `/past:connect`. Do not print +If the key or the identity is missing, say which one and point at `/pastdotdev:connect`. Do not print the key itself beyond the prefix the command already shows. If the user asks to check credits now, add `--refresh` to the status command.