session-steward 0.7.0 → 0.9.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.0] - 2026-08-27
4
+
5
+ ### Added
6
+
7
+ - Add MCP server for Codex, Claude Code, and other local clients. It can inspect sessions, storage, timelines, and token usage; cleanup remains in the browser and terminal with the existing review and backup safeguards.
8
+ - MCP session searches understand inactivity, workspace, and minimum transcript size filters.
9
+
10
+ ## [0.8.0] - 2026-08-23
11
+
12
+ ### Added
13
+
14
+ - Session details now show how many tokens a Codex or Claude session used, with clear breakdowns for input, cache use, output, reasoning, models, and inherited work in forked sessions.
15
+ - The same token breakdown is available in the terminal with `--tokens`.
16
+
3
17
  ## [0.7.0] - 2026-08-20
4
18
 
5
19
  ### Added
@@ -123,6 +137,8 @@
123
137
  - Support for custom Codex home folders and a saved folder preference.
124
138
  - Streaming and bounded-memory discovery for large session collections and transcripts.
125
139
 
140
+ [0.9.0]: https://github.com/mallikcheripally/session-steward/compare/v0.8.0...v0.9.0
141
+ [0.8.0]: https://github.com/mallikcheripally/session-steward/compare/v0.7.0...v0.8.0
126
142
  [0.7.0]: https://github.com/mallikcheripally/session-steward/compare/v0.6.0...v0.7.0
127
143
  [0.6.0]: https://github.com/mallikcheripally/session-steward/compare/v0.5.2...v0.6.0
128
144
  [0.5.2]: https://github.com/mallikcheripally/session-steward/compare/v0.5.1...v0.5.2
