Skip to content

Retention: cover edits/ and run periodically, not only at server start #413

Backlog

Description

@TMHSDigital

Summary

Add an opt-in SCREENCAST_EDITS_RETENTION_DAYS (separate from captures so nobody loses finished work by surprise) that prunes files in edits/ by mtime, skipping files with an .edit.json or chapters sidecar newer than the cutoff; and re-run pruneCaptures on a daily timer (unref'd) while the server is up.

Where

  • src/utils/retention.ts:1-14
  • src/utils/retention.ts:65-70
  • src/index.ts:46-60
  • src/tools/deleteRecording.ts:60-62

Problem

The header says "Recordings and edits themselves are never touched" (retention.ts:11-12) and the prune only removes *.index.json in edits/ (retention.ts:68-69). pruneCaptures is called once, after connect, in index.ts:48-50. delete_recording says "Edits made from it are kept" (deleteRecording.ts:61-62). Each single-edit tool call writes a fresh re-encoded mp4 into edits/ by default.

Who benefits

Intermediate outputs from chained edit tools (the server instructions warn each call re-encodes) pile up in SCREENCAST_HOME/edits with no opt-in cleanup, and a server left running for days (Claude Desktop) never prunes screenshots/frames either. doctor reports the usage (#354) but nothing can act on it.

Proposal

Add an opt-in SCREENCAST_EDITS_RETENTION_DAYS (separate from captures so nobody loses finished work by surprise) that prunes files in edits/ by mtime, skipping files with an .edit.json or chapters sidecar newer than the cutoff; and re-run pruneCaptures on a daily timer (unref'd) while the server is up. Optionally add includeEdits: true to delete_recording that also removes outputs whose .edit.json source is the deleted recording.

Getting started

  • Relevant files: src/utils/retention.ts, src/index.ts, src/tools/deleteRecording.ts
  • Run tests: npm test (also npm run typecheck and npm run lint); see CONTRIBUTING.md
  • If you change a tool's schema or description, run npm run docs

Filed by repo-audit/full-audit at f0e5ebd. Severity: low. Effort: S. audit-key: enhancement|src/utils/retention.ts|pruneCaptures

Activity

  1. added
    enhancement
    priority: low
    effort: small
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: smallenhancementpriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions