Skip to content

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

8.8 KB
Raw Blame
import{N as e}from"./parse-sse-frame-DXl4zDFf.js";import{n as t}from"./data-goals-M40Vf9Yw.js";import{zt as n}from"./index-Dknlc6p6.js";import{SetupRequestError as r}from"./setup-data-BERTvYoK.js";var i=8e3,a=1200,o=900,s=3600,c=160,l=[{id:`claude-code`,label:`Claude Code`,prompts:412,detectAt:.04},{id:`codex`,label:`Codex`,prompts:186,detectAt:.22},{id:`gemini-cli`,label:`Gemini CLI`,prompts:23,detectAt:.46}],u=[{id:`g1`,rank:1,title:`Ship the new onboarding flow before the beta invites go out`,timesAsked:9,latestAt:`10-21 17:42`},{id:`g2`,rank:2,title:`Make the invoice export match what accounting already uses`,timesAsked:5,latestAt:`10-19 11:05`},{id:`g3`,rank:3,title:`Keep the mobile app fast on older phones`,timesAsked:3,latestAt:`10-14 09:30`}],d=[{id:`w1`,title:`Rebuild the signup screens with the new copy`,agent:`claude`,lastActiveAt:`10-21 17:42`},{id:`w2`,title:`Add CSV and QuickBooks formats to invoice export`,agent:`codex`,lastActiveAt:`10-19 11:05`},{id:`w3`,title:`Find why the feed stutters on scroll`,agent:`gemini`,lastActiveAt:`10-14 09:30`}],f=[{id:`r1`,text:`Run the tests before saying something is done.`,quote:`always run the tests before you tell me it works`,quotedAt:`10-20 15:12`},{id:`r2`,text:`Keep pull requests small and focused on one change.`,quote:`one change per PR, please`,quotedAt:`10-17 10:48`},{id:`r3`,text:`Never add a new dependency without asking.`,quote:`never pull in a new package without checking with me`,quotedAt:`10-12 16:03`}],p=[{id:`m1`,title:`Signup screens ready for review`,body:`The three signup screens use the new copy. The email step now validates on blur, and the beta invite link opens straight into step two.`,project:`Onboarding`,agent:`Claude Code`,session:`Signup rebuild`,date:`2026-10-21`},{id:`m2`,title:`Invoice export formats decided`,body:`We chose CSV plus the QuickBooks IIF format. Accounting confirmed the column order; the export button ships behind a flag first.`,project:`Billing`,agent:`Codex`,session:`Invoice export`,date:`2026-10-19`},{id:`m3`,title:`Feed stutter traced to image decoding`,body:`Large thumbnails were decoded on the main thread. Moving decoding off the main thread brought scrolling back to 60 fps on the test phone.`,project:`Mobile app`,agent:`Gemini CLI`,session:`Feed performance`,date:`2026-10-14`}],m={scan:`Hosted setup failed (HTTP 503): The anonymous daily budget has been reached.`,install:`Cursor configuration could not be saved.`,checkout:`The checkout tab was closed before the card was added.`,import:`cmem.ai refused the import (HTTP 503).`,installer:`The setup program stopped (exit 1). Retry setup in this page, or run npx claude-mem install --setup browser.`,choice:`The installer is not waiting for a storage choice yet.`,stop:`Failed to fetch`},h=`No import is running, so there is nothing to stop.`,g=(e,t)=>e===`home`?`home-ready`:t?`go-kept-existing-pro`:`go-awaiting-checkout`,_=[{agent:`claude-code`,at:`2026-10-21T17:42:00.000Z`,text:`make the signup screens use the new copy and keep the old layout`},{agent:`codex`,at:`2026-10-19T11:05:00.000Z`,text:`add CSV and QuickBooks formats to the invoice export`},{agent:`claude-code`,at:`2026-10-14T09:30:00.000Z`,text:`the mobile list is slow on my old phone, find out why`}];function v(e,t,n,r){return{connectionError:null,connectionErrorKind:null,choice:null,install:{status:`waiting`,selection:null,error:null,catalog:{agents:[{id:`claude-code`,label:`Claude Code`,hint:`Recommended`,detected:!0},{id:`codex-cli`,label:`Codex CLI`,hint:`Native hooks integration`,detected:!0},{id:`cursor`,label:`Cursor`,hint:`Hooks and MCP integration`,detected:!0},{id:`opencode`,label:`OpenCode`,hint:`Plugin integration`,detected:!1},{id:`openclaw`,label:`OpenClaw`,hint:`Plugin integration`,detected:!1},{id:`hermes`,label:`Hermes Agent`,hint:`Memory provider and MCP search`,detected:!1}],skills:[{id:`how-it-works`,label:`How it works`,description:`Understand how claude-mem remembers your work.`,required:!0},{id:`make-plan`,label:`Make a plan`,description:`Turn a task into an implementation plan.`},{id:`do`,label:`Execute a plan`,description:`Carry out an implementation plan with agents.`},{id:`mem-search`,label:`Memory search`,description:`Recall decisions from previous sessions.`}],defaults:{agents:[`claude-code`,`codex-cli`,`cursor`],skills:[`how-it-works`,`make-plan`,`do`,`mem-search`],installClaudeCode:!1,disableAutoMemory:!1,telemetryEnabled:!0,claudeModel:`haiku`},reinstall:!e}},scan:{agents:[],percent:0,phase:`reading`,done:!1,error:null,improveProduct:!0,uploadedAgents:null},reveal:{goals:null,work:null,rules:null,focusAreas:null,requests:[]},extraction:t?{state:`waiting-for-agent`,step:null}:null,recentPrompts:_,checkout:null,installer:n===`installer`?{stage:`failed`,error:m.installer}:r?{stage:`waiting-for-choice`,error:null}:null,alreadyPro:!1,detectedTools:[`claude-code`,`codex`,`chatgpt`],history:e?null:{projects:3,sessions:24,observations:128},historyImport:null,suggestions:u.map(e=>e.title)}}var y=40;function b(_,b,x=!1,{scanStop:S,fail:C,installer:w=!1,importRunning:T=!1}={}){let E=v(_,x,C,w),D=new Set,O=e=>{E={...E,...e};for(let e of D)e(E)},k=E.history?.observations??0,A=e=>Math.min(100,k-e),j=e=>k?Math.min(99,Math.floor(e/k*100)):99,M=0,N;if(T&&k){let e=A(0);M=e,E={...E,historyImport:{state:`running`,percent:j(e),imported:e,skipped:0,sent:e,total:k,error:null}}}let P=new Set(C?[C]:[]),F=e=>P.delete(e),I=S,L=()=>{x||(setTimeout(()=>O({reveal:{...E.reveal,goals:u,focusAreas:[...t]}}),o),setTimeout(()=>O({reveal:{...E.reveal,work:d,requests:[...e]}}),o*2),setTimeout(()=>O({reveal:{...E.reveal,rules:f}}),o*3))},R=!1,z=()=>{R=!0;let e=Date.now(),t=setInterval(()=>{let n=Math.min(b===null?1:b/100,(Date.now()-e)/i),r=l.filter(e=>n>=e.detectAt).map(e=>({id:e.id,label:e.label,detected:!0,canRunSetup:!0,cannotRunReason:null,uploadBytes:0,prompts:Math.round(e.prompts*Math.min(1,(n-e.detectAt)/(.9-e.detectAt)))}));if(I===`failed`&&n*100>=y){clearInterval(t),R=!1,I=void 0,O({scan:{...E.scan,agents:r,percent:Math.floor(n*100),phase:`failed`,done:!0,error:m.scan}});return}let a=n===1,o=Math.floor(n*100),s=!a&&o>=98&&!x;b!==null&&n===b/100&&clearInterval(t),a&&I===`consent`?(clearInterval(t),O({scan:{...E.scan,agents:r,percent:100,phase:`awaiting-consent`,done:!1,error:null}})):(O({scan:{...E.scan,agents:r,percent:o,phase:a?`done`:n<.5?`reading`:n<.95?`checking`:s?`organizing`:`saving`,done:a,error:null},...s?{extraction:{state:`running`,step:`work`}}:a&&E.extraction?.state===`running`?{extraction:{state:`ok`,step:null}}:{}}),a&&(clearInterval(t),L()))},c)};return{kind:`sample`,subscribe(e){return D.add(e),e(E),!R&&E.install?.status===`ready`&&z(),()=>D.delete(e)},async resume(){O({installer:w?{stage:`waiting-for-choice`,error:null}:null})},async configureInstall(e){O({install:{...E.install,selection:e,status:`installing`,error:null}}),setTimeout(()=>{F(`install`)?O({install:{...E.install,status:`failed`,error:m.install}}):(O({install:{...E.install,status:`ready`}}),R||z())},a)},async retryScan(){await new Promise(e=>setTimeout(e,a)),R||z()},async continueScan(){O({scan:{...E.scan,phase:`done`,done:!0,percent:100},extraction:x?{state:`waiting-for-agent`,step:null}:{state:`ok`,step:null}}),L()},async confirmUpload(e,t){O({scan:{...E.scan,phase:`done`,done:!0,percent:100,uploadedAgents:e?t??E.scan.agents.map(e=>e.id):[]}}),e&&L()},async setImproveProduct(e){O({scan:{...E.scan,improveProduct:e}})},async choose(e,t){if(F(`choice`))throw new r(`refused`,m.choice);O({choice:e,...w?{installer:{stage:g(e.branch,E.alreadyPro),error:null}}:{}}),t&&await this.checkout()},async checkout(){O({checkout:{state:`waiting`,error:null,userCode:`K7QM-4XPT`}});let e=F(`checkout`);setTimeout(()=>O({checkout:e?{state:`failed`,error:m.checkout}:{state:`paid`,error:null}}),1500)},async complete(){},async startHistoryImport(){if(E.historyImport&&n(E.historyImport.state))return;let e=F(`import`),t=s/Math.max(1,Math.ceil(k/100)),r={state:`running`,percent:0,imported:0,skipped:0,sent:0,total:k,error:null};O({historyImport:r});let i=()=>{let n=r.sent??0,a=A(n);if(e&&n+a===k){O({historyImport:{...r,state:`failed`,error:m.import}});return}let o=Math.max(0,Math.min(M,n+a)-n),s=n+a;M=Math.max(M,s);let c=s===k;r={...r,state:c?`done`:`running`,sent:s,imported:r.imported+a-o,skipped:(r.skipped??0)+o,percent:c?100:j(s)},O({historyImport:r}),c||(N=setTimeout(i,t))};N=setTimeout(i,t)},async stopHistoryImport(){let e=()=>new Promise(e=>setTimeout(e,a));if(F(`stop`))throw await e(),new r(`unreachable`,m.stop);let t=E.historyImport;if(!t||!n(t.state))throw await e(),new r(`refused`,h);clearTimeout(N);let i=A(t.sent??0);M=Math.max(M,(t.sent??0)+i),await e(),O({historyImport:{...t,state:`stopped`,unconfirmed:i||void 0}})},async keepNote(){return 0},async forgetNote(){},async search(e){let t=e.toLowerCase().match(/[a-z0-9]+/g)?.filter(e=>e.length>3)??[];return p.filter(e=>t.some(t=>`${e.title} ${e.body} ${e.project} ${e.session}`.toLowerCase().includes(t)))}}}export{b as createSampleSetupSource};