Skill

persistent-memory

Decide when a cross-session memory backend is worth adopting, then set capture, retention, redaction, and injection limits before enabling it. Use when an agent must recall decisions across sessions and the harness has no built-in memory.

Category
optional
Version
0.2.0
License
Apache-2.0
Status
active
Length
74 lines
Source
skills/optional/persistent-memory/SKILL.md

Install and discovery

npx --yes --package @youcisla/agent-foundry agent-foundry-install

After the installer runs, this record is available as persistent-memory. See the docs for harness roots and verification steps.

Contents

Persistent Memory

Instruction-only guidance for adopting a cross-session memory backend. No memory service, hook, or database ships with this skill.

The license field records Apache-2.0 for this skill's text. Any backend you choose carries its own license and terms; check them separately.

Procedure

The decision

Adopt a backend only when all three are true:

  1. The harness loses context that the next session genuinely needs.
  2. Project docs and a short handoff note cannot carry that context.
  3. You can name what is captured, where it is stored, and how it is deleted.

If any answer is missing, write a handoff note instead.

What a backend must specify

QuestionRequired answer
Capture scopeWhich events: prompts, tool calls, file paths, outputs?
RedactionWhich patterns are removed before storage, and when?
StorageLocal file, local database, or remote service? Encryption at rest?
RetentionHow long, and what triggers deletion?
InjectionMaximum characters or tokens added to a future prompt?
Failure modeWhat happens when the backend is unavailable?
ExitHow does a user disable capture and delete existing records?

Adoption procedure

  1. Record the answers above in the project's docs, not only in chat.
  2. Start in a scratch project with a canary secret in the transcript.
  3. Verify the canary never appears in stored records or injected context.
  4. Cap injection to the smallest useful window; review what was injected.
  5. Run one session with the backend disabled to confirm work continues.
  6. Enable it project-wide only after steps 1-5 pass.

Platform scope

Harness integrations differ and change. This repository does not certify Claude Code, Codex, Cursor, Gemini, Hermes, or OpenCode support. Check the backend's own documentation for the current adapter and test it in your environment before relying on it.

Anti-patterns

  • Capturing transcripts before redaction is configured.
  • Using memory as a substitute for project docs or design rationale.
  • Enabling injection with no size cap or review step.
  • Keeping records with no deletion path.
  • Assuming a first session has history to inject.

Verification Checklist

  • [ ] A canary secret was absent from storage and from injected context.
  • [ ] The injection cap is configured and visibly enforced.
  • [ ] Deleting records removes them from every configured store.
  • [ ] A session with the backend disabled still completes.