@mbeato/contextscope 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  4. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  13. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/standalone/.next/server/app/context/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/items/page.js +3 -2
  21. package/.next/standalone/.next/server/app/items/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/items/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/page.js +4 -2
  24. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/sessions/page.js +3 -2
  27. package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08l_yt3._.js +3 -0
  30. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__093.c8l._.js +1 -1
  31. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0el6bvo._.js +1 -1
  32. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j40w4k._.js +3 -0
  33. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lbywin._.js +3 -0
  34. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p2sxww._.js +3 -0
  35. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta~v~j._.js +1 -1
  36. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wj0exw._.js +3 -0
  37. package/.next/standalone/.next/server/chunks/ssr/_0j0avc7._.js +3 -0
  38. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  39. package/.next/standalone/.next/server/pages/404.html +1 -1
  40. package/.next/standalone/.next/server/pages/500.html +1 -1
  41. package/.next/standalone/app/page.tsx +8 -2
  42. package/.next/standalone/app/sessions/page.tsx +18 -4
  43. package/.next/standalone/bin/cli.js +4 -0
  44. package/.next/standalone/lib/files.ts +8 -2
  45. package/.next/standalone/lib/hooks.ts +13 -10
  46. package/.next/standalone/lib/inventory.ts +18 -4
  47. package/.next/standalone/lib/model-prices.json +147 -0
  48. package/.next/standalone/lib/pricing.ts +80 -0
  49. package/.next/standalone/lib/sessions.ts +33 -6
  50. package/.next/standalone/lib/transcripts.ts +143 -32
  51. package/.next/standalone/package.json +2 -1
  52. package/.next/standalone/scripts/refresh-prices.mjs +58 -0
  53. package/.next/standalone/tsconfig.tsbuildinfo +1 -1
  54. package/.next/static/chunks/118uk9v3812u1.css +1 -0
  55. package/bin/cli.js +4 -0
  56. package/package.json +2 -1
  57. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0duau-w._.js +0 -3
  58. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ubqc9u._.js +0 -3
  59. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xin6g6._.js +0 -3
  60. package/.next/static/chunks/13twdc6z5jomc.css +0 -1
  61. /package/.next/static/{yFvhyffva7D2ZI82gW6Fd → kaNzMZNco9qjeyEFA-gjr}/_buildManifest.js +0 -0
  62. /package/.next/static/{yFvhyffva7D2ZI82gW6Fd → kaNzMZNco9qjeyEFA-gjr}/_clientMiddlewareManifest.js +0 -0
  63. /package/.next/static/{yFvhyffva7D2ZI82gW6Fd → kaNzMZNco9qjeyEFA-gjr}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ module.exports=[82887,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227);let e=(0,c.homedir)(),f=(0,d.join)(e,".claude.json"),g=(0,d.join)(e,".claude","mcp-servers","ptc-mcp","config.yaml");async function h(){let a,c=[];try{let c=await (0,b.readFile)(f,"utf8");a=JSON.parse(c)}catch{return c}for(let[b,d]of Object.entries(a?.mcpServers??{})){let a,e=d.type??"stdio",f="stdio"===e?`${d.command??""} ${(d.args??[]).join(" ")}`.trim():d.url??"",g="ptc"===b;g&&(a=await i()),c.push({name:b,transport:e,target:f,isPtc:g,downstream:a})}return c}async function i(){try{let a=await (0,b.readFile)(g,"utf8"),c=[],d=a.split("\n"),e=!1;for(let a of d){if(/^servers:\s*$/.test(a)){e=!0;continue}if(e&&/^\w/.test(a))break;if(!e)continue;let b=a.match(/^\s*-\s*name:\s*(\S+)\s*$/);b&&c.push(b[1])}return c}catch{return[]}}a.s(["getMcpServers",0,h])},38196,a=>{"use strict";var b=a.i(7997),c=a.i(37936),d=a.i(44721),e=a.i(55574),f=a.i(62367),g=a.i(21249),h=a.i(71120),i=a.i(82887),j=a.i(84434),k=a.i(56004);let l=new Intl.NumberFormat("en-US"),m=async function(a){var[b]=await (0,d.decryptActionBoundArgs)("409c3838ba47309422766564fe8e315449b9d6b693",a);await (0,k.disableUserItems)(b.map(a=>a.filePath))};(0,c.registerServerReference)(m,"409c3838ba47309422766564fe8e315449b9d6b693",null);let n=async function(a){var[b]=await (0,d.decryptActionBoundArgs)("40c03bfcac613440541372c390d393c5adca85bed5",a);await (0,k.togglePlugin)(b)};(0,c.registerServerReference)(n,"40c03bfcac613440541372c390d393c5adca85bed5",null);let o=async function(a){var[b]=await (0,d.decryptActionBoundArgs)("403c0ce82e7ff78139da5d2f5c8f3a598ed91a7d8f",a);await (0,k.toggleUserItem)(b)};async function p(){let[a,c,k,p,r]=await Promise.all([(0,e.getInventory)(),(0,f.getUsage)(30),(0,g.getSessions)(30),(0,h.getHooks)(),(0,i.getMcpServers)()]),s=(0,e.summarize)(a),t=a.map(a=>({...a,...(0,f.lookupUsage)(a,c)})),u=[...t].sort((a,b)=>{let c=!a.disabled&&0===a.invocations;return c!==(!b.disabled&&0===b.invocations)?c?-1:1:a.disabled!==b.disabled?a.disabled?1:-1:b.invocations-a.invocations}),v=t.filter(a=>!a.disabled&&0===a.invocations&&"user"===a.source),w=v.reduce((a,b)=>a+b.perTurnTokens,0),x=p.filter(a=>"SessionStart"===a.event&&"measured"===a.status).reduce((a,b)=>a+b.perTurnTokens,0),y=(()=>{if(0===k.length)return 0;let a=[...k].map(a=>a.totalTokens).sort((a,b)=>a-b);return a[Math.min(a.length-1,Math.floor(.75*a.length))]})(),z=k.filter(a=>a.totalTokens>y).length,A=r.filter(a=>!a.isPtc).length;return(0,b.jsx)("main",{className:"flex-1 font-mono bg-zinc-50 dark:bg-zinc-950",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-10",children:[(0,b.jsxs)("header",{className:"mb-8 flex flex-col sm:flex-row sm:items-baseline sm:justify-between gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"items"}),(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-widest text-zinc-500 mt-1",children:"skills · agents · commands"})]}),(0,b.jsxs)("code",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:[s.totalItems," loaded · ",l.format(s.totalPerTurnTokens)," tok/turn"]})]}),(0,b.jsxs)("p",{className:"mb-6 text-[10px] uppercase tracking-widest text-zinc-500",children:["toggles apply on next Claude Code restart · plugin toggles snapshot"," ",(0,b.jsx)("code",{className:"normal-case tracking-normal",children:"settings.json"})," to"," ",(0,b.jsx)("code",{className:"normal-case tracking-normal",children:"~/.claude/settings.json.usage-bak-<ts>"})," ","(5 most recent kept)"]}),(0,b.jsxs)("section",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[(0,b.jsx)(j.Receipt,{pad:"default",children:(0,b.jsx)(j.Stat,{label:"total items",value:l.format(s.totalItems),hint:`${l.format(s.totalPerTurnTokens)} tok/turn`})}),(0,b.jsx)(j.Receipt,{pad:"default",children:(0,b.jsx)(j.Stat,{label:"skills",value:l.format(s.byKind.skill.count),hint:`${l.format(s.byKind.skill.perTurnTokens)} tok/turn`})}),(0,b.jsx)(j.Receipt,{pad:"default",children:(0,b.jsx)(j.Stat,{label:"agents",value:l.format(s.byKind.agent.count),hint:`${l.format(s.byKind.agent.perTurnTokens)} tok/turn`})}),(0,b.jsx)(j.Receipt,{pad:"default",children:(0,b.jsx)(j.Stat,{label:"commands",value:l.format(s.byKind.command.count),hint:`${l.format(s.byKind.command.perTurnTokens)} tok/turn`})})]}),(0,b.jsxs)("section",{className:"mb-6 space-y-3",children:[v.length>0&&(0,b.jsx)(j.Receipt,{label:`recommendation \xb7 ${v.length} unused`,pad:"default",className:"border-amber-300 dark:border-amber-900/50 bg-amber-50/40 dark:bg-amber-950/10",children:(0,b.jsxs)("div",{className:"flex items-start gap-4 flex-wrap",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-[280px]",children:[(0,b.jsxs)("div",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:[(0,b.jsx)("span",{className:"text-2xl font-semibold tabular-nums tracking-tight mr-2",children:v.length}),"user items have not been invoked in the last ",30," days."]}),(0,b.jsxs)("div",{className:"text-xs text-zinc-500 mt-1",children:["Disable all to remove"," ",(0,b.jsx)("span",{className:"tabular-nums font-semibold text-zinc-700 dark:text-zinc-300",children:l.format(w)})," ","tok/turn. Reversible (renames file with"," ",(0,b.jsx)("code",{children:".disabled"})," suffix)."]})]}),(0,b.jsx)("form",{action:m.bind(null,(0,d.encryptActionBoundArgs)("409c3838ba47309422766564fe8e315449b9d6b693",v)),children:(0,b.jsxs)("button",{type:"submit",className:"text-[10px] uppercase tracking-widest rounded-full px-3 py-1.5 bg-amber-200 dark:bg-amber-900 text-amber-900 dark:text-amber-100 hover:bg-amber-300 dark:hover:bg-amber-800 transition-colors cursor-pointer",children:["disable all ",v.length," →"]})})]})}),x>0&&(0,b.jsxs)(j.Receipt,{label:"recommendation · sticky hook overhead",pad:"default",className:"border-zinc-200 dark:border-zinc-800",children:[(0,b.jsxs)("div",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:[(0,b.jsx)("span",{className:"text-2xl font-semibold tabular-nums tracking-tight mr-2",children:l.format(x)}),"tokens injected by SessionStart hooks every session."]}),(0,b.jsxs)("div",{className:"text-xs text-zinc-500 mt-1",children:["Sticky until restart — that overhead compounds across every turn in the session. If you don't rely on the injected content, edit"," ",(0,b.jsx)("code",{children:"hooks.SessionStart"})," in ",(0,b.jsx)("code",{children:"~/.claude/settings.json"}),"."]})]}),z>0&&y>0&&(0,b.jsxs)(j.Receipt,{label:"recommendation · long-session outliers",pad:"default",className:"border-zinc-200 dark:border-zinc-800",children:[(0,b.jsxs)("div",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:[(0,b.jsx)("span",{className:"text-2xl font-semibold tabular-nums tracking-tight mr-2",children:z}),"sessions exceeded your p75 (",y>=1e9?`${(y/1e9).toFixed(2)}B`:y>=1e6?`${(y/1e6).toFixed(1)}M`:y>=1e3?`${(y/1e3).toFixed(1)}k`:String(y)," tokens) in the last ",30," days."]}),(0,b.jsxs)("div",{className:"text-xs text-zinc-500 mt-1",children:["Long sessions amplify every per-turn cost — even small baseline overhead becomes huge when re-fed 1000+ times. Use ",(0,b.jsx)("code",{children:"/clear"})," between unrelated tasks."]})]}),A>1&&(0,b.jsxs)(j.Receipt,{label:"recommendation · mcp consolidation",pad:"default",className:"border-zinc-200 dark:border-zinc-800",children:[(0,b.jsxs)("div",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:[(0,b.jsx)("span",{className:"text-2xl font-semibold tabular-nums tracking-tight mr-2",children:A}),"MCP servers registered directly."]}),(0,b.jsx)("div",{className:"text-xs text-zinc-500 mt-1",children:"Each direct server adds its tool descriptions to the deferred-tools list. Routing through PTC (Programmatic Tool Calling) replaces all of them with 3 generic tools."})]})]}),(0,b.jsx)("section",{className:"mb-6",children:(0,b.jsx)(j.Receipt,{label:"by plugin",pad:"none",children:0===s.byPlugin.length?(0,b.jsxs)("p",{className:"px-5 py-4 text-sm text-zinc-500",children:["No plugins detected in ",(0,b.jsx)("code",{children:"~/.claude/plugins/cache/"}),"."]}):(0,b.jsxs)("table",{className:"w-full text-sm",children:[(0,b.jsx)("thead",{className:"text-left text-[10px] uppercase tracking-widest text-zinc-500 border-b border-zinc-200 dark:border-zinc-800",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-5 py-3 font-normal",children:"plugin"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-right",children:"items"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-right",children:"per turn"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-right",children:"body"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-center",children:"enabled"})]})}),(0,b.jsx)("tbody",{children:s.byPlugin.map(c=>{let e=a.find(a=>a.plugin===c.plugin),f=e?.pluginKey,g=!!e&&!e.disabled;return(0,b.jsxs)("tr",{className:"border-b border-zinc-200/60 dark:border-zinc-800/60 last:border-b-0 hover:bg-zinc-50 dark:hover:bg-zinc-950/40 transition-colors",children:[(0,b.jsx)("td",{className:"px-5 py-3",children:c.plugin}),(0,b.jsx)("td",{className:"px-5 py-3 text-right tabular-nums text-zinc-500",children:c.count}),(0,b.jsx)("td",{className:"px-5 py-3 text-right tabular-nums",children:l.format(c.perTurnTokens)}),(0,b.jsx)("td",{className:"px-5 py-3 text-right tabular-nums text-zinc-500",children:l.format(c.bodyTokens)}),(0,b.jsx)("td",{className:"px-5 py-3 text-center",children:f?(0,b.jsx)("form",{action:n.bind(null,(0,d.encryptActionBoundArgs)("40c03bfcac613440541372c390d393c5adca85bed5",f)),children:(0,b.jsx)(q,{enabled:g})}):(0,b.jsx)("span",{className:"text-xs text-zinc-400",children:"—"})})]},c.plugin)})})]})})}),(0,b.jsx)("section",{className:"mb-6",children:(0,b.jsx)(j.Receipt,{label:`all items \xb7 ${u.length} total`,pad:"none",children:(0,b.jsxs)("table",{className:"w-full text-sm",children:[(0,b.jsx)("thead",{className:"text-left text-[10px] uppercase tracking-widest text-zinc-500 border-b border-zinc-200 dark:border-zinc-800",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-5 py-3 font-normal",children:"name"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal",children:"kind"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal",children:"source"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal",children:"plugin"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-right",children:"per turn"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-right",children:"invokes"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-right",children:"last"}),(0,b.jsx)("th",{className:"px-5 py-3 font-normal text-center",children:"enabled"})]})}),(0,b.jsx)("tbody",{children:u.map(a=>{let c=!a.disabled&&0===a.invocations,e=a.disabled?"opacity-50":c?"bg-red-50/40 dark:bg-red-950/20 hover:bg-red-50/60 dark:hover:bg-red-950/30":"hover:bg-zinc-50 dark:hover:bg-zinc-950/40";return(0,b.jsxs)("tr",{className:`border-b border-zinc-200/60 dark:border-zinc-800/60 last:border-b-0 transition-colors ${e}`,title:a.description,children:[(0,b.jsx)("td",{className:"px-5 py-3",children:(0,b.jsx)("span",{className:c?"text-red-700 dark:text-red-400":"",children:a.name})}),(0,b.jsx)("td",{className:"px-5 py-3 text-zinc-500 text-xs",children:a.kind}),(0,b.jsx)("td",{className:"px-5 py-3 text-zinc-500 text-xs",children:a.source}),(0,b.jsx)("td",{className:"px-5 py-3 text-zinc-500 text-xs truncate max-w-[160px]",children:a.plugin??"—"}),(0,b.jsx)("td",{className:"px-5 py-3 text-right tabular-nums",children:a.disabled?(0,b.jsx)("span",{className:"text-zinc-400",children:"—"}):l.format(a.perTurnTokens)}),(0,b.jsx)("td",{className:`px-5 py-3 text-right tabular-nums ${c?"text-red-700 dark:text-red-400":"text-zinc-700 dark:text-zinc-300"}`,children:a.invocations}),(0,b.jsx)("td",{className:"px-5 py-3 text-right text-zinc-500 tabular-nums text-xs",children:function(a){if(!a)return"never";let b=Math.floor((Date.now()-a)/864e5);return 0===b?"today":1===b?"1d":`${b}d`}(a.lastUsed)}),(0,b.jsx)("td",{className:"px-5 py-3 text-center",children:"user"===a.source?(0,b.jsx)("form",{action:o.bind(null,(0,d.encryptActionBoundArgs)("403c0ce82e7ff78139da5d2f5c8f3a598ed91a7d8f",a.filePath)),children:(0,b.jsx)(q,{enabled:!a.disabled})}):(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-widest text-zinc-400",title:"Plugin items can only be toggled at the plugin level",children:"plugin"})})]},a.filePath)})})]})})})]})})}function q({enabled:a}){return(0,b.jsx)("button",{type:"submit",className:`text-[10px] uppercase tracking-widest rounded-full px-2.5 py-1 border transition-colors cursor-pointer ${a?"text-emerald-700 dark:text-emerald-300 border-emerald-300/60 dark:border-emerald-800/60 bg-emerald-50/50 dark:bg-emerald-950/30 hover:bg-zinc-100 dark:hover:bg-zinc-900 hover:text-zinc-600 dark:hover:text-zinc-400 hover:border-zinc-300 dark:hover:border-zinc-700":"text-zinc-500 border-zinc-300 dark:border-zinc-700 hover:bg-emerald-50/50 dark:hover:bg-emerald-950/30 hover:text-emerald-700 dark:hover:text-emerald-300 hover:border-emerald-300/60 dark:hover:border-emerald-800/60"}`,"aria-pressed":a,title:a?"Click to disable":"Click to enable",children:a?"on":"off"})}(0,c.registerServerReference)(o,"403c0ce82e7ff78139da5d2f5c8f3a598ed91a7d8f",null),a.s(["$$RSC_SERVER_ACTION_0",0,m,"$$RSC_SERVER_ACTION_1",0,n,"$$RSC_SERVER_ACTION_2",0,o,"default",0,p,"dynamic",0,"force-dynamic"])},39470,a=>{"use strict";var b=a.i(38196),c=a.i(56004);a.s([],15211),a.i(15211),a.s(["40313b416b27ed3146caaeb6626e778d79a763844a",()=>c.disableUserItems,"403c0ce82e7ff78139da5d2f5c8f3a598ed91a7d8f",()=>b.$$RSC_SERVER_ACTION_2,"40434b25f068566ff30915fb27ff295e1706d99336",()=>c.togglePlugin,"409c3838ba47309422766564fe8e315449b9d6b693",()=>b.$$RSC_SERVER_ACTION_0,"40c03bfcac613440541372c390d393c5adca85bed5",()=>b.$$RSC_SERVER_ACTION_1,"40d28d9083db975c0124c656d5480bb2767eeaed78",()=>c.toggleUserItem],39470)},87903,a=>{a.v(a=>Promise.resolve().then(()=>a(12714)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0wj0exw._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[13952,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227),e=a.i(23789);let f=(0,c.homedir)(),g=(0,d.join)(f,".claude"),h=(0,d.join)(g,"projects"),i=(0,e.getEncoding)("cl100k_base"),j=[f],k=new Set(["node_modules",".git",".next","dist","build",".turbo",".vercel",".cache",".pnpm-store",".vscode",".antigravity",".bun",".cursor",".windsurf","worktrees"]);async function l(a){try{return await (0,b.stat)(a),!0}catch{return!1}}async function m(a){try{var c;return c=await (0,b.readFile)(a,"utf8"),i.encode(c).length}catch{return 0}}async function n(a,c,e){let f;if(!(c>4)){try{f=await (0,b.readdir)(a,{withFileTypes:!0})}catch{return}for(let b of f){if(b.name.startsWith(".")&&".claude"!==b.name&&(k.has(b.name)||c>0)||k.has(b.name))continue;let f=(0,d.join)(a,b.name);b.isDirectory()?await n(f,c+1,e):b.isFile()&&"CLAUDE.md"===b.name&&e.push(f)}}}async function o(){let a=[],c=(0,d.join)(g,"CLAUDE.md");await l(c)&&a.push({category:"claude-md-global",name:"~/.claude/CLAUDE.md",filePath:c,tokens:await m(c),loadedWhen:"every session"});let e=[];for(let a of j)await n(a,0,e);for(let b of e){if(b===c)continue;let d=await m(b),e=b.replace(f,"~"),g=e.replace(/\/CLAUDE\.md$/,"");a.push({category:"claude-md-project",name:e,filePath:b,tokens:d,loadedWhen:`when cwd is ${g} (or below)`})}if(await l(h)){let c=[];try{c=await (0,b.readdir)(h,{withFileTypes:!0})}catch{c=[]}for(let b of c){if(!b.isDirectory())continue;let c=String(b.name),e=(0,d.join)(h,c,"memory","MEMORY.md");if(!await l(e))continue;let f=c.replace(/^-/,"/").replaceAll("-","/").replace(/[\x00-\x1f\x7f]/g,"");a.push({category:"memory-md",name:`${c}/memory/MEMORY.md`,filePath:e,tokens:await m(e),loadedWhen:`in project ${f}`})}}return a.sort((a,b)=>b.tokens-a.tokens)}a.s(["getContextFiles",0,o])},50708,a=>{"use strict";var b=a.i(7997),c=a.i(37936),d=a.i(44721),e=a.i(95936),f=a.i(55574),g=a.i(62367),h=a.i(21249),i=a.i(13952),j=a.i(71120),k=a.i(78110),l=a.i(84434),m=a.i(56004);let n=new Intl.NumberFormat("en-US");function o(a){return a>=1e9?`${(a/1e9).toFixed(2)}B`:a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}let p=async function(a){var[b]=await (0,d.decryptActionBoundArgs)("40b82ab2b5a2575d5c2beb515f28609f42c434a44f",a);await (0,m.toggleUserItem)(b)};async function q(){let[a,c,m,q,r]=await Promise.all([(0,f.getInventory)(),(0,g.getUsage)(30),(0,h.getSessions)(30),(0,i.getContextFiles)(),(0,j.getHooks)()]),s=(0,f.summarize)(a),t=(0,h.summarizeSessions)(m),u=a.map(a=>({...a,...(0,g.lookupUsage)(a,c)})).filter(a=>!a.disabled&&0===a.invocations&&"user"===a.source).sort((a,b)=>b.perTurnTokens-a.perTurnTokens).slice(0,5),v=u.reduce((a,b)=>a+b.perTurnTokens,0),w=q.find(a=>"claude-md-global"===a.category),x=q.filter(a=>"memory-md"===a.category).sort((a,b)=>b.tokens-a.tokens)[0],y=r.filter(a=>"SessionStart"===a.event&&"measured"===a.status).reduce((a,b)=>a+b.perTurnTokens,0),z=Math.max(1,...t.dailyBurn.map(a=>a.tokens)),A=(w?.tokens??0)+(x?.tokens??0)+y,B=+!!w+ +!!x+ +(y>0);return(0,b.jsx)("main",{className:"flex-1 font-mono bg-zinc-50 dark:bg-zinc-950",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-10",children:[(0,b.jsxs)("header",{className:"mb-8 flex flex-col sm:flex-row sm:items-baseline sm:justify-between gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"contextscope"}),(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-widest text-zinc-500 mt-1",children:"audit · trim · ship"})]}),(0,b.jsx)("code",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"~/.claude/projects/"})]}),(0,b.jsx)("section",{className:"flex justify-center mb-6",children:(0,b.jsxs)("div",{className:"w-full max-w-md rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 pt-3 pb-2 border-b border-zinc-200 dark:border-zinc-800",children:[(0,b.jsxs)("span",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:[30,"-day window"]}),(0,b.jsx)(e.default,{href:"/items",className:"text-[10px] uppercase tracking-widest text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors",children:"items →"})]}),(0,b.jsxs)("div",{className:"px-8 py-6 text-center",children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"per-turn baseline"}),(0,b.jsxs)("div",{className:"mt-2 text-4xl font-semibold tabular-nums tracking-tight text-zinc-900 dark:text-zinc-50",children:[n.format(s.totalPerTurnTokens),(0,b.jsx)("span",{className:"ml-1.5 text-sm text-zinc-500 font-normal",children:"tok"})]}),(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500 mt-1",children:"loaded into every system prompt"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-4 border-t border-zinc-200 dark:border-zinc-800 divide-x divide-zinc-200 dark:divide-zinc-800",children:[(0,b.jsx)(l.MiniStat,{label:"items",value:n.format(s.totalItems)}),(0,b.jsx)(l.MiniStat,{label:"skills",value:n.format(s.byKind.skill.count)}),(0,b.jsx)(l.MiniStat,{label:"agents",value:n.format(s.byKind.agent.count)}),(0,b.jsx)(l.MiniStat,{label:"commands",value:n.format(s.byKind.command.count)})]})]})}),(0,b.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 px-4 py-4 flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,b.jsxs)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:[30,"-day burn"]}),(0,b.jsx)(e.default,{href:"/sessions",className:"text-[10px] uppercase tracking-widest text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors",children:"sessions →"})]}),(0,b.jsxs)("div",{className:"mt-1.5 text-2xl font-semibold tabular-nums tracking-tight text-zinc-900 dark:text-zinc-50",children:[o(t.totalTokens),(0,b.jsx)("span",{className:"ml-1 text-xs text-zinc-500 font-normal",children:"tok"}),(0,b.jsx)("span",{className:"ml-2 text-xs text-zinc-500 font-normal",children:"·"}),(0,b.jsx)("span",{className:"ml-2 text-base font-semibold tabular-nums text-zinc-900 dark:text-zinc-50",children:(0,k.formatUsd)(t.totalCostUsd)}),(0,b.jsx)("span",{className:"ml-1 text-xs text-zinc-500 font-normal",children:"api"})]}),t.dailyBurn.length>0&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("div",{className:"flex items-end gap-px h-8",children:t.dailyBurn.map(a=>{let c=Math.max(2,a.tokens/z*100);return(0,b.jsx)("div",{className:"flex-1 bg-zinc-300 dark:bg-zinc-700",style:{height:`${c}%`},title:`${a.date}: ${o(a.tokens)} \xb7 ${(0,k.formatUsd)(a.cost)}`},a.date)})}),(0,b.jsxs)("div",{className:"flex items-center justify-between mt-1 text-[10px] uppercase tracking-widest text-zinc-500 tabular-nums",children:[(0,b.jsx)("span",{children:t.dailyBurn[0].date.slice(5)}),(0,b.jsxs)("span",{children:[t.dailyBurn.length," active days"]}),(0,b.jsx)("span",{children:t.dailyBurn[t.dailyBurn.length-1].date.slice(5)})]})]}),(0,b.jsxs)("div",{className:"mt-3 pt-3 border-t border-zinc-200 dark:border-zinc-800 grid grid-cols-3 text-center",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"sess"}),(0,b.jsx)("div",{className:"text-xs font-semibold tabular-nums mt-0.5",children:n.format(t.count)})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"median"}),(0,b.jsx)("div",{className:"text-xs font-semibold tabular-nums mt-0.5",children:o(t.medianSessionTokens)})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"p95"}),(0,b.jsx)("div",{className:"text-xs font-semibold tabular-nums mt-0.5",children:o(t.p95SessionTokens)})]})]})]}),(0,b.jsxs)("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 px-4 py-4 flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"disable candidates"}),(0,b.jsx)(e.default,{href:"/items",className:"text-[10px] uppercase tracking-widest text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors",children:"all →"})]}),(0,b.jsxs)("div",{className:"mt-1.5 text-2xl font-semibold tabular-nums tracking-tight text-zinc-900 dark:text-zinc-50",children:[n.format(v),(0,b.jsx)("span",{className:"ml-1 text-xs text-zinc-500 font-normal",children:"tok/turn"})]}),(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:u.length>0?`top ${u.length} unused`:"none in window"}),(0,b.jsx)("ul",{className:"mt-3 pt-3 border-t border-zinc-200 dark:border-zinc-800 text-xs space-y-1 flex-1",children:0===u.length?(0,b.jsxs)("li",{className:"text-zinc-500",children:["every loaded user item invoked in ",30,"d."]}):u.map(a=>(0,b.jsxs)("li",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-10 text-right tabular-nums text-zinc-500",children:n.format(a.perTurnTokens)}),(0,b.jsx)("span",{className:"flex-1 truncate text-zinc-700 dark:text-zinc-300",children:a.name}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-widest text-zinc-500 w-12",children:a.kind}),(0,b.jsx)("form",{action:p.bind(null,(0,d.encryptActionBoundArgs)("40b82ab2b5a2575d5c2beb515f28609f42c434a44f",a.filePath)),children:(0,b.jsx)("button",{type:"submit",className:"text-[10px] uppercase tracking-widest text-zinc-600 dark:text-zinc-400 border border-zinc-300 dark:border-zinc-700 hover:text-red-700 dark:hover:text-red-400 hover:border-red-300 dark:hover:border-red-800 hover:bg-red-50 dark:hover:bg-red-950/40 rounded px-1.5 py-0.5 transition-colors cursor-pointer",title:`Disable ${a.name}`,children:"off"})})]},a.filePath))})]}),(0,b.jsxs)("div",{className:"rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 px-4 py-4 flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"context overhead"}),(0,b.jsx)(e.default,{href:"/context",className:"text-[10px] uppercase tracking-widest text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors",children:"context →"})]}),(0,b.jsxs)("div",{className:"mt-1.5 text-2xl font-semibold tabular-nums tracking-tight text-zinc-900 dark:text-zinc-50",children:[n.format(A),(0,b.jsx)("span",{className:"ml-1 text-xs text-zinc-500 font-normal",children:"tok"})]}),(0,b.jsxs)("div",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:["top ",B," sticky"," ",1===B?"source":"sources"]}),(0,b.jsxs)("ul",{className:"mt-3 pt-3 border-t border-zinc-200 dark:border-zinc-800 text-xs space-y-1 flex-1",children:[w&&(0,b.jsxs)("li",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-10 text-right tabular-nums text-zinc-500",children:n.format(w.tokens)}),(0,b.jsx)("span",{className:"flex-1 truncate text-zinc-700 dark:text-zinc-300",children:(0,b.jsx)("code",{className:"text-[11px]",children:"~/.claude/CLAUDE.md"})}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"every"})]}),x&&(0,b.jsxs)("li",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-10 text-right tabular-nums text-zinc-500",children:n.format(x.tokens)}),(0,b.jsx)("span",{className:"flex-1 truncate text-zinc-700 dark:text-zinc-300",children:(0,b.jsx)("code",{className:"text-[11px]",children:x.name})}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"mem"})]}),y>0&&(0,b.jsxs)("li",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-10 text-right tabular-nums text-zinc-500",children:n.format(y)}),(0,b.jsx)("span",{className:"flex-1 truncate text-zinc-700 dark:text-zinc-300",children:"SessionStart hooks"}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-widest text-zinc-500",children:"sticky"})]})]})]})]}),(0,b.jsxs)("footer",{className:"mt-8 pt-4 border-t border-zinc-200 dark:border-zinc-800 text-[10px] uppercase tracking-widest text-zinc-500 flex items-center justify-between",children:[(0,b.jsx)("span",{children:"cl100k_base · cost deduped per msg.id (cc splits one msg across lines · ccusage daily sums dupes) · toggles apply on next cc restart"}),(0,b.jsx)("a",{href:"https://github.com/mbeato/contextscope",className:"text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors",children:"github →"})]})]})})}(0,c.registerServerReference)(p,"40b82ab2b5a2575d5c2beb515f28609f42c434a44f",null),a.s(["$$RSC_SERVER_ACTION_0",0,p,"default",0,q,"dynamic",0,"force-dynamic"])}];
