Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Local setup funnel
Start the funnel at the local install screen shown by npx claude-mem install
at /?setup=1. Count unique setup attempts that render each screen.
The installer creates a
fresh UUIDv4 setup_flow_id for each browser setup attempt and saves it with
the live setup session. All events use setup:<UUID> as their PostHog distinct
ID. This identity is separate from the worker's persistent anonymous ID.
Current telemetry consent is checked on every worker request and capture;
the flow ID is forwarded to installer OAuth only when telemetry is allowed.
Sample previews never request a telemetry context or emit events.
Screens and branches
setup_funnel_version = 2 starts with installer 16.1.1. The monthly trial follows
install → scan → reveal → checkout → savings → finish-setup → launch → workspace.
The trial button on Reveal opens checkout. Choosing an alternative on Reveal
opens choice, where annual Cloud Sync opens checkout and local storage proceeds
to Finish Setup. Existing configurations can continue with their current plan.
already_prorecords whether the machine had a Cloud configuration at the start of the attempt. The defaultbranch: gobecomes a confirmed selection when the worker accepts a choice from Reveal or Choice. Useaction = choice_committedandcloud_sync_offerto count monthly or annual selections. Flows without a confirmed choice remain undecided.- Version 2 shows
savingsafter standalone Cloud Sync activation. It displays the original scan's usage and recordsaction = view_hosted_planswhen someone opens the optional hosted generation plans. Later installers no longer showsavings: the hosted offer moved to My Work, which counts its plans click as the usage eventwork_view_hosted_plans_viewed, not as a setup event. - Version 1 placed
choice → savings → checkoutafter Reveal and committed the choice on Savings. Compare releases using the version on local setup events. Attribute server checkout and Stripe trial outcomes bysetup_flow_id, even when server events use their own version. Count a monthly trial when Stripe confirms the selected monthly subscription entered its trial. Keep annual purchases and unattributed outcomes separate. - Finish Setup can enter
importand return. Successful import is a forward transition; failed import returns back. Import is optional and may be skipped. - Reduced motion skips
launchand moves directly toworkspace. - A return to a screen creates a fresh visit. A hidden tab does not.
Events
Every event includes setup_flow_id, setup_funnel_version, event_id,
visit_id, step, branch, already_pro, and branch_confirmed. The worker
uses the captured event time for PostHog's timestamp. Identifiers are random;
no prompts, paths, URLs, tokens, selected tool lists, or exception text are sent.
setup_step_viewed: a screen actually rendered, with a newvisit_id.setup_step_transitioned: the originating visit plusto_stepanddirection: forward | back. Each visit has at most one exit.setup_step_action: a closed action code, includingchoice_committed,choose_memory,open_checkout,start_import,skip_import,retry_scan,upload_allowed, andupload_skipped.setup_step_error: a closederror_code; never the error message.setup_page_hidden: the browser left or hid the page. It does not prove abandonment or its cause.setup_completed: emitted withworkspace → completeonly after the worker successfully saves setup completion. Both retain the workspace visit ID.
Count distinct visits on setup_step_viewed, then join the first transition
by flow and originating visit ID. Group progression by the view's date, not
the transition date. Unknown means no next step was recorded; do not label it
a cancellation. Keep the shared pre-choice trunk, Home, Go, and existing
configuration branches separate, and never count skipped optional screens as
failures. A checkout screen visit or setup completion is not proof of payment.
The worker accepts events only from its same-origin local UI and validates every property. Structural events bypass daily aggregation so visit joins remain possible. Completion travels with the successful completion request, before the installer can remove its session or restart the worker. Unacknowledged events (up to 200) accompany completion as one validated batch, so a slow local telemetry request cannot leave a recorded completion without its screen visits. Event IDs deduplicate that batch against concurrent sends. Temporary context-read failures retry without delaying setup; an explicit disabled/no-session response stops the retry loop.
Tests: bun test tests/telemetry/setup-funnel.test.ts tests/worker/http/routes/setup-telemetry-routes.test.ts src/ui/my-work/src/setup/setup-telemetry.test.ts plus the existing setup and
installer tests. After release, verify real events from a consenting installer.