Skip to content

Add session prune command#35

Merged
efenocchi merged 4 commits intomainfrom
session-prune
Apr 10, 2026
Merged

Add session prune command#35
efenocchi merged 4 commits intomainfrom
session-prune

Conversation

@efenocchi
Copy link
Copy Markdown
Collaborator

Summary

  • Add sessions prune CLI subcommand for scoped session cleanup by author
  • Supports --all, --before <date>, --session-id <id> modes with --yes to skip confirmation
  • Deletes both session rows (sessions table) and corresponding summary files (memory table)
  • Only operates on sessions owned by the logged-in user

Test plan

  • 174 unit tests passing (vitest)
  • E2E claude -p --plugin-dir: capture creates sessions, sessions prune lists them, --all --yes deletes sessions + summaries
  • Verified empty state message after full prune
  • Tested against memory_test/sessions_test tables to avoid polluting production data

Closes #34

New `sessions prune` subcommand lets users list and delete their own
sessions without bypassing the EPERM guards on session files.

Modes: --all, --before <date>, --session-id <id>, with --yes to skip
confirmation. Deletes both session rows and corresponding summaries.

Closes #34
@claude
Copy link
Copy Markdown

claude bot commented Apr 10, 2026

Claude finished @efenocchi's task in 2m 2s —— View job


  • Read PR diff and changed files
  • Analyze for bugs, security issues, correctness
  • Post inline comments

Found 2 issues (1 bug, 1 minor):

  • Bug extractSessionId: split("_").slice(3) returns wrong session ID when username/org/workspace contain underscores, causing summary files to be silently skipped during prune. Fix: use the same regex already in deeplake-fs.ts.
  • Minor unused import: sqlLike is imported but never used.

Use the same regex as deeplake-fs.ts to correctly extract session IDs
when username/org/workspace contain underscores. Remove unused sqlLike
import.
@efenocchi efenocchi merged commit 22268f9 into main Apr 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add session prune command — scoped cleanup by author

1 participant