2
+
3
+ //# sourceMappingURL=_0j0avc7._.js.map
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
7
7
  "static/chunks/03~yq9q893hmn.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/yFvhyffva7D2ZI82gW6Fd/_buildManifest.js",
11
- "static/yFvhyffva7D2ZI82gW6Fd/_ssgManifest.js",
12
- "static/yFvhyffva7D2ZI82gW6Fd/_clientMiddlewareManifest.js"
10
+ "static/kaNzMZNco9qjeyEFA-gjr/_buildManifest.js",
11
+ "static/kaNzMZNco9qjeyEFA-gjr/_ssgManifest.js",
12
+ "static/kaNzMZNco9qjeyEFA-gjr/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/00gq-v0e07i1q.js",
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en" class="h-full antialiased"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/13twdc6z5jomc.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/14hcmzto5g-b7.js" async=""></script><script src="/_next/static/chunks/0nxgnfb4qc8my.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-0wzfw6l~krt~8.js" async=""></script><script src="/_next/static/chunks/17hugzvnj-r7p.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><title>404: This page could not be found.</title><meta name="robots" content="noindex"/><title>contextscope</title><meta name="description" content="Local dashboard auditing Claude Code&#x27;s per-turn token context — skills, agents, commands, CLAUDE.md, MEMORY.md, hooks, MCP, and session analytics."/><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="min-h-full flex flex-col font-mono bg-zinc-50 dark:bg-zinc-950 text-zinc-900 dark:text-zinc-100"><div hidden=""><!--$--><!--/$--></div><nav class="border-b border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-950 sticky top-0 z-10"><div class="max-w-6xl mx-auto px-6 h-12 flex items-center gap-8 text-sm"><a class="font-semibold tracking-tight text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/">contextscope</a><div class="flex items-center gap-5"><a class="text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/items">items</a><a class="text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/sessions">sessions</a><a class="text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/context">context</a></div></div></nav><!--$--><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><!--/$--><script src="/_next/static/chunks/00gq-v0e07i1q.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:I[39756,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"LoadingBoundaryProvider\"]\n2:\"$Sreact.fragment\"\n3:I[54858,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"Nav\"]\n4:I[39756,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n5:I[37457,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\na:I[68027,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/13twdc6z5jomc.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",20],[[\"$\",\"$L1\",null,{\"loading\":[[\"$\",\"main\",\"l\",{\"className\":\"flex-1 font-mono bg-zinc-50 dark:bg-zinc-950\",\"children\":[\"$\",\"div\",null,{\"className\":\"max-w-6xl mx-auto px-6 py-10\",\"children\":[[\"$\",\"header\",null,{\"className\":\"mb-8 flex items-baseline justify-between\",\"children\":[[\"$\",\"div\",null,{\"children\":[[\"$\",\"div\",null,{\"className\":\"h-6 w-40 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse\"}],[\"$\",\"div\",null,{\"className\":\"h-3 w-36 bg-zinc-200/60 dark:bg-zinc-800/60 rounded animate-pulse mt-2\"}]]}],[\"$\",\"div\",null,{\"className\":\"h-3 w-48 bg-zinc-200/60 dark:bg-zinc-800/60 rounded animate-pulse\"}]]}],[\"$\",\"section\",null,{\"className\":\"flex justify-center mb-6\",\"children\":[\"$\",\"div\",null,{\"className\":\"w-full max-w-md h-64 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}]}],[\"$\",\"section\",null,{\"className\":\"grid grid-cols-1 md:grid-cols-3 gap-3\",\"children\":[[\"$\",\"div\",\"0\",{\"className\":\"h-72 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}],[\"$\",\"div\",\"1\",{\"className\":\"h-72 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}],[\"$\",\"div\",\"2\",{\"className\":\"h-72 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}]]}],[\"$\",\"p\",null,{\"className\":\"text-[10px] uppercase tracking-widest text-zinc-500 mt-6\",\"children\":\"scanning ~/.claude · first load cold; subsequent cached by file mtime\"}]]}]}],[],[]],\"children\":[\"$\",\"$2\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/13twdc6z5jomc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/17hugzvnj-r7p.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"h-full antialiased\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-full flex flex-col font-mono bg-zinc-50 dark:bg-zinc-950 text-zinc-900 dark:text-zinc-100\",\"children\":[[\"$\",\"$L3\",null,{}],[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}]}],{\"children\":[[\"$\",\"$2\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$2\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],\"$L6\"]}]}]],null,\"$L7\"]}],{},null,false,null]},null,false,\"$@8\"]},null,false,null],\"$L9\",false]],\"m\":\"$undefined\",\"G\":[\"$a\",[\"$Lb\"]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"yFvhyffva7D2ZI82gW6Fd\"}\n"])</script><script>self.__next_f.push([1,"c:I[97367,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\nd:\"$Sreact.suspense\"\n10:I[97367,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\n12:I[97367,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\n6:[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]\n7:[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$d\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@e\"}]}]\nf:[]\n8:\"$Wf\"\n9:[\"$\",\"$2\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L10\",null,{\"children\":\"$L11\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L12\",null,{\"children\":[\"$\",\"$d\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L13\"}]}]}],null]}]\nb:[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/13twdc6z5jomc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]\n"])</script><script>self.__next_f.push([1,"11:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"14:I[27201,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"IconMark\"]\ne:null\n13:[[\"$\",\"title\",\"0\",{\"children\":\"contextscope\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Local dashboard auditing Claude Code's per-turn token context — skills, agents, commands, CLAUDE.md, MEMORY.md, hooks, MCP, and session analytics.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0x3dzn~oxb6tn.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$L14\",\"3\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en" class="h-full antialiased"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/118uk9v3812u1.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/14hcmzto5g-b7.js" async=""></script><script src="/_next/static/chunks/0nxgnfb4qc8my.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-0wzfw6l~krt~8.js" async=""></script><script src="/_next/static/chunks/17hugzvnj-r7p.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><title>404: This page could not be found.</title><meta name="robots" content="noindex"/><title>contextscope</title><meta name="description" content="Local dashboard auditing Claude Code&#x27;s per-turn token context — skills, agents, commands, CLAUDE.md, MEMORY.md, hooks, MCP, and session analytics."/><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="min-h-full flex flex-col font-mono bg-zinc-50 dark:bg-zinc-950 text-zinc-900 dark:text-zinc-100"><div hidden=""><!--$--><!--/$--></div><nav class="border-b border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-950 sticky top-0 z-10"><div class="max-w-6xl mx-auto px-6 h-12 flex items-center gap-8 text-sm"><a class="font-semibold tracking-tight text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/">contextscope</a><div class="flex items-center gap-5"><a class="text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/items">items</a><a class="text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/sessions">sessions</a><a class="text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition-colors" href="/context">context</a></div></div></nav><!--$--><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><!--/$--><script src="/_next/static/chunks/00gq-v0e07i1q.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:I[39756,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"LoadingBoundaryProvider\"]\n2:\"$Sreact.fragment\"\n3:I[54858,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"Nav\"]\n4:I[39756,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n5:I[37457,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\na:I[68027,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/118uk9v3812u1.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",20],[[\"$\",\"$L1\",null,{\"loading\":[[\"$\",\"main\",\"l\",{\"className\":\"flex-1 font-mono bg-zinc-50 dark:bg-zinc-950\",\"children\":[\"$\",\"div\",null,{\"className\":\"max-w-6xl mx-auto px-6 py-10\",\"children\":[[\"$\",\"header\",null,{\"className\":\"mb-8 flex items-baseline justify-between\",\"children\":[[\"$\",\"div\",null,{\"children\":[[\"$\",\"div\",null,{\"className\":\"h-6 w-40 bg-zinc-200 dark:bg-zinc-800 rounded animate-pulse\"}],[\"$\",\"div\",null,{\"className\":\"h-3 w-36 bg-zinc-200/60 dark:bg-zinc-800/60 rounded animate-pulse mt-2\"}]]}],[\"$\",\"div\",null,{\"className\":\"h-3 w-48 bg-zinc-200/60 dark:bg-zinc-800/60 rounded animate-pulse\"}]]}],[\"$\",\"section\",null,{\"className\":\"flex justify-center mb-6\",\"children\":[\"$\",\"div\",null,{\"className\":\"w-full max-w-md h-64 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}]}],[\"$\",\"section\",null,{\"className\":\"grid grid-cols-1 md:grid-cols-3 gap-3\",\"children\":[[\"$\",\"div\",\"0\",{\"className\":\"h-72 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}],[\"$\",\"div\",\"1\",{\"className\":\"h-72 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}],[\"$\",\"div\",\"2\",{\"className\":\"h-72 rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 animate-pulse\"}]]}],[\"$\",\"p\",null,{\"className\":\"text-[10px] uppercase tracking-widest text-zinc-500 mt-6\",\"children\":\"scanning ~/.claude · first load cold; subsequent cached by file mtime\"}]]}]}],[],[]],\"children\":[\"$\",\"$2\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/118uk9v3812u1.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/17hugzvnj-r7p.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"h-full antialiased\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-full flex flex-col font-mono bg-zinc-50 dark:bg-zinc-950 text-zinc-900 dark:text-zinc-100\",\"children\":[[\"$\",\"$L3\",null,{}],[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}]}],{\"children\":[[\"$\",\"$2\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$2\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],\"$L6\"]}]}]],null,\"$L7\"]}],{},null,false,null]},null,false,\"$@8\"]},null,false,null],\"$L9\",false]],\"m\":\"$undefined\",\"G\":[\"$a\",[\"$Lb\"]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"kaNzMZNco9qjeyEFA-gjr\"}\n"])</script><script>self.__next_f.push([1,"c:I[97367,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\nd:\"$Sreact.suspense\"\n10:I[97367,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\n12:I[97367,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\n6:[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]\n7:[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$d\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@e\"}]}]\nf:[]\n8:\"$Wf\"\n9:[\"$\",\"$2\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L10\",null,{\"children\":\"$L11\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L12\",null,{\"children\":[\"$\",\"$d\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L13\"}]}]}],null]}]\nb:[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/118uk9v3812u1.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]\n"])</script><script>self.__next_f.push([1,"11:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"14:I[27201,[\"/_next/static/chunks/17hugzvnj-r7p.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"IconMark\"]\ne:null\n13:[[\"$\",\"title\",\"0\",{\"children\":\"contextscope\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Local dashboard auditing Claude Code's per-turn token context — skills, agents, commands, CLAUDE.md, MEMORY.md, hooks, MCP, and session analytics.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0x3dzn~oxb6tn.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$L14\",\"3\",{}]]\n"])</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/14hcmzto5g-b7.js" async=""></script><script src="/_next/static/chunks/0nxgnfb4qc8my.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-0wzfw6l~krt~8.js" async=""></script><script src="/_next/static/chunks/01xlw8hd842-c.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><title>500: This page couldn’t load</title><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/00gq-v0e07i1q.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"yFvhyffva7D2ZI82gW6Fd\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[27201,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0x3dzn~oxb6tn.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"1\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/00gq-v0e07i1q.js"/><script src="/_next/static/chunks/14hcmzto5g-b7.js" async=""></script><script src="/_next/static/chunks/0nxgnfb4qc8my.js" async=""></script><script src="/_next/static/chunks/07lhk_q6pmm3r.js" async=""></script><script src="/_next/static/chunks/turbopack-0wzfw6l~krt~8.js" async=""></script><script src="/_next/static/chunks/01xlw8hd842-c.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><title>500: This page couldn’t load</title><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/00gq-v0e07i1q.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"kaNzMZNco9qjeyEFA-gjr\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[27201,[\"/_next/static/chunks/01xlw8hd842-c.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0x3dzn~oxb6tn.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"1\",{}]]\n"])</script></body></html>
@@ -22,6 +22,7 @@ import { getUsage, lookupUsage } from "@/lib/usage";
22
22
  import { getSessions, summarizeSessions } from "@/lib/sessions";
