Introducing a new way to review your PRs.

Read the announcement

thedotmack / claude-mem

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

View on GitHub

47 documents · Updated Nov 20, 2026

docs / work-view-experience

Work-view experience

The work-view experience turns recorded agent activity into a request-centered view of active and completed work. It helps an engineer see what a person asked for, what work was recorded, who contributed, what was produced, and what needs attention. It keeps recorded facts separate from guesses about presence, assignment, or correctness. See TeamBrain and work view for the parent model, TeamBrain workflows for shared work flow, and Hosted viewer service for the hosted reading surface.

Work-view model

The work view joins recorded work-state changes with conversations, prompts, observations, summaries, products, owner context, and review state. It presents this evidence as human requests while keeping the source records available for inspection.

The main flow is:

flowchart LR
  A[Recorded activity] --> B[Work-state and agent view]
  C[Prompts and sessions] --> D[Request projection]
  B --> D
  E[Reviews and products] --> D
  D --> F[Owner goals, focus, and rules]
  F --> G[Snapshot and live events]
  G --> H[My Work browser]

Work-state telemetry

Work-state telemetry records changes to tasks and lists over time. The work view replays those records into current status, counts, and a bounded event history. Active and completed requests therefore use the same recorded source.

Recorded time and origin order decide replay order. done and dropped close an item. Other or missing states remain open. Shared lists carry portable view facts rather than ordinary user work, so they do not become task state by themselves.

The view may add a clearer label to open work when recorded notes support it. This label changes only the display for the current item version. It never changes the work-state record. When a configured Jev service is available, the worker can label open work in the background without waiting for the main refresh job or an agent session.

References: src/…/work-state-reduce.mjs• L11-39 src/…/work-state-reduce.mjs• L60-123 src/…/work-state-labels.mjs• L153-211 src/…/auto-refresh-worker.mjs• L64-81

Agent attribution

Agent attribution answers who recorded a work update. It prefers the captured tool and session link. It then uses stable synced provenance or an explicit recorded owner. When the source cannot identify one author, repeated writes remain unknown rather than being assigned by guesswork.

The view also separates an agent's recorded lifecycle from the age of its activity. A subagent is finished only when a stop record, a returned foreground call, or an owner finish action follows its latest recorded activity. Recent activity does not prove assignment or live presence.

Sessions from scratch folders can gain a project from the repositories touched by their recorded tool calls. A session that touched no repository remains in a no-project pool. This correction affects the view only; it does not rewrite the source session.

References: src/…/agent-view.mjs• L309-365 src/…/agent-view.mjs• L420-452 src/…/session-project.mjs• L14-29 src/…/session-project.mjs• L97-126

Human request projection

Human requests are the top-level units shown in My Work. A request begins with a substantive ask from a conversation or an explicit request recorded in work-state. The projection then attaches workstreams, follow-up prompts, lifecycle facts, progress reviews, products, and evidence.

Grouping prefers recorded links over similarity. Explicit request IDs and conversation links apply within a project root. When a conversation contains several explicit requests, work without an item link stays separate instead of being placed under the most similar request.

An optional judge can route a new conversation before general grouping. A strong result joins a request. A middle result becomes an owner suggestion. A weak result starts a request of its own. If the judge is unavailable, grouping continues without that early decision. Requests that start from a new conversation first use a temporary ask-based title. A later naming step replaces it with a short task title that does not copy the opening ask.

References: src/…/request-projection.mjs• L109-117 src/…/request-projection.mjs• L212-321 src/…/request-groups.mjs• L882-945 src/…/request-groups.mjs• L146-177 src/…/request-judge.mjs• L199-221

Work products

Work products are human-facing results linked to a request. They can be published pages, pull requests, deployments, commits, branches, documents, media, or other openable files when a recorded source names them.

Each product keeps a source reference. A local file opens only while that source still names a regular file, unless a retained deliverable copy replaces it. A product from another device can stay visible as origin-only information without pretending that this device can open it.

Products are part of request versioning. A new product can make an earlier human check stale unless its recorded time proves that it existed before the check. This ties a review to the result the person actually saw.

References: src/…/work-product.mjs• L1-17 src/…/work-product.mjs• L393-450 src/…/work-product.mjs• L512-563

Request and review model

The request detail view connects a compact request card to the records behind it. Review storage records that a person looked at one exact request version. It does not certify correctness or mark an agent complete.

Evidence disclosure

Each request can lead back to prompts, sessions, summaries, observations, work-state entries, products, and tool-use links. The overview uses short summaries and bounded previews. The detail view loads the full evidence only when the engineer opens a request.

References: src/…/agent-view.mjs• L291-300 src/…/agent-view.mjs• L535-548 src/…/data-source.mjs• L180-215

Review storage

Local review state lives beside the source data so it cannot alter the synced memory records. A check applies to the content fingerprint that the person read. The fingerprint includes the recorded request content and products, so later work can require a new check.

When shared My Work state is enabled, the review becomes a shared record with stable evidence identities. A shared review is available only when its full evidence is present. Different device decisions remain a conflict until the owner reads the current version and chooses again. Local overrides can differ for the current version.

The review action requires a matching version and a state that is ready for a human check. It records that the person looked at the result. It does not certify correctness, ship the work, change agent completion, or send a message.

References: src/…/review-store.ts• L6-39 src/…/review-store.ts• L42-138 src/…/WorkViewRoutes.ts• L1837-1882

Shared ledger projection

Shared My Work state lets several devices use one durable view of request groups, progress, story, refresh state, and prompt exclusions. Local JSON files act as readable projections of those shared records rather than as an independent source of truth.

The projection protects concurrent owner decisions with observed versions and explicit conflict handling. A saved decision is durable before its local file is materialized, so a crash can leave a pending projection to finish later. Activity and generated human copy can also be published when the local device owns the source evidence. Private values are redacted before shared records leave the device.

References: src/…/shared-ledger-adapter.mjs• L51-70 src/…/shared-ledger-adapter.mjs• L159-215 src/…/shared-ledger-adapter.mjs• L230-291 src/…/shared-ledger-adapter.mjs• L354-464

Request detail

The browser first receives a compact overview with card fields, bounded product and media previews, a content fingerprint, and a detail revision. The request drawer then loads the selected request's workstreams, records, prompts, products, story, and evidence.

The detail revision covers the fields shown in the drawer. If the request changes during a detail read, the client accepts the newer overview and retries with its revision. A stale version is refused rather than silently applying an action to newer work.

References: src/…/overview.ts• L18-35 src/…/overview.ts• L48-104 src/…/WorkViewRoutes.ts• L801-825 src/…/local-source.ts• L390-449

Owner context

Owner context explains what matters to the owner and how agents should work. Goals, focus areas, and rules support the request view, but they are not ordinary request work.

Owner goals

Owner goals describe current priorities and open asks found in recent prompts. The current period shows open items. Past periods preserve earlier priorities and asks without turning goal records into request cards or new agent work.

Each goal entry carries a rank, title, dates, request counts, a summary, and dated evidence. A new run replaces the current period while retaining history. A large first mapping uses complete prompt batches. Each checked answer updates a cumulative draft so an interrupted run can resume without skipping prompts.

The saved mapping is checked against the current prompt export before publication. If the source changes or a newer goals snapshot wins, the old checkpoint is discarded. This protects newer owner context from an older run.

References: src/…/owner-goals-batches.ts• L1-113 src/…/refresh-task.ts• L313-334 src/…/refresh-task.ts• L475-647 src/…/to-work-model.ts• L487-590

Focus areas

My Focus organizes requests around durable owner work areas. A request belongs to a kept area, the permanent Other bucket, or a temporary unsorted state. Area identity is stable across renames. A merge sends requests to its target. A dismissed or unknown area does not receive a guessed placement.

Owner placement wins over automatic placement while its target remains usable. Suggested areas wait for an owner decision. The refresh can place high-confidence work through a guarded system path, while lower-confidence results remain suggestions. The browser keeps suggested areas, completed areas, and past goal periods separate from active focus.

An area marked done keeps the date on which it entered the done state. A later rename or goal edit does not move that date. Leaving done clears the date, and marking the area done again starts a new one.

References: src/…/my-focus.mjs• L15-29 src/…/my-focus.mjs• L164-267 src/…/focus-done-date.mjs• L1-10 src/…/to-focus-model.ts• L38-68 src/…/past-focus.tsx• L24-69

My Rules

My Rules stores owner preferences as if-then guidance. A rule can apply everywhere, to one project, or to one situation. It can be a learned suggestion, owner-approved guidance, active or off, replaced, or dismissed.

Suggestions keep dated prompt evidence. Approved rules render into the user-level rules file that agents load. The work view does not treat a dismissed or replaced rule as active guidance. A synced rule change rebuilds that file from saved state, so the file remains a projection rather than a second source of truth.

References: src/…/my-rules.mjs• L1-19 src/…/my-rules.mjs• L47-187 src/…/my-rules.tsx• L40-79

Hosted setup

Hosted setup offers an optional first scan of recent owner prompts. It explains the data boundary before upload and lets the owner choose which detected tools to include. The owner can skip the upload.

Selected messages can include session IDs, project names, folder paths, and timestamps. A valid hosted result can seed goals, request groups, focus areas, and rules in the local work-view context. Ongoing refresh uses the local agent path rather than hosted extraction.

The hosted result is validated before it is saved. A pending result remains until all local writes finish, so an interrupted save can resume without spending the hosted run again. Results arrive by stage, and setup can continue without waiting for every stage.

Agent installation

The setup flow lets the owner choose the agents and integrations that connect to memory before the scan begins. It shows detected tools, required and optional skills, the local Claude model choice, and the choice to share anonymized usage data. An existing installation requires explicit confirmation before its choices are replaced.

The screen keeps selections when installation fails. It reports progress while the selected tools are connected and shows the chosen tools again when installation is ready. The browser blocks submission until at least one agent is selected and until an existing-installation update is confirmed.

References: src/…/WorkViewRoutes.ts• L346-380 src/…/WorkViewRoutes.ts• L952-972 src/…/install-screen.tsx• L21-54 src/…/install-screen.tsx• L57-149

References: src/…/hosted-intent.ts• L18-52 src/…/hosted-intent.ts• L161-235 src/…/hosted-intent.ts• L297-400 src/…/reveal-screen.tsx• L51-110 src/…/workspace-screen.tsx• L41-143

Work-view refresh

Refresh keeps request groups, progress reviews, owner goals, focus placement, the build story, work-state labels, and learned preferences current. It runs one job at a time and waits when setup is active or no usable agent can run the job.

When a run is due, it prepares owner prompts, routes new conversations, groups unresolved asks, reviews requests, names requests that still copy their ask, places work in focus areas, labels open work when available, and updates the build story when its facts changed. Each step reads through the read-only memory boundary and saves through the same validation rules as interactive actions.

The owner can restrict refresh to one agent, allow all usable agents, use the API provider, or turn it off. OpenCode is also a supported local refresh agent. A failed run stays on its first usable agent unless fallback is explicitly allowed. Step models and text language are read at the start of each run. Refused answers can be checked again. A failure after a write is not retried.

Scheduled checks use a configurable interval and back off after failed runs. A stopped worker repairs an unfinished run record so My Work does not show a permanent running state. A damaged refresh status is replaceable on the next check. Background work-state labeling is separate from the main agent refresh and does not block it.

References: src/…/refresh-task.ts• L1-11 src/…/refresh-task.ts• L44-155 src/…/refresh-task.ts• L440-492 src/…/refresh-task.ts• L701-709 src/…/auto-refresh-worker.mjs• L91-169 src/…/auto-refresh-worker.mjs• L171-223

Work-view API

The local worker exposes the work view as a loopback API. It serves snapshots and evidence, streams live changes, accepts owner actions, and controls setup, refresh, conversation continuation, and focus sharing. The browser does not access the database or hosted credentials directly.

Snapshot and detail routes

The full snapshot route returns requests, agent attribution, owner context, refresh state, source health, setup state, shared-state diagnostics, and review state. The overview route returns the compact card model. The request-detail route returns the selected request and refuses a stale fingerprint or revision.

Evidence routes expose recorded source rows. Product file routes resolve a file through the record that named it and apply same-origin and sandbox rules. The browser never sends an arbitrary path to open.

References: src/…/WorkViewRoutes.ts• L804-880 src/…/work-view-api-types.ts• L138-169

Live event stream

