session-steward 0.1.1 → 0.3.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 ADDED
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ ## [0.3.0] - 2026-08-03
4
+
5
+ ### Added
6
+
7
+ - Support for Claude Code CLI sessions on macOS and Linux, plus local Claude Code Desktop sessions on macOS.
8
+ - Provider switching and separate saved home folders for Codex and Claude Code.
9
+ - Per-session sizes, workspace storage totals, date grouping, and largest-first sorting.
10
+ - CLI overviews and filters for inactivity, archive status, workspace, session type, and size.
11
+ - CLI tools to list, restore, and permanently remove recovery backups retained after unsuccessful cleanup.
12
+
13
+ ### Changed
14
+
15
+ - Redesigned the browser interface with clearer navigation, filters, selection controls, session details, and cleanup progress.
16
+ - Kept session discovery, activity detection, and size calculations responsive with bounded caches and incremental reads.
17
+ - Stopped tracking generated `dist` files; npm packages continue to build and include the production UI automatically.
18
+
19
+ ### Fixed
20
+
21
+ - Opening a Claude session no longer makes it appear recently active when its transcript has not changed.
22
+
23
+ ## [0.2.0] - 2026-08-01
24
+
25
+ ### Added
26
+
27
+ - Session and storage overview metrics.
28
+ - Filters for inactivity, archive status, and workspace in the browser and terminal interfaces.
29
+ - Guided restore and backup removal options when cleanup cannot be completed.
30
+ - Scale benchmarks for session listing, storage overviews, and transcript discovery.
31
+
32
+ ### Changed
33
+
34
+ - Recovery backups are removed automatically after cleanup is verified and retained only when recovery may be needed.
35
+ - Session listing and cleanup planning were expanded to handle large local session collections with bounded memory use.
36
+ - The README and product demo were revised around the complete cleanup workflow.
37
+
38
+ ## [0.1.1] - 2026-08-01
39
+
40
+ ### Added
41
+
42
+ - `--help` and `--version` options for the Session Steward launcher.
43
+
44
+ ## [0.1.0] - 2026-08-01
45
+
46
+ ### Added
47
+
48
+ - Browser and terminal interfaces for reviewing local Codex sessions.
49
+ - Standard and thorough cleanup with a deletion preview, recovery backup, and post-cleanup verification.
50
+ - Compatibility checks that leave unrecognized Codex storage untouched.
51
+ - Support for custom Codex home folders and a saved folder preference.
52
+ - Streaming and bounded-memory discovery for large session collections and transcripts.
53
+
54
+ [0.3.0]: https://github.com/mallikcheripally/session-steward/compare/v0.2.0...v0.3.0
55
+ [0.2.0]: https://github.com/mallikcheripally/session-steward/compare/v0.1.1...v0.2.0
56
+ [0.1.1]: https://github.com/mallikcheripally/session-steward/compare/v0.1.0...v0.1.1
57
+ [0.1.0]: https://github.com/mallikcheripally/session-steward/releases/tag/v0.1.0
package/README.md CHANGED
@@ -1,36 +1,66 @@
1
1
  # Session Steward
2
2
 