23
23
  import { getContextFiles } from "@/lib/files";
24
24
  import { getHooks } from "@/lib/hooks";
25
+ import { formatUsd } from "@/lib/pricing";
25
26
  import { MiniStat } from "./components/Receipt";
26
27
  import { toggleUserItem } from "./actions";
27
28
 
@@ -143,6 +144,11 @@ export default async function Cockpit() {
143
144
  <div className="mt-1.5 text-2xl font-semibold tabular-nums tracking-tight text-zinc-900 dark:text-zinc-50">
144
145
  {shortNumber(sess.totalTokens)}
145
146
  <span className="ml-1 text-xs text-zinc-500 font-normal">tok</span>
147
+ <span className="ml-2 text-xs text-zinc-500 font-normal">·</span>
148
+ <span className="ml-2 text-base font-semibold tabular-nums text-zinc-900 dark:text-zinc-50">
149
+ {formatUsd(sess.totalCostUsd)}
150
+ </span>
151
+ <span className="ml-1 text-xs text-zinc-500 font-normal">api</span>
146
152
  </div>
147
153
 
148
154
  {sess.dailyBurn.length > 0 && (
@@ -155,7 +161,7 @@ export default async function Cockpit() {
155
161
  key={d.date}
156
162
  className="flex-1 bg-zinc-300 dark:bg-zinc-700"
157
163
  style={{ height: `${pct}%` }}
158
- title={`${d.date}: ${shortNumber(d.tokens)}`}
164
+ title={`${d.date}: ${shortNumber(d.tokens)} · ${formatUsd(d.cost)}`}
159
165
  />
160
166
  );
161
167
  })}
@@ -324,7 +330,7 @@ export default async function Cockpit() {
324
330
 
325
331
  <footer className="mt-8 pt-4 border-t border-zinc-200 dark:border-zinc-800 text-[10px] uppercase tracking-widest text-zinc-500 flex items-center justify-between">
326
332
  <span>
327
- cl100k_base · re-scanned every load · toggles apply on next CC restart
333
+ cl100k_base · cost deduped per msg.id (cc splits one msg across lines · ccusage daily sums dupes) · toggles apply on next cc restart
328
334
  </span>
329
335
  <a
330
336
  href="https://github.com/mbeato/contextscope"
@@ -1,8 +1,15 @@
1
+ import { homedir } from "node:os";
1
2
  import { getSessions, summarizeSessions } from "@/lib/sessions";
3
+ import { formatUsd } from "@/lib/pricing";
2
4
  import { Receipt, Stat } from "../components/Receipt";
3
5
 
4
6
  const fmt = new Intl.NumberFormat("en-US");
5
7
  const DAYS = 30;
8
+ const HOME = homedir();
9
+
10
+ function tildify(p: string): string {
11
+ return p.startsWith(HOME) ? "~" + p.slice(HOME.length) : p;
12
+ }
6
13
 
7
14
  export const dynamic = "force-dynamic";
8
15
 
@@ -50,7 +57,7 @@ export default async function SessionsPage() {
50
57
  <Stat label="sessions" value={fmt.format(s.count)} hint={`avg ${shortNumber(s.averageSessionTokens)}`} />
51
58
  </Receipt>
52
59
  <Receipt pad="default">
53
- <Stat label="30d total" value={shortNumber(s.totalTokens)} hint="all tokens" />
60
+ <Stat label="30d total" value={shortNumber(s.totalTokens)} hint={`${formatUsd(s.totalCostUsd)} api`} />
54
61
  </Receipt>
55
62
  <Receipt pad="default">
56
63
  <Stat label="median" value={shortNumber(s.medianSessionTokens)} hint="per session" />
@@ -74,7 +81,7 @@ export default async function SessionsPage() {
74
81
 
75
82
  {/* Daily burn */}
76
83
  <section className="mb-6">
77
- <Receipt label={`daily burn · ${s.dailyBurn.length} active days`}>
84
+ <Receipt label={`daily burn · ${s.dailyBurn.length} active days · ${formatUsd(s.totalCostUsd)} api total`}>
78
85
  <div className="space-y-1">
79
86
  {s.dailyBurn.map((d) => {
80
87
  const pct = (d.tokens / maxDayTokens) * 100;
@@ -87,6 +94,9 @@ export default async function SessionsPage() {
87
94
  <div className="w-20 text-right tabular-nums text-zinc-700 dark:text-zinc-300">
88
95
  {shortNumber(d.tokens)}
89
96
  </div>
97
+ <div className="w-16 text-right tabular-nums text-zinc-500">
98
+ {formatUsd(d.cost)}
99
+ </div>
90
100
  </div>
91
101
  );
92
102
  })}
@@ -105,6 +115,7 @@ export default async function SessionsPage() {
105
115
  <th className="px-5 py-3 font-normal">models</th>
106
116
  <th className="px-5 py-3 font-normal text-right">turns</th>
107
117
  <th className="px-5 py-3 font-normal text-right">tokens</th>
118
+ <th className="px-5 py-3 font-normal text-right">api</th>
108
119
  <th className="px-5 py-3 font-normal text-right">cache hit</th>
109
120
  </tr>
110
121
  </thead>
@@ -118,13 +129,14 @@ export default async function SessionsPage() {
118
129
  {session.endTime ? new Date(session.endTime).toISOString().slice(0, 10) : "—"}
119
130
  </td>
120
131
  <td className="px-5 py-3 text-zinc-700 dark:text-zinc-300 truncate max-w-[280px]">
121
- <code className="text-xs">{session.projectPath}</code>
132
+ <code className="text-xs">{tildify(session.projectPath)}</code>
122
133
  </td>
123
134
  <td className="px-5 py-3 text-zinc-500 text-xs">
124
135
  {session.models.map((m) => m.replace("claude-", "")).join(", ")}
125
136
  </td>
126
137
  <td className="px-5 py-3 text-right tabular-nums">{session.turnCount}</td>
127
138
  <td className="px-5 py-3 text-right tabular-nums">{shortNumber(session.totalTokens)}</td>
139
+ <td className="px-5 py-3 text-right tabular-nums text-zinc-500">{formatUsd(session.costUsd)}</td>
128
140
  <td className="px-5 py-3 text-right tabular-nums text-zinc-500">{hit.toFixed(1)}%</td>
129
141
  </tr>
130
142
  );
@@ -144,6 +156,7 @@ export default async function SessionsPage() {
144
156
  <th className="px-5 py-3 font-normal text-right">sessions</th>
145
157
  <th className="px-5 py-3 font-normal text-right">turns</th>
146
158
  <th className="px-5 py-3 font-normal text-right">total</th>
159
+ <th className="px-5 py-3 font-normal text-right">api</th>
147
160
  <th className="px-5 py-3 font-normal text-right">share</th>
148
161
  </tr>
149
162
  </thead>
@@ -153,11 +166,12 @@ export default async function SessionsPage() {
153
166
  return (
154
167
  <tr key={p.project} className="border-b border-zinc-200/60 dark:border-zinc-800/60 last:border-b-0 hover:bg-zinc-50 dark:hover:bg-zinc-950/40 transition-colors">
155
168
  <td className="px-5 py-3 truncate max-w-[420px]">
156
- <code className="text-xs">{p.projectPath}</code>
169
+ <code className="text-xs">{tildify(p.projectPath)}</code>
157
170
  </td>
158
171
  <td className="px-5 py-3 text-right tabular-nums text-zinc-500">{p.count}</td>
159
172
  <td className="px-5 py-3 text-right tabular-nums">{fmt.format(p.turns)}</td>
160
173
  <td className="px-5 py-3 text-right tabular-nums">{shortNumber(p.tokens)}</td>
174
+ <td className="px-5 py-3 text-right tabular-nums text-zinc-500">{formatUsd(p.cost)}</td>
161
175
  <td className="px-5 py-3 text-right tabular-nums text-zinc-500">{share.toFixed(1)}%</td>
162
176
  </tr>
163
177
  );
@@ -139,6 +139,10 @@ async function main() {
139
139
  const port = await findPort();
140
140
  const url = `http://localhost:${port}`;
141
141
 
142
+ // IMPORTANT: HOSTNAME must override anything inherited from process.env.
143
+ // Keep `...process.env` FIRST and `HOSTNAME: "127.0.0.1"` LAST so a stray
144
+ // HOSTNAME=0.0.0.0 in the user's shell can't open the dashboard to the LAN.
145
+ // Same for PORT.
142
146
  const child = fork(STANDALONE_SERVER, [], {
143
147
  env: { ...process.env, PORT: String(port), HOSTNAME: "127.0.0.1" },
144
148
  stdio: "inherit",
@@ -132,8 +132,14 @@ export async function getContextFiles(): Promise<ContextFile[]> {
132
132
  const dirName = String(d.name);
133
133
  const memPath = join(PROJECTS_DIR, dirName, "memory", "MEMORY.md");
134
134
  if (!(await exists(memPath))) continue;
135
- // Project dir name encodes cwd, e.g. "-Users-vtx-VTX" => /Users/vtx/VTX
136
- const inferredCwd = dirName.replace(/^-/, "/").replaceAll("-", "/");
135
+ // Project dir name encodes cwd, e.g. "-Users-vtx-VTX" => /Users/vtx/VTX.
136
+ // Strip control chars before display — POSIX filenames technically allow
137
+ // them and a crafted dir name shouldn't smuggle escape sequences into the UI.
138
+ const inferredCwd = dirName
139
+ .replace(/^-/, "/")
140
+ .replaceAll("-", "/")
141
+ // eslint-disable-next-line no-control-regex
142
+ .replace(/[\x00-\x1f\x7f]/g, "");
137
143
  out.push({
138
144
  category: "memory-md",
139
145
  name: `${dirName}/memory/MEMORY.md`,
@@ -46,20 +46,23 @@ async function runHook(command: string, sampleInput: object): Promise<{ stdout:
46
46
  resolve({ stdout, timeout: true });
47
47
  }, DRY_RUN_TIMEOUT_MS);
48
48
  child.stdout?.on("data", (d) => {
49
- if (stdout.length >= MAX_STDOUT_BYTES) {
50
- if (!done) {
51
- done = true;
52
- clearTimeout(timer);
53
- kill();
54
- resolve({ stdout });
55
- }
49
+ if (done) return;
50
+ const remaining = MAX_STDOUT_BYTES - stdout.length;
51
+ if (remaining <= 0) {
52
+ done = true;
53
+ clearTimeout(timer);
54
+ kill();
55
+ resolve({ stdout });
56
56
  return;
57
57
  }
58
- stdout += d.toString();
59
- if (stdout.length > MAX_STDOUT_BYTES) stdout = stdout.slice(0, MAX_STDOUT_BYTES);
58
+ const chunk = d.toString();
59
+ stdout += chunk.length > remaining ? chunk.slice(0, remaining) : chunk;
60
60
  });
61
61
  child.stderr?.on("data", (d) => {
62
- if (stderr.length < MAX_STDOUT_BYTES) stderr += d.toString();
62
+ const remaining = MAX_STDOUT_BYTES - stderr.length;
63
+ if (remaining <= 0) return;
64
+ const chunk = d.toString();
65
+ stderr += chunk.length > remaining ? chunk.slice(0, remaining) : chunk;
63
66
  });
64
67
  child.on("error", (err) => {
65
68
  if (done) return;
@@ -144,11 +144,13 @@ async function scanUserAgents(): Promise<InventoryItem[]> {
144
144
  return out;
145
145
  }
146
146
 
147
+ const MAX_COMMAND_DEPTH = 8;
148
+
147
149
  async function scanUserCommands(): Promise<InventoryItem[]> {
148
150
  const dir = join(CLAUDE_DIR, "commands");
149
151
  if (!(await exists(dir))) return [];
150
152
  const out: InventoryItem[] = [];
151
- await walkCommandDir(dir, "", out, "user");
153
+ await walkCommandDir(dir, "", out, "user", undefined, undefined, false, 0, new Set());
152
154
  return out;
153
155
  }
154
156
 
@@ -159,14 +161,26 @@ async function walkCommandDir(
159
161
  source: Source,
160
162
  plugin?: string,
161
163
  pluginKey?: string,
162
- pluginDisabled = false
164
+ pluginDisabled = false,
165
+ depth = 0,
166
+ visited: Set<string> = new Set()
163
167
  ): Promise<void> {
168
+ if (depth > MAX_COMMAND_DEPTH) return;
169
+ // Guard against symlink loops by tracking visited inodes.
170
+ try {
171
+ const st = await stat(dir);
172
+ const key = `${st.dev}:${st.ino}`;
173
+ if (visited.has(key)) return;
174
+ visited.add(key);
175
+ } catch {
176
+ return;
177
+ }
164
178
  const entries = await readdir(dir, { withFileTypes: true });
165
179
  for (const e of entries) {
166
180
  const p = join(dir, e.name);
167
181
  if (e.isDirectory()) {
168
182
  const ns = prefix ? `${prefix}:${e.name}` : e.name;
169
- await walkCommandDir(p, ns, out, source, plugin, pluginKey, pluginDisabled);
183
+ await walkCommandDir(p, ns, out, source, plugin, pluginKey, pluginDisabled, depth + 1, visited);
170
184
  continue;
171
185
  }
172
186
  if (!e.isFile()) continue;
@@ -270,7 +284,7 @@ async function scanPluginCache(enabledPlugins: Record<string, boolean>): Promise
270
284
  // commands/<name>.md (plugin slash commands, may be nested)
271
285
  const commandsDir = join(vDir, "commands");
272
286
  if (await exists(commandsDir)) {
273
- await walkCommandDir(commandsDir, "", out, "plugin", pluginLabel, pluginKey, pluginDisabled);
287
+ await walkCommandDir(commandsDir, "", out, "plugin", pluginLabel, pluginKey, pluginDisabled, 0, new Set());
274
288
  }
275
289
  }
276
290
  }