The event route sends a complete work-view update when the projection changes. Overview events keep the normal board small. Heartbeats report feed and source health so the browser can distinguish quiet work history from a broken connection.

Only a valid work-view event or heartbeat renews feed freshness. A malformed event, an HTTP read, or a sync-only message cannot claim that the work feed is live. The browser keeps the last valid model while reconnecting and ages display times locally without inventing a work event.

References: src/…/WorkViewRoutes.ts• L843-844 src/…/WorkViewRoutes.ts• L1884-1973 src/…/local-source.ts• L508-607 src/…/work-data-source.ts• L18-60

Owner action routes

Owner routes save reviews, grouping decisions, focus decisions, rules, agent finish records, refresh requests, suggestions, and usage events. Each write checks the current state and returns the saved snapshot or a clear refusal.

Conversation routes can read a target, start or stop one local turn, open a supported desktop app, and stop an app open that belongs to the page click. These routes are local-only because the worker runs the owner's CLI with the owner's permissions.

Focus-share routes publish a privacy-limited focus page and read or write its comments through the worker. Setup routes report telemetry, scan and consent state, installation choices, installer progress, history import, and completion. The worker signs hosted calls, so cloud credentials stay out of the browser.

References: src/…/WorkViewRoutes.ts• L778-803 src/…/WorkViewRoutes.ts• L894-927 src/…/WorkViewRoutes.ts• L952-972 src/…/focus-share.ts• L61-127

API trust boundary

Work-view routes require a localhost request. Browser writes also require the local viewer origin, suitable fetch metadata, and a JSON body. Recorded files open only through their source record and are served in a sandbox. Shared product links must be safe public links.

Local paths, credential-bearing URLs, raw tool data, and other private fields are removed before shared facts leave the device. The worker signs hosted calls so the browser never receives the cloud credential.

References: src/…/WorkViewRoutes.ts• L117-146 src/…/WorkViewRoutes.ts• L839-879 src/…/work-product.mjs• L47-63 src/…/shared-projection.mjs• L23-51

My Work browser

My Work is the browser client that turns one source-neutral model into views of active and completed requests. It supports local work, a hosted viewer using the same model, and explicit sample data for design review.

Browser model

The source boundary keeps screens independent of API shapes. The model includes requests, agents, focus areas, goals, rules, refresh state, source health, and feed health. A failed read stays visible as an error. The client does not silently switch to sample data.

The main navigation contains My Work, Focus views, My Rules, Suggested areas, and Past focus. The same request identity is reused by cards, lists, agent views, team views, and the request drawer.

References: src/…/work-data-source.ts• L1-60 src/…/to-work-model.ts• L694-740 src/…/App.tsx• L119-159

Work browser

The My Work page leads with requests that need the owner and then shows work that is moving. It supports card, list, agent, and team views. Filters separate all open work, owner attention, active work, shipped work, and closed work. Sorting can favor attention, start time, or progress.

The request drawer adds workstreams, products, build story, recent records, conversations, prompts, and source evidence. It also offers review, focus movement, suggestion actions, and local conversation continuation when the source supports them. Empty and read-error states stay visible instead of being filled with invented data.

References: src/…/my-work.tsx• L51-83 src/…/my-work.tsx• L101-143 src/…/my-work.tsx• L394-448 src/…/request-detail.tsx• L105-404

Focus browser

The focus overview gives a broad view before the owner opens a request. It shows kept and suggested areas, linked work, owner attention, moving work, evidence, and asks that have not become requests. The owner can search areas and open an area to see its requests.

Suggested areas form a decision queue. Keep places an area in My Focus. Rename and merge preserve owner control. Dismiss stops the suggestion. Past focus shows done areas and earlier prompt periods. A month closing archives its asks; it does not mean that the work was completed.

Focus cards can open the full area from the card surface while keeping their secondary controls separate. The setup reveal uses the same focus information to show areas arriving during onboarding. The browser adapts the overview between full, compact, and no-artwork layouts without changing the area model.

References: src/…/to-focus-model.ts• L18-68 src/…/suggested-areas.tsx• L130-200 src/…/past-focus.tsx• L249-279 src/…/focus-overview.css• L1-13 src/…/focus-overview.css• L46-68 src/…/App.tsx• L173-227

Browser synchronization