package/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
  [![Build status](https://img.shields.io/github/actions/workflow/status/mallikcheripally/session-steward/validate.yml?branch=main&style=flat-square&label=build)](https://github.com/mallikcheripally/session-steward/actions/workflows/validate.yml)
5
5
  [![License: MIT](https://img.shields.io/npm/l/session-steward?style=flat-square)](https://github.com/mallikcheripally/session-steward/blob/main/LICENSE)
6
6
 
7
- A local Codex and Claude Code session manager for safely reviewing, backing up, and deleting old sessions from a browser UI or terminal CLI.
7
+ A local Codex and Claude Code session manager for safely reviewing, backing up, and deleting old sessions from a browser UI or terminal CLI. It also includes an MCP server for inspecting sessions with AI.
8
8
 
9
9
  AI coding tools can accumulate hundreds or thousands of local sessions. A session may leave behind transcripts, history, logs, checkpoints, and linked artifacts, so manual cleanup can easily miss related data.
10
10
 
11
- Session Steward makes session cleanup safer by finding those records, showing what cleanup will affect, creating a local backup, removing supported data, and verifying the result afterward. Everything runs locally, and your session data stays on your computer.
11
+ Session Steward makes session cleanup safer by finding those records, showing what cleanup will affect, creating a local backup, removing supported data, and verifying the result afterward. Session Steward runs locally.
12
12
 
13
13
  ![Session Steward cleanup demo](https://raw.githubusercontent.com/mallikcheripally/session-steward/main/docs/session-steward-demo.gif)
14
14
 
@@ -21,6 +21,8 @@ Session Steward makes session cleanup safer by finding those records, showing wh
21
21
  - Filter active or archived sessions by workspace, name, or session ID.
22
22
  - Inspect session details and affected records before deletion.
23
23
  - Read a session timeline of what you asked, what changed, and which commands ran.
24
+ - See how many tokens a session used, split into fresh input, cached input, cache writes, and output.
25
+ - Let compatible local MCP clients inspect sessions and help identify what is worth reviewing.
24
26
  - Choose standard or thorough cleanup.
25
27
  - Use custom Codex or Claude home folders across browser and terminal sessions.
26
28
 
@@ -32,7 +34,7 @@ Session Steward makes session cleanup safer by finding those records, showing wh
32
34
  - Cleanup is verified before the backup is removed.
33
35
  - Unrecognized storage is reported and left untouched.
34
36
  - Thorough cleanup is unavailable when the detected storage format is not supported.
35
- - Session contents are never sent over the network.
37
+ - Browser and terminal cleanup stay local and do not upload session contents.
36
38
 
37
39
  At startup, Session Steward may contact the public npm registry to check for a newer version.
38
40
 
@@ -165,6 +167,20 @@ With `--json`, each session carries its own `events`, plus a `coverage` summary
165
167
  session-steward-cli --json --limit 5 --events
166
168
  ```
167
169
 
170
+ Use `--tokens` to count what a session spent. The total is split into fresh input, cached input, cache writes, and output, with reasoning reported as a share of output where the provider records it:
171
+
172
+ ```bash
173
+ session-steward-cli --tokens
174
+ ```
175
+
176
+ In the interactive list, `tokens` toggles the same breakdown into `inspect`. With `--json`, each session carries a `tokens` object:
177
+
178
+ ```bash
179
+ session-steward-cli --json --limit 5 --tokens
180
+ ```
181
+
182
+ Cached input usually dominates, because the whole conversation is re-sent on every turn. A forked session reports its own work separately from the tokens it inherited from the session it branched from, so the two are never added together.
183
+
168
184
  The interactive terminal accepts the same filters:
169
185
 
170
186
  ```text
@@ -176,6 +192,7 @@ archive archived
176
192
  workspace /path/to/project
177
193
  internals
178
194
  supporting
195
+ tokens
179
196
  cleanup standard
180
197
  cleanup thorough
181
198
  overview
@@ -190,6 +207,86 @@ Run `inactive`, `archive`, or `workspace` without a value to clear that filter.
190
207
 
191
208
  Use `session-steward-cli --help` to see all available options.
192
209
 
210
+ ## Read-only MCP server
211
+
212
+ Session Steward includes `session-steward-mcp`, a local MCP server for Codex,
213
+ and Claude Code. It can list and inspect sessions, timelines, storage, and
214
+ token usage. It cannot delete, back up, restore, or change anything.
215
+
216
+ Once configured, you can ask naturally:
217
+
218
+ - “Find old chats I have not used in 2 months that are over 500 MB.”
219
+ - “Show sessions from project x workspace, sorted by size, inactive for a month.”
220
+ - “Show the timeline and token usage for this session.”
221
+
222
+ Install Session Steward globally first, then register it with the clients you
223
+ use.
224
+
225
+ For Codex:
226
+
227
+ ```bash
228
+ codex mcp add session-steward -- session-steward-mcp
229
+ ```
230
+
231
+ For Claude Code:
232
+
233
+ ```bash
234
+ claude mcp add --scope user session-steward -- session-steward-mcp
235
+ ```
236
+
237
+ Check or remove the configuration at any time:
238
+
239
+ ```bash
240
+ codex mcp list
241
+ codex mcp remove session-steward
242
+
243
+ claude mcp list
244
+ claude mcp remove --scope user session-steward
245
+ ```
246
+
247
+ Removing the MCP configuration does not uninstall Session Steward or change any
248
+ sessions. Use the normal npm uninstall command only if you also want to remove
249
+ the package.
250
+
251
+ For another compatible client, configure a local `stdio` server named
252
+ `session-steward` with `session-steward-mcp` as its command:
253
+
254
+ ```json
255
+ {
256
+ "mcpServers": {
257
+ "session-steward": {
258
+ "command": "session-steward-mcp"
259
+ }
260
+ }
261
+ }
262
+ ```
263
+
264
+ ### Custom provider folders
265
+
266
+ The MCP server uses the same saved Codex and Claude home folders as the browser
267
+ and terminal interfaces. You can override either folder in the MCP command:
268
+
269
+ ```bash
270
+ codex mcp add session-steward -- session-steward-mcp \
271
+ --codex-home /path/to/.codex \
272
+ --claude-home /path/to/.claude
273
+ ```
274
+
275
+ ### Privacy and access
276
+
277
+ - The MCP server runs locally with your user account's file permissions.
278
+ - Every tool call must choose `codex` or `claude-code`; it does not combine the
279
+ providers silently.
280
+ - Lists and timelines are bounded, and provider database and transcript paths
281
+ are omitted from results.
282
+ - Timeline results can contain session messages, commands, file names, and
283
+ workspace paths. Only request a timeline when that content is appropriate to
284
+ share with the configured client.
285
+ - Session Steward does not upload MCP results itself. Your MCP client may send
286
+ tool results to its AI provider under that product's privacy terms.
287
+ - MCP tools are read-only. Cleanup remains available only through the browser UI
288
+ and terminal CLI, with the existing review, backup, and verification flow.
289
+
193
290
  ## Use a custom provider folder
194
291
 
195
292
  The browser interface displays the active provider folder. Select **Change** to choose another existing folder and remember it for later browser and terminal sessions.
@@ -29,6 +29,9 @@ const { values } = parseArgs({
29
29
  events: {
30
30
  type: "boolean",
31
31
  },
32
+ tokens: {
33
+ type: "boolean",
34
+ },
32
35
  "events-limit": {
33
36
  type: "string",
34
37
  },
@@ -116,6 +119,7 @@ async function main() {
116
119
  providerId,
117
120
  search: values.search ?? "",
118
121
  sort: values.sort ?? "updated",
122
+ tokens: values.tokens ?? false,
119
123
  workspace: values.workspace,
120
124
  });
121
125
  }
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { parseArgs } from "node:util";
4
+
5
+ import packageMetadata from "../package.json" with { type: "json" };
6
+ import { assertSupportedNode } from "../lib/runtime.mjs";
7
+
8
+ assertSupportedNode();
9
+
10
+ const { values } = parseArgs({
11
+ allowPositionals: false,
12
+ options: {
13
+ "claude-home": { type: "string" },
14
+ "codex-home": { type: "string" },
15
+ help: { short: "h", type: "boolean" },
16
+ version: { short: "v", type: "boolean" },
17
+ },
18
+ });
19
+
20
+ if (values.help) {
21
+ process.stdout.write(`Usage: session-steward-mcp [options]
22
+
23
+ Run Session Steward's read-only MCP server over stdio. MCP clients start and
24
+ stop this process automatically.
25
+
26
+ Options:
27
+ --codex-home <path> Use a custom Codex session folder
28
+ --claude-home <path> Use a custom Claude session folder
29
+ -h, --help Show this help
30
+ -v, --version Show the installed version
31
+ `);
32
+ process.exit(0);
33
+ }
34
+
35
+ if (values.version) {
36
+ process.stdout.write(`${packageMetadata.version}\n`);
37
+ process.exit(0);
38
+ }
39
+
40
+ const { createProviderSettings } = await import("../lib/settings.mjs");
41
+ const { serveReadOnlyMcp } = await import("../lib/mcp.mjs");
42
+ const providerHomeOverrides = {};
43
+
44
+ if (values["codex-home"] !== undefined) {
45
+ providerHomeOverrides.codex = values["codex-home"];
46
+ }
47
+ if (values["claude-home"] !== undefined) {
48
+ providerHomeOverrides["claude-code"] = values["claude-home"];
49
+ }
50
+
51
+ const settings = await createProviderSettings({ providerHomeOverrides });
52
+ const handle = serveReadOnlyMcp({
53
+ onerror: (error) => process.stderr.write(`Session Steward MCP error: ${error.message}\n`),
54
+ settings,
55
+ });
56
+ let closing = false;
57
+
58
+ async function close() {
59
+ if (closing) return;
60
+ closing = true;
61
+ await handle.close();
62
+ }
63
+
64
+ process.once("SIGINT", () => void close());
65
+ process.once("SIGTERM", () => void close());