Why do requests fail when the token expires at the same time? We already retry on a 401.
For the work behind the code.
Take your agent
work with you.
One place for your coding-agent sessions. Find earlier decisions. Bring the context into your next session.
Apple silicon beta No account required
pentimento / Earlier work, revealed beneath a painting. The idea behind our name
One archive
Every session, from every agent,
kept together.
Claude Code, Codex, Pi and the rest each write their history to a different folder. Pentimo reads those folders into one local archive, grouped by project, and lets you search the exact words that were said. This is the app itself, on sample data.
Conversation · 8 parsed messages
I will look at how the refresh is triggered before changing the retry.
[tool_call: bash] {"command":"rg -n \"refreshToken\" src/auth"}src/auth/client.ts:48: await refreshToken(); src/auth/client.ts:71: await refreshToken();
Both requests start a token refresh before either finishes. The second refresh invalidates the token returned to the first request, so another retry would repeat the race.
Decision: keep one in-flight refresh promise. Concurrent callers wait for the same result, and the promise clears when it settles so a later expiry can refresh again.
let pendingRefresh: Promise<string> | null = null;
export function refreshOnce() {
pendingRefresh ??= refreshToken().finally(() => {
pendingRefresh = null;
});
return pendingRefresh;
}Good. Add a test that proves two concurrent expiries share one refresh.
Added src/auth/refresh.test.ts with three cases and ran the file.
[tool_call: bash] {"command":"pnpm test src/auth/refresh.test.ts"}✓ concurrent requests share one refresh
✓ failed refresh can be retried
✓ a later expiry starts a new refresh3 tests passed
Session context · #7
Context compacted: 12 earlier tool results summarized.
Indexed evidence (2)
Keep one in-flight refresh promise. Concurrent callers wait for the same result, and the promise clears when it settles.
pnpm test src/auth/refresh.test.ts · 3 tests passed
One project. Four agents. Nothing to explain twice.
Search “refresh promise”, open a result, then Copy session.Context
Your next agent reads
the earlier work.
Nobody re-reads a thousand transcripts, and nobody has to. A new session in any agent asks Pentimo over MCP, gets a continuation pack of cited excerpts, and continues from the decision instead of rediscovering it. Or you copy the session yourself from the reader.
01codex · new session > Understand why auth refresh keeps one promise before touching the retry.02pentimo mcp serve · stdio { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "create_continuation_pack", "arguments": { "query": "refresh promise", "max_tokens": 4000 } } }03continuation pack · redacted # Continuation Pack Goal: Understand why auth refresh keeps one promise before touching the retry. ## Relevant Sessions 1. Fix the token refresh race (Codex, orbit) Citation: `codex:orbit-refresh:0-7` ## Decisions 1. Keep one in-flight refresh promise. Concurrent callers wait for the same result, and the promise clears when it settles. Citation: `codex:orbit-refresh:3-3` ## Key Files And Commands 1. src/auth/refresh.ts Citation: `codex:orbit-refresh:3-3` 2. src/auth/refresh.test.ts · pnpm test src/auth/refresh.test.ts Citation: `codex:orbit-refresh:5-6` ## Known Errors No error-shaped excerpts found in the scoped context. ## Suggested Next Prompt Continue the goal below using only the cited Pentimo context. Goal: Understand why auth refresh keeps one promise before touching the retry. Citations to preserve: codex:orbit-refresh:3-3, codex:orbit-refresh:5-6 ## Budget Notes Kept 2 cited excerpts within 4000 estimated tokens.
04Codex continues Codex: The earlier Codex session already settled this (codex:orbit-refresh:3-3): Keep one in-flight refresh promise. Concurrent callers wait for the same result, and the promise clears when it settles.. I will keep that approach and check src/auth/refresh.ts before changing anything.
01 / AskA new session, in a different agent, states its goal in plain words.
pen·ti·men·to
noun · an earlier layer, still there
The finished code is only
part of the story.
A painting holds the traces of how it was made. An earlier composition. A changed mind. Work that still matters beneath the surface.
Your agent sessions hold those layers too: the approach you ruled out, the bug you traced, the reason you chose this design. Pentimo keeps them within reach, and no vendor will index its competitors' sessions for you. That layer has to be yours.
Find the decision behind a changeKeep the original.
Capture and read locally, without an account. Export to Markdown, JSONL, or SQLite.
Carry the useful part forward.
Copy context into your next agent, or let it retrieve earlier work through Pentimo MCP.
Pentimo Cloud
A different machine.
The same history.
Back up the projects you choose, open earlier sessions in a browser, search by meaning, and restore your backed-up work onto a replacement Mac when a laptop dies or a job ends. Downloaded threads keep their source machine; your agent folders stay untouched.
Explore Personal CloudSigning in alone uploads nothing. You review what would upload, keep client work local, and enable backup as a separate step. Try it on the right.
Pentimo Cloud
This Mac is signed out of Pentimo Cloud. Uploads are paused; local archive and background capture continue.Sign in first. Signing in never uploads your archive.
Works with your agents
Nothing to change in how you work.
Pentimo watches the folders your agents already write to and reads them as they are. Keep the tools you use. Add a custom folder for anything else, and let any agent read the archive over MCP.
- Claude Code
~/.claude/projectsJSONL sessions and memory files - Codex
~/.codex/sessionsJSONL sessions and ~/.codex/memories - Pi
~/.pi/agent/sessionsSession trees, active branch - OpenCode
~/.local/share/opencodeSQLite, read only - Cline
~/.cline/data/sessionsTask messages - Hermes
~/.hermes/state.dbSQLite, read only - T3 Code
~/.t3/userdata/state.sqliteSQLite, read only - Conductor
~/Library/Application Support/com.conductor.appmacOS - Cursor
Configured export filesBeta - Custom agent…
any folderFormat detection
pentimo mcp serveLocal, over stdio. No network, no account. Every tool returns redacted excerpts with citations.
Search local Pentimo sessions and return cited redacted snippets.
Free on your Mac. More with Cloud.
Start with your local archive. Add Cloud when you want to take it across machines.
Desktop
Free
Find earlier work and bring it into your next session.
- Capture sessions across coding agents
- Search and read your local archive
- Reuse context with handoffs and MCP
- Export to Markdown, JSONL, or SQLite
Personal Cloud
$15 monthly
or $135 yearly, a 25% annual saving
- Keep your archive across machines
- Read synced sessions in your browser
- Search by meaning as well as keywords
- Restore your backed-up sessions
30-day money-back guarantee. Launch offer: 20% off your first 12 months of Personal Cloud.
Team is coming soon. Shared memory and team controls, $15 per seat per month. Team is not yet available to purchase.
Keep the work.
Use it again.
Download Pentimo for macOSFree · Apple silicon beta · Signed and notarized