The local adapter reads an overview when the page opens and follows the worker's server event stream. It does not use a polling loop for normal updates. A separate timer updates connection health and display ages.

Owner writes send the version shown on screen. The client uses the worker's returned snapshot as the save receipt. If a newer live model arrives while a save is in flight, that model wins the screen while the save result remains available to the caller. A stopped source session cannot change the current screen.

Buttons expose busy work to sighted and screen-reader users. A busy or explicitly disabled action ignores presses while remaining understandable and focusable. Common controls keep touch targets large enough for phone use.

References: src/…/local-source.ts• L225-279 src/…/local-source.ts• L366-449 src/…/work-slice.ts• L53-105 src/…/button.tsx• L68-135 src/…/index.css• L11-25 src/…/index.css• L372-401

Feed health

Feed health describes the browser connection and the freshness of saved work. It does not describe agent presence, task ownership, or result correctness.

The client distinguishes live, reconnecting, stale, and unavailable states. It keeps the last received work during a short outage and reports source failure when the worker cannot read saved records. Sync freshness is shown separately from feed liveness.

References: src/…/connection-status.ts• L1-140 src/…/local-source.ts• L86-161 src/…/display-time.ts• L9-31

Shared focus pages

Shared focus pages let an owner publish one kept or done focus area as a hosted page for people and agents to read and comment on. The page contains the area's goal, rollup, open requests, and not-started asks. It excludes prompts, quotes, conversations, evidence links, products, machine names, and private owner wording.

The worker builds and republishes the page from its current work view even when My Work is closed. It skips unchanged pages and stops links for areas that are no longer shareable. Sharing requires cloud credentials because the worker signs the hosted requests.

References: src/…/focus-share.ts• L1-9 src/…/focus-share.ts• L72-127 src/…/focus-share.ts• L152-205 src/…/to-shared-focus.ts• L1-114

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep work-state replay order, closed-status rules, derived label versioning, source revision, and browser save receipts aligned.
  • Keep recorded attribution separate from assignment, project scope, presence, and device freshness in both snapshots and browser labels.
  • Keep request IDs, conversation groups, project roots, judge outcomes, placeholder titles, written titles, focus placements, and source evidence aligned across projection, shared records, and detail routes.
  • Keep request fingerprints and detail revisions tied to the fields the drawer displays. A compact card and its detail must agree on the version being acted on.
  • Keep review fingerprints tied to the same evidence and product set on every device. Incomplete evidence must not look checked.
  • Keep shared ledger base hashes, conflict decisions, pending file writes, redaction, and local projection recovery aligned.
  • Keep focus-area IDs independent from names. Preserve owner placements, merges, dismissals, Other, unsorted work, and done dates during replay.
  • Keep owner-goals batch keys, cumulative drafts, source watermarks, save keys, and checkpoint recovery aligned.
  • Keep goal periods separate from request identity. A new goal run must not create request work.
  • Keep refresh agent choice, step validation, model overrides, language choice, retry boundaries, status repair, backoff, and post-write failure handling aligned.
  • Keep hosted setup consent, selected tools, staged results, upload limits, pending-save recovery, installation choices, and local continuation aligned.
  • Keep API origin checks, record-based file lookup, sandboxed file serving, safe shared links, and cloud credential isolation in place.
  • Keep valid live events, heartbeats, source readability, and sync freshness as separate signals.
  • Keep busy controls, touch targets, focus-card hit areas, and setup selection gates aligned with the browser's state model.
  • Keep the shared browser model stable across local, hosted, and sample sources. Sample data must never replace a failed real source.

Important failure modes

