Skip to content

feat: retention for messages and attachments (amp-prune), cheaper status line - #40

Merged
jpelaez-23blocks merged 2 commits into
mainfrom
fix/retention-and-statusline
Oct 9, 2026
Merged

jpelaez-23blocks merged 2 commits into
mainfrom
fix/retention-and-statusline

Conversation

@jpelaez-23blocks

@jpelaez-23blocks jpelaez-23blocks commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Part of the AI Maestro ecosystem log and disk audit. The message store had no retention tool, and the status line cost grew with the inbox.

  • scripts/amp-prune.sh (new): dry run by default; --apply, --days N (default 90, minimum 1), --include-unread, --id. Removes read inbox messages and sent copies older than N days, and attachment folders older than N days that no remaining message refers to. Unread messages are kept unless --include-unread. Never follows symlinks; only deletes under the agent's messages/ and attachments/ folders; handles spaces; prints a summary with bytes freed.
  • Opt-in background pruning: with AMP_RETENTION_DAYS=N set, saving to the inbox runs the prune in the background at most once per 24 h per agent (stamp $AMP_DIR/.last-prune), silent, never failing the caller. Off by default: on a real fleet (236 agents, 407 MB) a 90-day default would have deleted 8,061 messages to free 18 MB, so nothing is removed unless the owner asks.
  • amp-statusline.sh: unread is counted in one jq pass (per-file fallback on invalid JSON) instead of one jq per inbox file on every refresh; the /api/agents lookup is cached for 60 s. Output is identical on a fixture (tested against the previous script).
  • amp-register.sh: temp file removed on exit.
  • Docs: README, SKILL.md retention section (description unchanged), commands/amp-prune.md, plugin manifests.
  • Tests: tests/unit/prune.bats, tests/unit/statusline_perf.bats; ./run_tests.sh 309 ok, 0 not ok; shellcheck --severity=warning scripts/*.sh clean. Run on macOS only; GNU find paths not exercised locally.

🤖 Generated with Claude Code

Juan Pelaez and others added 2 commits October 8, 2026 21:40
…p-prune)

amp-prune.sh removes read inbox messages, sent messages and unreferenced
attachment folders older than N days (dry run by default, unread kept).
save_to_inbox runs it in the background at most once per 24 h per agent
(AMP_RETENTION_DAYS, 0 disables). The status line counts unread in one jq
pass and caches the /api/agents lookup for 60 s. amp-register cleans its
temp file on exit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… by default

On a real fleet (236 agents, 407 MB) the 90-day default would have deleted 8,061
messages to free 18 MB; attachments were 0.1 MB. Messages are the agents'
conversation record, so nothing is removed unless AMP_RETENTION_DAYS is set.
The manual amp-prune.sh stays dry-run by default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jpelaez-23blocks
jpelaez-23blocks merged commit 65dfc4c into main Oct 9, 2026
2 checks passed
@jpelaez-23blocks
jpelaez-23blocks deleted the fix/retention-and-statusline branch October 9, 2026 03:49
@jpelaez-23blocks jpelaez-23blocks mentioned this pull request Oct 9, 2026
jpelaez-23blocks added a commit that referenced this pull request Oct 9, 2026
Version bump for 0.3.0: package.json, plugin.json,
.claude-plugin/plugin.json, SKILL.md metadata.version. Includes #40
(amp-prune, cheaper status line) and the earlier unreleased doorbell
(#39) and status-line row 2 changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Juan Pelaez <juan.pelaez@3metas.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant