{"id":"smart-session","repo":"tomgrin10/paseo-smart-session","url":"https://github.com/tomgrin10/paseo-smart-session","package":"paseo-smart-session","npm":{"package":"paseo-smart-session","version":"1.2.6","integrity":"sha512-HEYrmu2R58GQHW4NXlNrihr2pKIb+hev+pzP8LBuZqjRw5PdvFSudhPjFKkstvD/8BqYwMCsHXqPy1MNIuxwaw==","publishedAt":"2026-09-27T17:56:29.990Z","downloadsLast30Days":1508},"name":"smart-session","description":"Records Claude plan-usage history and lets a Paseo agent manage its own context.","categories":["monitoring","productivity"],"platforms":[],"caveats":[],"images":["https://raw.githubusercontent.com/tomgrin10/paseo-smart-session/6f72ebb9a5ece45b9c928d58290bfb91db2dfc50/docs/screenshots/smart-compact-handoff.png"],"themes":[],"health":{"manifestValid":true,"hasReadme":true,"hasLicense":true,"hasTests":true,"hasTypecheckScript":true,"updatedRecently":true},"scannedAt":"2026-10-15T12:34:41.935Z","addedAt":"2026-09-10T15:56:08+03:00","npmSecurity":{"status":"passed","blockingFindings":0,"advisoryFindings":0,"scannedAt":"2026-10-15T12:14:24.405Z","version":"1.2.6","integrity":"sha512-HEYrmu2R58GQHW4NXlNrihr2pKIb+hev+pzP8LBuZqjRw5PdvFSudhPjFKkstvD/8BqYwMCsHXqPy1MNIuxwaw=="},"version":"1.2.6","security":{"status":"passed","blockingFindings":0,"advisoryFindings":0,"scannedAt":"2026-10-15T12:14:24.405Z","commit":"6f72ebb9a5ece45b9c928d58290bfb91db2dfc50"},"author":"Tom Gringauz","license":"MIT","paseoVersionRequirement":">=0.8.0","descriptionNodes":[{"type":"text","text":"Records Claude plan-usage history and lets a Paseo agent manage its own context."}],"caveatNodes":[],"manifest":{"id":"smart-session","requirements":{"paseo":">=0.8.0"}},"repoMeta":{"stars":3,"defaultBranch":"main","pushedAt":"2026-10-12T09:05:46Z"},"owner":{"login":"tomgrin10","avatarUrl":"https://avatars.githubusercontent.com/u/17593920?v=4"},"installNotesHtml":"<p>Install from npm using the latest Paseo release:</p>\n<pre><code class=\"language-sh\">paseo plugin install paseo-smart-session\n</code></pre>\n<pre><code class=\"language-sh\">paseo plugin ls                    # confirm it is running\npaseo plugin update smart-session\npaseo plugin remove smart-session\n</code></pre>\n<p>On first load, Smart Session registers its Claude Code hooks and MCP server. It only manages entries that point at its own scripts; other Claude Code configuration is left alone.</p>","readmeText":"# paseo-smart-session\n\n[![npm version](https://img.shields.io/npm/v/paseo-smart-session?style=for-the-badge&color=cb3837)](https://www.npmjs.com/package/paseo-smart-session)\n[![npm downloads](https://img.shields.io/npm/dm/paseo-smart-session?style=for-the-badge&color=cb3837)](https://www.npmjs.com/package/paseo-smart-session)\n[![Paseo](https://img.shields.io/badge/Paseo-%E2%89%A5%200.8.0-8A63D2?style=for-the-badge)](https://paseo.sh)\n[![License](https://img.shields.io/github/license/tomgrin10/paseo-smart-session?style=for-the-badge&color=2563eb)](LICENSE)\n\nGive Paseo agents a safe way to manage long-running work.\n\nSmart Session lets an agent see how full its context is, save durable task state, and compact itself when it is ready. It also records session and plan-usage statistics, so you can understand where tokens are going and when limits reset.\n\n![A Smart Session compaction handoff: the requested compact preserves the task state, then the resumed session is told to re-read its state file and continue](docs/screenshots/smart-compact-handoff.png)\n\n## Install\n\nInstall from npm using the latest Paseo release:\n\n```sh\npaseo plugin install paseo-smart-session\n```\n\n```sh\npaseo plugin ls                    # confirm it is running\npaseo plugin update smart-session\npaseo plugin remove smart-session\n```\n\nOn first load, Smart Session registers its Claude Code hooks and MCP server. It only manages entries that point at its own scripts; other Claude Code configuration is left alone.\n\n## What it does\n\n### Lets agents compact themselves\n\nAn agent can check how much context it has used, checkpoint the work that must survive a reset, and request compaction when it reaches a safe stopping point. The agent also decides whether another turn should start afterwards and can write the exact follow-up message. A completed task can compact and stop; work in progress can resume from its saved state.\n\nThe saved state captures the goal, the current step, decisions already made, and approaches that have already failed. That prevents a resumed agent from redoing work or asking a person how to continue.\n\nSmart Session never chooses to compact an agent by itself. It can let an agent know that context is filling, but the agent decides whether to checkpoint, compact, or defer.\n\n### Shows session and plan usage\n\nSmart Session keeps a local history of:\n\n- Context-window usage for each agent session\n- Claude plan usage, burn rate, and reset times\n- Token spend by model, workspace, and main agent versus subagent\n- Compaction requests and their before/after context sizes\n\nThat history remains useful after an individual session ends or a provider cache changes.\n\n## How an agent uses it\n\nSmart Session exposes these MCP tools to Paseo agents:\n\n| Tool | What it does |\n| --- | --- |\n| `context_status` | Shows current context usage, filling rate, and relevant thresholds. |\n| `checkpoint` | Writes durable task state for the current session. |\n| `request_compaction` | Queues compaction and chooses whether and how to continue afterwards. |\n| `defer_compaction` | Defers a compaction request and records why. |\n| `budget_status` | Shows plan usage, burn rate, and reset times. |\n\nThe usual flow is:\n\n```text\ncontext_status → checkpoint → request_compaction → stop, or re-read state and continue\n```\n\n`request_compaction` refuses when the state file is missing or stale. The agent can checkpoint and request again in the same turn.\n\n## Smart Compact\n\nSmart Compact is the session-control feature. As a session fills, hooks can provide context notices at useful thresholds. When the compact threshold is reached at the end of a turn, the agent is asked whether it wants to compact.\n\nThere is no forced compaction. An agent can compact immediately, defer with a reason, or keep working. A request is delivered only when the agent is idle and its state file is current.\n\nEvery request sends the `/compact` command. The agent can also set:\n\n- `continue_after_compaction: false` to finish without starting another turn.\n- `continue_after_compaction: true` to start another turn after compaction.\n- `continue_message` to choose the exact follow-up; when omitted, the default tells the agent to re-read the state file and continue from its **Current step**.\n\nOmitting the new options preserves the earlier behavior: Smart Session continues with the default state-aware prompt. The durable state wins if it disagrees with the automatic summary. A `/compact` entered by a person never receives a plugin continuation.\n\n### The composer pill\n\nThe composer pill shows whether the current session is enrolled:\n\n| State | Meaning |\n| --- | --- |\n| **Smart Compact on** | The session can receive context notices and request compaction. |\n| **Smart Compact off** | The session is not enrolled. |\n\nIf Smart Compact is disabled globally, the pill is not shown.\n\n## Settings\n\n| Setting | Default | Description |\n| --- | --- | --- |\n| **Smart Compact** | On | Enables context notices and agent-requested compaction. |\n| **Large-window compact threshold** | 30% | Sets when Smart Compact asks on context windows of 400k tokens or more. |\n| **Small-window compact threshold** | 85% | Sets when Smart Compact asks on smaller context windows. |\n| **Enrol sessions automatically** | On | Enrols a session after it writes task state. |\n| **Show the pill on every agent** | On | Shows the Smart Compact control in the composer. |\n| **Register the hooks with Claude Code** | On | Keeps the context and compaction hooks installed. |\n\nThe remaining settings apply only while Smart Compact is enabled. Thresholds accept whole percentages from 1% to 99%; lowering one also moves its earlier notice bands down when needed.\n\n## Usage history and state\n\nSmart Session stores its data under:\n\n```text\n$PASEO_HOME/plugin-data/smart-session/\n```\n\n| File | Contains |\n| --- | --- |\n| `usage-YYYY-MM.jsonl` | Plan-usage observations and reset times. |\n| `context-YYYY-MM.jsonl` | Context-window usage changes. |\n| `compactions.json` | Compaction requests, continuation choices, and context sizes. |\n| `spend-index.json` | Hourly token spend by model, workspace, and agent type. |\n| `state/<agentId>.md` | Durable task state for one agent. |\n| `settings.json`, `enrolment.json` | Plugin settings and per-session enrolment. |\n\nUsage and context observations are append-only. A damaged line is skipped rather than putting the rest of the history at risk. Existing compaction rows are read as “continue with the default prompt,” so upgrading requires no data migration.\n\n## Password-protected daemons\n\nWhen the Paseo daemon requires a password, Smart Session resolves it in this order:\n\n1. `PASEO_PASSWORD`\n2. The file named by `PASEO_PASSWORD_FILE`\n3. `~/paseo-hub/secrets/daemon-password`\n\nThe secret is used only to connect to the daemon. It is never written or logged.\n\n## Development\n\n```sh\ngit clone https://github.com/tomgrin10/paseo-smart-session.git\ncd paseo-smart-session\nnpm ci\nnpm run verify\npaseo plugin install \"$PWD\"\n```\n\nAfter editing:\n\n```sh\nnpm run verify\npaseo plugin reload smart-session\n```\n\nReloading the plugin is enough. Do not restart the Paseo daemon: that interrupts every running agent.\n\n## Data and privacy\n\nSmart Session reads local Claude Code usage information and communicates with the local Paseo daemon. Its usage history, settings, and task state stay under `$PASEO_HOME`. Apart from narrowly maintaining its own Claude Code hook and MCP entries, it does not modify user configuration.\n\n## License\n\n[MIT](LICENSE) © 2026 Tom Gringauz.\n\n## Other plugins\n\n- [Defer](https://github.com/tomgrin10/paseo-defer) — Schedule messages for later delivery.\n- [Graphite](https://github.com/tomgrin10/paseo-graphite) — Graphite stacks and PR status.\n- [Vitals](https://github.com/tomgrin10/paseo-vitals) — Host, agent, and Docker health.\n- [Session Guard](https://github.com/tomgrin10/paseo-session-guard) — Pause at session limits and continue after reset.\n- [Transfer](https://github.com/tomgrin10/paseo-transfer) — Copy or move workspaces between hosts.\n- [Transcript Search](https://github.com/tomgrin10/paseo-transcript-search) — Search conversations across connected hosts.\n- [Send to Paseo](https://github.com/tomgrin10/send-to-paseo) — Send GitHub and Graphite PRs to Paseo from Chrome.\n- [Dispatch](https://github.com/tomgrin10/paseo-dispatch) — Route tasks to existing workspaces (development preview).\n"}