Context memory

From rohitg00/agentbrain · View interactive version

Context memory is an AI agent skill from the GitHub repository rohitg00/agentbrain. Use when deciding what project context should be remembered, retrieved, updated, or deliberately forgotten.

How to use this skill

Skill file

context-memory

Lifecycle stage: LEARN

Trigger

Use when an agent needs durable context, asks whether memory should be updated, resumes old work, ingests project knowledge, or finishes a loop that may produce reusable learning.

When not to use

Do not use when this trigger is absent; choose the command or skill that owns the requested state, artifact, and verification gate.

Inputs

Procedure

  1. Classify the candidate as stable fact, durable decision, reusable procedure, source-backed project knowledge, temporary task progress, or sensitive/private data.
  2. Choose the smallest correct storage target:
  1. Reject noisy logs, stale status, raw personal data, secrets, and one-off task progress.
  2. Attach evidence or mark the memory as an assumption.
  3. Write the update in neutral, declarative language with a scope and freshness note.
  4. For resumes, handoffs, and long runs, write a context boundary: included context, excluded context, read files, modified files, compaction, and freshness.
  5. Add or update an eval, validator, or review gate when the memory rule should not regress.

Anti-Rationalization

| Shortcut | Rebuttal |

|---|---|

| "Remember everything just in case." | Durable memory should store stable facts, decisions, or reusable procedures, not raw task logs. |

| "The chat is enough evidence." | Versioned docs or skills need checked sources, files, commands, or explicit assumptions. |

| "This procedure belongs in memory." | Repeatable procedures belong in skills or docs so future agents can inspect and validate them. |

Verification

Output Artifact

Produce a memory decision that names the target tier, evidence, freshness/scope, rejected material, blockers, written update or no-write reason, and the next action for any validator, eval, doc, or skill follow-up.

Failure Modes

Example

Trigger: project context may need to be remembered, retrieved, updated, or rejected. Action: separate stable preferences, project docs, procedures, session recall, and private data before writing memory. Output artifact: templates/memory-decision.md with blockers and next action. Verification: cite tier, evidence, freshness, privacy review, rejected material, and next use.

Input: “We fixed this after three attempts; remember the approach.”

Better response pattern:

  1. extract the reusable procedure,
  2. discard temporary file names, PR numbers, and timestamps,
  3. save the procedure as a skill or patch an existing skill,
  4. link the evidence or command pattern,
  5. verify the skill has trigger, procedure, pitfalls, and verification sections.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.