TriggerConsequenceGuard
A work update has no unique captured session linkThe update may be credited to the wrong agentKeep attribution unknown or use only stable provenance or an explicit recorded owner.
A stop record is missing or older than later activityA resumed subagent may appear finishedRequire finish evidence at or after the latest activity.
A conversation has several explicit requests and an item has no request linkWork may appear under the wrong requestKeep the item unlinked until the request is explicit.
A request starts with an ask-copy title and the naming step accepts another copyThe request remains owed a title on every refreshReject titles that repeat the opening ask and keep the temporary title until a distinct short title is saved.
A request changes while detail or review is being savedThe browser may act on an old versionRequire the current fingerprint and return the newest snapshot on refusal.
A new product arrives after a reviewThe old acknowledgement may cover less than the current resultInclude products in the request fingerprint and require a fresh check when needed.
A shared review lacks complete evidenceA review may appear valid without all source factsMark it unavailable until the required evidence arrives.
A shared owner decision conflicts with another deviceOne device may overwrite a newer grouping or storyRetain the local complete state and require an explicit conflict resolution for the affected decision.
A shared write commits but file materialization stopsA local compatibility file may lag the durable viewKeep pending materialization state and finish it during reconciliation.
A local work read failsThe browser may show only old workMark the source unavailable and label the last known view.
A malformed live event or heartbeat arrivesThe browser could claim that the feed is liveRenew freshness only from valid shaped events or heartbeats.
An owner-goals source changes during a batched mapA checked draft could overwrite newer owner contextCompare source identities and the saved snapshot before publishing.
A refresh step fails after writingRetrying may duplicate a write or spend more agent quotaRetry only answer or validation refusals. Keep post-write failures on the chosen agent.
A refresh worker restarts with an unfinished statusMy Work may show a run as permanently activeRepair the status when no live owner process holds it.
A cross-site write or arbitrary file path reaches the workerA remote page could change or read local workRequire loopback, the local viewer origin, JSON, and record-based file resolution.
A shared focus area is stopped during publishA late publish could restore a link the owner stoppedSerialize area actions and publish only current shareable areas.
No agent is selected or an existing install is not confirmedSetup cannot safely start the requested installationRequire one selected agent and explicit confirmation for an update.
Sample data is mistaken for local workA design fixture may be treated as real workKeep the source kind explicit and never fall back silently.

Key files

FileWhy to read it
src/…/data-source.mjsAssembles the read-only work-view snapshot.
src/…/work-state-reduce.mjsShows how recorded work-state changes become current work.
src/…/agent-view.mjsShows attribution, lifecycle evidence, and source disclosure.
src/…/request-projection.mjsShows how requests own conversations, work, products, and evidence.
src/…/request-groups.mjsShows durable grouping, request titles, progress reviews, focus inputs, and build-story inputs.
src/…/request-judge.mjsShows early conversation routing and owner suggestions.
src/…/my-focus.mjsShows durable focus areas, placements, owner decisions, and merges.
src/…/focus-done-date.mjsShows the meaning of a focus area's done date.
src/…/work-product.mjsShows how human-facing products and safe file links are identified.
src/…/review-store.tsShows local review versioning and overrides.
src/…/shared-ledger-adapter.mjsShows shared ledger projection, conflict protection, and recovery.
src/…/owner-goals-batches.tsShows resumable owner-goals mapping.
src/…/hosted-intent.tsShows hosted setup validation and pending-save recovery.
src/…/refresh-task.tsShows refresh stages, agent selection, batching, and retry boundaries.
src/…/auto-refresh-worker.mjsShows scheduled checks, status repair, backoff, and background labeling.
src/…/human-copy.mjsShows bounded evidence input and validated request wording.
src/…/focus-share.tsShows hosted focus-page publishing, comments, and link lifecycle.
src/…/WorkViewRoutes.tsDefines snapshots, detail, events, evidence, owner actions, setup, refresh, and sharing routes.
src/…/work-data-source.tsDefines the source-neutral browser model and capabilities.
src/…/to-work-model.tsMaps worker data into requests, agents, goals, focus, rules, and status.
src/…/local-source.tsConnects the browser to overview reads, SSE events, detail reads, and writes.
src/…/App.tsxShows the browser shell, navigation, source states, and page composition.
src/…/my-work.tsxShows active and completed request views.
src/…/focus-overview.cssShows focus-area card behavior and responsive focus layouts.
src/…/button.tsxShows shared busy, disabled, focus, and touch behavior for actions.
src/…/install-screen.tsxShows the agent and integration selection step in setup.
src/…/setup.cssShows the setup funnel's layout and installation states.
src/…/suggested-areas.tsxShows owner decisions for suggested focus areas.
src/…/past-focus.tsxShows done areas and archived owner-goals periods.
src/…/my-rules.tsxShows owner rule review and saved guidance.
src/…/request-detail.tsxShows request evidence, products, reviews, and local actions.