3
- Safely review, back up, and remove local Codex sessions with a browser UI or terminal CLI.
3
+ [![npm version](https://img.shields.io/npm/v/session-steward?style=flat-square)](https://www.npmjs.com/package/session-steward)
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
+ [![License: MIT](https://img.shields.io/npm/l/session-steward?style=flat-square)](https://github.com/mallikcheripally/session-steward/blob/main/LICENSE)
4
6
 
5
- Session Steward is a local-first Codex session manager for macOS and Linux. It shows what will be removed before cleanup, creates a local backup, and verifies the result afterward. Your session data stays on your computer.
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.
6
8
 
7
- Use it to clear old Codex session history, reclaim the space used by session artifacts, or remove local session traces without resetting the rest of your Codex setup.
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.
8
10
 
9
- ![UI of sessions, filters, and session details](https://raw.githubusercontent.com/mallikcheripally/session-steward/main/docs/session-steward-overview.jpg)
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.
10
12
 
11
- ## Why Session Steward
13
+ ![Session Steward cleanup demo](https://raw.githubusercontent.com/mallikcheripally/session-steward/main/docs/session-steward-demo.gif)
12
14
 
13
- - Review local Codex sessions in a clear browser interface.
14
- - See linked subagents and affected local records before deletion.
15
- - Choose between focused session removal and a deeper local cleanup.
16
- - Keep an automatic backup of every cleanup operation.
17
- - Pause thorough cleanup when an unfamiliar storage format is found.
18
- - Verify that selected session artifacts were removed.
19
- - Use the same saved Codex folder in the browser and terminal interfaces.
15
+ ## Manage local Codex and Claude Code sessions
20
16
 
21
- Session Steward does not delete conversations stored in your ChatGPT account.
17
+ - Review sessions in a browser UI or terminal CLI.
18
+ - Switch between Codex and Claude Code without installing another package.
19
+ - See session counts and the storage used by recognized session files.
20
+ - Find sessions inactive for 30, 60, or 90 days.
21
+ - Filter active or archived sessions by workspace, name, or session ID.
22
+ - Inspect session details and affected records before deletion.
23
+ - Choose standard or thorough cleanup.
24
+ - Use custom Codex or Claude home folders across browser and terminal sessions.
22
25
 
23
- ## Requirements
26
+ ## Built for large session libraries
24
27
 
25
- - macOS or Linux
26
- - [Node.js](https://nodejs.org/) 24.15 or newer
27
- - Local sessions created by Codex
28
+ Current synthetic benchmarks on an arm64 Mac with Node.js 24.15.0:
28
29
 
29
- Git and a separate SQLite installation are not required. Session Steward uses the SQLite support included with Node.js.
30
+ | Scenario | Scale | Time | Measured memory growth |
31
+ | --- | ---: | ---: | ---: |
32
+ | Paginated session listing | 50,003 sessions | 26 ms | 0.16 MB heap |
33
+ | Session size index | 20,003 sessions | 85 ms cold, 9.7 ms warm | 30 MB peak RSS |
34
+ | Transcript-only discovery | 5,003 sessions | 662 ms | 4.02 MB heap |
30
35
 
31
- ## Install
36
+ Results vary with hardware, disk speed, and session layout. The benchmark commands are included in the repository and use temporary synthetic data.
32
37
 
33
- Install Session Steward globally with npm:
38
+ ## Safe by default
39
+
40
+ - Cleanup happens entirely on your computer.
41
+ - Only records included in the reviewed cleanup plan are removed.
42
+ - A local recovery backup is created before anything changes.
43
+ - Cleanup is verified before the backup is removed.
44
+ - Unrecognized storage is reported and left untouched.
45
+ - Thorough cleanup is unavailable when the detected storage format is not supported.
46
+ - Session contents are never sent over the network.
47
+
48
+ At startup, Session Steward may contact the public npm registry to check for a newer version.
49
+
50
+ ### Session Steward does not remove
51
+
52
+ - Sign-in data or saved API credentials
53
+ - Configuration, plugins, caches, or custom prompt files
54
+ - Project files, Git repositories, or worktrees
55
+ - Sessions outside the reviewed cleanup plan
56
+ - Conversations stored in your ChatGPT or Claude account
57
+ - Claude Code worktrees, branches, repositories, remote sessions, SSH sessions, or Cowork data
58
+
59
+ ## Install and get started
60
+
61
+ Session Steward supports macOS and Linux and requires Node.js 24.15 or newer. Git and a separate SQLite installation are not required.
62
+
63
+ Install it globally:
34
64
 
35
65
  ```bash
36
66
  npm install --global session-steward
@@ -42,175 +72,199 @@ Then launch it:
42
72
  session-steward
43
73
  ```
44
74
 
45
- Session Steward opens its browser interface and listens only on `127.0.0.1`. It uses `~/.codex` by default.
46
-
47
- Keep the terminal open while using Session Steward. Press `Ctrl+C` when you want to stop it.
48
-
49
- To try it without a global installation:
75
+ Or try it without installing:
50
76
 
51
77
  ```bash
52
78
  npx session-steward@latest
53
79
  ```
54
80
 
55
- ## Quick start
81
+ Session Steward opens in your browser, listens only on `127.0.0.1`, and detects `~/.codex` and `~/.claude` by default. Claude Desktop sessions are detected on macOS; Claude Code CLI sessions work on macOS and Linux.
82
+
83
+ To clean up sessions:
56
84
 
57
- 1. Run `session-steward`.
58
- 2. Review the detected Codex sessions.
59
- 3. Select one or more sessions.
60
- 4. Choose a cleanup option and review the deletion preview.
85
+ 1. Review the detected sessions.
86
+ 2. Select one or more sessions.
87
+ 3. Choose a cleanup option.
88
+ 4. Review exactly what will be removed.
61
89
  5. Close any selected sessions that may still be active.
62
90
  6. Confirm the cleanup.
63
91
 
64
- Each cleanup creates a backup inside your Codex folder under `session-steward-backups/`.
92
+ Keep the terminal open while using Session Steward. Press `Ctrl+C` to stop it.
65
93
 
66
- ## What you can adjust
94
+ ## Cleanup and recovery
67
95
 
68
- - Search by session name, workspace, or session ID.
69
- - Sort by recent activity, creation time, name, or workspace.
70
- - Show subagent and supporting sessions when you need the additional detail.
71
- - Choose standard or thorough cleanup for each deletion.
72
- - Change the Codex session folder and save that choice for later runs.
96
+ ### Standard cleanup
73
97
 
74
- ## Safety model
98
+ Recommended for routine removal. It removes supported transcripts, history, registry entries, logs, and linked session artifacts belonging to the selected sessions.
75
99
 
76
- Session Steward is intentionally conservative:
100
+ ### Thorough cleanup
77
101
 
78
- - All session inspection and cleanup happens on your computer.
79
- - Only recognized Codex storage is changed.
80
- - Unrecognized databases and changed storage layouts are reported but left untouched.
81
- - Thorough cleanup is paused when the local storage layout is not supported.
82
- - A backup is created before session data is changed.
83
- - Cleanup is checked afterward for remaining selected artifacts.
84
- - Authentication, plugins, caches, project files, worktrees, and unrelated sessions are not removed.
102
+ Includes standard cleanup and removes additional recognized session-owned data. For Codex this can include supported Desktop references, memory outputs, and goal records. For Claude Code this includes recognized file checkpoints.
85
103
 
86
- At startup, Session Steward may contact the public npm registry to check for a newer release. It does not send session contents or other Codex data.
104
+ Thorough cleanup is unavailable when Session Steward finds storage it does not recognize. Standard cleanup remains available for supported records that can be identified safely.
87
105
 
88
- Close selected Codex sessions before deleting them. Session Steward cannot currently determine whether a session is still being written to.
106
+ ### Recovery backups
89
107
 
90
- ## Cleanup options
108
+ A temporary backup is created inside the active provider folder under `session-steward-backups/`.
91
109
 
92
- ### Standard cleanup
110
+ After cleanup is successfully verified, the backup is removed automatically. If cleanup fails, Session Steward keeps the backup and lets you restore the sessions, keep the backup, or delete it.
93
111
 
94
- Recommended for routine session removal. It removes the selected session registry entries, transcripts, history entries, session-index entries, logs, and linked subagents.
112
+ Before restoring, the current versions of affected files are saved separately to provide another recovery point.
95
113
 
96
- ### Thorough cleanup
114
+ ## Terminal CLI
97
115
 
98
- Choose this when you also want supported local references and generated records removed. It includes everything in standard cleanup, plus recognized ChatGPT Desktop references, memory outputs, and goal records.
116
+ Start the interactive terminal interface:
99
117
 
100
- Thorough cleanup remains unavailable when Session Steward finds storage it does not recognize. Standard cleanup stays available for the supported records it can identify safely.
118
+ ```bash
119
+ session-steward-cli
120
+ ```
101
121
 
102
- ## Backups and recovery
122
+ Use Claude Code instead of Codex:
103
123
 
104
- Completed cleanups keep their recovery backup on disk. If cleanup encounters a problem after creating its backup, Session Steward offers a guided restore from the cleanup progress screen.
124
+ ```bash
125
+ session-steward-cli --provider claude-code
126
+ ```
105
127
 
106
- Before restoring, Session Steward saves the current versions of the affected files in a separate safety folder. This gives you a second recovery point if the restore itself is interrupted.
128
+ List sessions as JSON:
107
129
 
108
- ## Use a custom Codex home folder
130
+ ```bash
131
+ session-steward-cli --json --limit 10
132
+ ```
109
133
 
110
- The browser interface shows the active Codex session folder. Choose **Change folder** to select another existing Codex folder and remember it for future browser and terminal sessions.
134
+ <details>
135
+ <summary>More terminal options</summary>
111
136
 
112
- For a one-time folder override:
137
+ Show session and workspace storage totals:
113
138
 
114
139
  ```bash
115
- session-steward --codex-home /path/to/.codex
140
+ session-steward-cli --overview
116
141
  ```
117
142
 
118
- The command-line override applies only to that run and does not replace the saved folder.
119
-
120
- Saved settings are stored at:
143
+ Add `--json` when the output will be read by another tool.
121
144
 
122
- - macOS: `~/Library/Application Support/session-steward/config.json`
123
- - Linux: `$XDG_CONFIG_HOME/session-steward/config.json`, or `~/.config/session-steward/config.json` when `XDG_CONFIG_HOME` is not set
145
+ Find sessions inactive for at least 60 days:
124
146
 
125
- ## Terminal interface
147
+ ```bash
148
+ session-steward-cli --inactive-days 60
149
+ ```
126
150
 
127
- For an interactive terminal workflow:
151
+ Show only archived sessions:
128
152
 
129
153
  ```bash
130
- session-steward-cli
154
+ session-steward-cli --archive-status archived
131
155
  ```
132
156
 
133
- To inspect a small JSON result without opening the browser:
157
+ Show sessions from one exact workspace:
134
158
 
135
159
  ```bash
136
- session-steward-cli --json --limit 10
160
+ session-steward-cli --workspace /path/to/project
137
161
  ```
138
162
 
139
- Run `session-steward-cli --help` for all available options. The terminal interface uses the same saved Codex folder as the browser interface.
163
+ Use `--include-internals` to include subagents and `--include-supporting` to include supporting sessions. Session sizes are shown in the interactive list, and `--sort size` places the largest sessions first.
164
+
165
+ The interactive terminal accepts the same filters:
166
+
167
+ ```text
168
+ inactive 30
169
+ inactive 60
170
+ inactive 90
171
+ archive active
172
+ archive archived
173
+ workspace /path/to/project
174
+ internals
175
+ supporting
176
+ cleanup standard
177
+ cleanup thorough
178
+ overview
179
+ backups
180
+ ```
140
181
 
141
- ## Common commands
182
+ Run `inactive`, `archive`, or `workspace` without a value to clear that filter.
142
183
 
143
- Start without opening a browser:
184
+ `backups` lists recovery backups retained after an interrupted or unsuccessful cleanup. Use `restore <number>` to restore one, or `delete-backup <number>` to remove it permanently. Both actions require an explicit confirmation.
144
185
 
145
- ```bash
146
- session-steward --no-open
147
- ```
186
+ </details>
187
+
188
+ Use `session-steward-cli --help` to see all available options.
148
189
 
149
- Update to the latest release:
190
+ ## Use a custom provider folder
191
+
192
+ The browser interface displays the active provider folder. Select **Change** to choose another existing folder and remember it for later browser and terminal sessions.
193
+
194
+ For a one-time override:
150
195
 
151
196
  ```bash
152
- npm install --global session-steward@latest
197
+ session-steward --codex-home /path/to/.codex
153
198
  ```
154
199
 
155
- Uninstall Session Steward:
200
+ For Claude Code:
156
201
 
157
202
  ```bash
158
- npm uninstall --global session-steward
203
+ session-steward --claude-home /path/to/.claude
159
204
  ```
160
205
 
161
- Uninstalling the package does not remove your Codex sessions, Session Steward backups, or saved folder preference.
206
+ The command-line override applies only to that run and does not replace your saved folder.
162
207
 
163
- ## Troubleshooting
208
+ ## Other commands
209
+
210
+ Start without automatically opening the browser:
164
211
 
165
- ### The browser did not open
212
+ ```bash
213
+ session-steward --no-open
214
+ ```
166
215
 
167
- Run `session-steward --no-open`, then open the local address printed in the terminal.
216
+ Update Session Steward:
168
217
 
169
- ### No sessions were found
218
+ ```bash
219
+ npm install --global session-steward@latest
220
+ ```
170
221
 
171
- Confirm that the displayed Codex folder contains your local session data. Use **Change folder** or pass `--codex-home` for a one-time override.
222
+ Uninstall it:
172
223
 
173
- ### Thorough cleanup is unavailable
224
+ ```bash
225
+ npm uninstall --global session-steward
226
+ ```
174
227
 
175
- Open the compatibility details in Session Steward. New or changed local storage is left untouched until that format is supported. You can still use standard cleanup when its recognized records are supported.
228
+ Uninstalling Session Steward does not remove provider sessions, recovery backups, or saved folder preferences.
176
229
 
177
- ### Node.js is too old
230
+ ## Troubleshooting
178
231
 
179
- Install Node.js 24.15 or newer, then run `session-steward` again.
232
+ - **The browser did not open:** Run `session-steward --no-open`, then open the local address shown in the terminal.
233
+ - **No sessions were found:** Check the selected provider and displayed home folder. Use **Change** or pass a one-time home-folder override.
234
+ - **Thorough cleanup is unavailable:** Review the compatibility details. Unrecognized storage is left untouched, but standard cleanup may still be available.
235
+ - **Your Node.js version is too old:** Install Node.js 24.15 or newer and run Session Steward again.
180
236
 
181
237
  ## Development
182
238
 
183
- Clone the repository and install its dependencies:
184
-
185
239
  ```bash
186
240
  git clone https://github.com/mallikcheripally/session-steward.git
187
241
  cd session-steward
188
242
  npm install
243
+ npm test
244
+ npm run build
189
245
  ```
190
246
 
191
- Useful commands:
247
+ Scale benchmarks are also available:
192
248
 
193
249
  ```bash
194
- npm start
195
- npm test
196
250
  npm run benchmark:scale
251
+ npm run benchmark:overview
252
+ npm run benchmark:size
197
253
  npm run benchmark:discovery
198
254
  npm run benchmark:transcripts
199
- npm run build
200
- npm pack --dry-run --cache .npm-cache
201
255
  ```
202
256
 
203
- Tests use temporary synthetic Codex data. They do not read or change your local Codex sessions.
257
+ Tests and benchmarks use temporary synthetic session data. They do not read or modify your local sessions.
204
258
 
205
- ## Roadmap
259
+ ## Support
206
260
 
207
- Codex is supported today. Claude Code is planned as the next provider integration.
261
+ Codex, Claude Code CLI, and local Claude Code Desktop sessions are supported. Claude Desktop archive is not treated as deletion, and Session Steward never removes its worktrees.
208
262
 
209
- ## Support
263
+ Use [GitHub Issues](https://github.com/mallikcheripally/session-steward/issues) to report a bug, request a provider, or share a storage format that Session Steward does not recognize.
210
264
 
211
- Use [GitHub Issues](https://github.com/mallikcheripally/session-steward/issues) to report a bug, request a provider, or share a storage format that Session Steward does not yet recognize.
265
+ See the [changelog](https://github.com/mallikcheripally/session-steward/blob/main/CHANGELOG.md) for published release history.
212
266
 
213
- Session Steward is an independent project and is not affiliated with or endorsed by OpenAI.
267
+ Session Steward is an independent project and is not affiliated with or endorsed by OpenAI or Anthropic.
214
268
 
215
269
  ## License
216
270
 
@@ -11,28 +11,55 @@ const { runCli } = await import("../lib/cli.mjs");
11
11
  const { values } = parseArgs({
12
12
  allowPositionals: false,
13
13
  options: {
14
+ "archive-status": {
15
+ type: "string",
16
+ },
17
+ backups: {
18
+ type: "boolean",
19
+ },
14
20
  "codex-home": {
15
21
  type: "string",
16
22
  },
23
+ "claude-home": {
24
+ type: "string",
25
+ },
26
+ cleanup: {
27
+ type: "string",
28
+ },
17
29
  help: {
18
30
  short: "h",
19
31
  type: "boolean",
20
32
  },
33
+ "inactive-days": {
34
+ type: "string",
35
+ },
21
36
  "include-internals": {
22
37
  type: "boolean",
23
38
  },
39
+ "include-supporting": {
40
+ type: "boolean",
41
+ },
24
42
  json: {
25
43
  type: "boolean",
26
44
  },
27
45
  limit: {
28
46
  type: "string",
29
47
  },
48
+ overview: {
49
+ type: "boolean",
50
+ },
51
+ provider: {
52
+ type: "string",
53
+ },
30
54
  search: {
31
55
  type: "string",
32
56
  },
33
57
  sort: {
34
58
  type: "string",
35
59
  },
60
+ workspace: {
61
+ type: "string",
62
+ },
36
63
  },
37
64
  });
38
65
 
@@ -43,24 +70,39 @@ const numericLimit =
43
70
 
44
71
  async function main() {
45
72
  const help = values.help ?? false;
46
- let codexHome = values["codex-home"];
73
+ if (help) {
74
+ await runCli({ help: true });
75
+ return;
76
+ }
77
+ const { createProviderSettings } = await import("../lib/settings.mjs");
78
+ let settings = await createProviderSettings();
79
+ const providerId = values.provider || settings.getActiveProviderId();
80
+ if (!["codex", "claude-code"].includes(providerId)) throw new Error("Provider must be codex or claude-code.");
81
+ const homeOption = providerId === "codex" ? values["codex-home"] : values["claude-home"];
47
82
 
48
- if (!help) {
49
- const { createProviderSettings } = await import("../lib/settings.mjs");
50
- const settings = await createProviderSettings({
51
- providerHomeOverrides: codexHome === undefined ? {} : { codex: codexHome },
83
+ if (homeOption !== undefined) {
84
+ settings = await createProviderSettings({
85
+ providerHomeOverrides: { [providerId]: homeOption },
52
86
  });
53
- codexHome = settings.getHome("codex");
54
87
  }
88
+ const providerHome = settings.getHome(providerId);
55
89
 
56
90
  await runCli({
57
- codexHome,
91
+ archiveStatus: values["archive-status"],
92
+ backups: values.backups ?? false,
93
+ cleanup: values.cleanup,
58
94
  help,
95
+ inactiveDays: values["inactive-days"],
59
96
  includeInternals: values["include-internals"] ?? false,
97
+ includeSupporting: values["include-supporting"] ?? false,
60
98
  json: values.json ?? false,
61
99
  limit: numericLimit,
100
+ overview: values.overview ?? false,
101
+ providerHome,
102
+ providerId,
62
103
  search: values.search ?? "",
63
104
  sort: values.sort ?? "updated",
105
+ workspace: values.workspace,
64
106
  });
65
107
  }
66
108
 
@@ -13,6 +13,7 @@ const { values } = parseArgs({
13
13
  allowPositionals: false,
14
14
  options: {
15
15
  "codex-home": { type: "string" },
16
+ "claude-home": { type: "string" },
16
17
  help: { short: "h", type: "boolean" },
17
18
  "no-open": { type: "boolean", default: false },
18
19
  port: { type: "string" },
@@ -25,6 +26,7 @@ if (values.help) {
25
26
 
26
27
  Options:
27
28
  --codex-home <path> Use a custom Codex session folder
29
+ --claude-home <path> Use a custom Claude session folder
28
30
  --port <number> Use a specific local port
29
31
  --no-open Start without opening a browser
30
32
  -h, --help Show this help
@@ -47,6 +49,7 @@ if (availableUpdate) {
47
49
  }
48
50
 
49
51
  const server = await startLocalServer({
52
+ claudeHome: values["claude-home"],
50
53
  codexHome: values["codex-home"],
51
54
  port,
52
55
  });