Skip to content

Add session prune command — scoped cleanup by author #34

@efenocchi

Description

@efenocchi

Context

Session JSONL files are now read-only in the VFS (EPERM on write/rm/mv). Users need a way to clean up old sessions without bypassing protections.

Proposal

Add a CLI command for session cleanup, scoped to the current user's sessions only:

hivemind sessions prune                          # list pruneable sessions
hivemind sessions prune --before 2026-04-01      # delete sessions older than date
hivemind sessions prune --session-id abc-123      # delete specific session
hivemind sessions prune --all                     # delete all own sessions

Rules

  • Only delete sessions where author matches the logged-in user from credentials
  • Cannot delete other users' sessions
  • Deletes both the session rows (sessions table) and the corresponding summary (memory table)
  • Requires confirmation unless --yes is passed

Related

PR #33 added EPERM guards on session files. This command provides the controlled alternative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions