Agent skill

Retention

by AgentToolkit in AgentToolkit/altk-evolve

Apply data-retention rules to the local evolve store — flag or delete stale and unused memories and expired sessions (dry-run by default)

Apache-2.0Auto-check passedAgent Workflows

Install Retention

skills CLI
$ npx skills add AgentToolkit/altk-evolve --skill retention -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AgentToolkit/altk-evolve retention --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AgentToolkit/altk-evolve.git skills-src && mkdir -p .claude/skills && cp -r skills-src/platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/retention .claude/skills/retention && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
retention
GitHub stars
122
Token cost
~1.1k tokens
SKILL.md length
517 words
Files
2 (incl. scripts)
Skills in repo
21
Repo updated
First seen
Licence
Apache-2.0

At a glance

Apply data-retention rules to the local evolve store — flag or delete stale and unused memories and expired sessions (dry-run by default)

  • Works in 3 steps: Require rules → Dry run → Apply — only on explicit user confirmation
  • Agent Workflows work in your project
  • SKILL.md covers Overview, Workflow and Notes
  • Runs Python scripts from its folder; calls python3 and git

What it does

Retention is an agent skill from AgentToolkit/altk-evolve. Apply data-retention rules to the local evolve store — flag or delete stale and unused memories and expired sessions (dry-run by default)

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/run_retention.py`).

It sits in Agent Workflows. The repository describes itself as: Self improving agents through iterations. The licence is Apache-2.0.

When your agent uses it

  • Agent Workflows work in your project

Example prompts

  • “/retention”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Require rules
  2. Dry run
  3. Apply — only on explicit user confirmation

What it can do on your machine

Read from SKILL.md and the folder at commit 9e5bb56. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Retention loads about 1.1k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 517 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from AgentToolkit/altk-evolve at commit 9e5bb56, republished under its Apache-2.0 licence (© AgentToolkit). 517 words, ~1,065 tokens.

Download SKILL.mdSave it as .claude/skills/retention/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
retention
description
Apply data-retention rules to the local evolve store — flag or delete stale and unused memories and expired sessions (dry-run by default)

Retention

Overview

Runs the data-retention rules configured in evolve.config.yaml against the local .evolve/ store: private entities under .evolve/entities/ and session transcripts under .evolve/trajectories/. Rules match by entity type plus age (max_age_days, from file mtime) or disuse (max_unused_days, from recall rows in .evolve/audit.log), and either flag (a non-destructive frontmatter marker) or delete. A delete rule on trajectories with cascade_derived: true also deletes the entities derived from those sessions (linked by their trajectory: frontmatter).

The script is dry-run by default — it never mutates anything unless --apply is passed.

Workflow

Step 1: Require rules

Read evolve.config.yaml. If there is no retention: block with a rules: list, show the user this example and stop:

yaml
retention:
  rules:
    - name: stale-guidelines
      entity_type: guideline
      max_age_days: 90
      action: flag
    - name: old-sessions
      entity_type: trajectory
      max_age_days: 365
      action: delete
      cascade_derived: true

Each rule needs a name and at least one of max_age_days / max_unused_days; action is flag (default) or delete. Rules are checked top-to-bottom and the first match wins, so put narrow rules first — and put a longer-threshold delete before a shorter-threshold flag on the same type, or the flag shadows the delete and it never fires.

A delete rule may also set on_missing_access_signal to say what happens when an unused match has no recorded recall (disuse measured from file mtime): skip (default, fail-safe — spare it and report it as skipped), flag (downgrade the delete to a non-destructive flag), or delete (delete on the mtime fallback anyway). The safe default means an unused delete never destroys a memory the agent simply never recorded a recall for.

Step 2: Dry run

From the project root:

bash
python3 "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/plugins/evolve-lite/skills/evolve-lite/retention/scripts/run_retention.py"

Show the user the full report — every entry says what would be flagged, deleted, or skipped, why (age, unused, or cascade:<session>), by which rule, and on what evidence. SKIP lines are entities a delete rule matched on a degraded signal but spared under on_missing_access_signal: skip. Relay any WARNING lines too: they say when a signal was weaker than it looks (for example, disuse measured from file mtime because the entity has no recall row).

Show full SKILL.md (201 more words)Show less
Step 3: Apply — only on explicit user confirmation

Deleting is destructive and there is no undo. Ask the user to confirm the dry-run report first. Never pass --apply without an explicit go-ahead.

bash
python3 "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/plugins/evolve-lite/skills/evolve-lite/retention/scripts/run_retention.py" --apply

Relay the applied report back to the user.

Notes

  • Flag upserts retention_flagged_at, retention_reason, and retention_rule into the entity's frontmatter; the file's mtime is preserved so its age clock doesn't reset. Trajectory files are opaque JSON, so their flag is recorded in .evolve/audit.log only.
  • Every applied action is logged to .evolve/audit.log as an event: "retention" row.
  • Subscribed entities (.evolve/entities/subscribed/) are out of scope — they are git clones owned by the sync skill and local deletes would be restored on the next sync.
  • A standalone policy file can be passed with --policy <file> (a rules: list in JSON or YAML), overriding the config block.
  • Signal caveats, worth stating when you relay a report: age is file mtime (editing an entity resets its clock — there is no created_at in the store), and the disuse signal only exists for entities the agent recorded via the recall audit step. The trajectory: cascade link is supported but nothing writes it automatically today, so cascade_derived only fires for entities where that key was set by hand.

© AgentToolkit, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/retention of AgentToolkit/altk-evolve.

  • SKILL.md
  • scripts/run_retention.py

Open the folder on GitHubat commit 9e5bb56

Compare with similar skills

Retention next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Retention compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Retention this skillAgentToolkit/altk-evolve122—~1.1kAutomated safety check: PassApache-2.0
MCP Server Builderanthropics/skills180k62 repos~2.3kAutomated safety check: PassApache-2.0
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official37k11 repos~4.1kAutomated safety check: NotesApache-2.0
Using Superpowersfarm-fe/farm5.6k34 repos~1.4kAutomated safety check: PassMIT
Executing Plans Inlineobra/superpowers296k2 repos~5.1kAutomated safety check: PassMIT
Claude Code Agent Developmentanthropics/claude-plugins-official37k8 repos~2.8kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 62 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    37k GitHub starsUsed in 11 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Using Superpowers

    farm-fe/farm

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    5.6k GitHub starsUsed in 34 repos~1.4k tokens
    Agent WorkflowsAuto-check passed
  • Executing Plans Inline

    obra/superpowers

    Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.

    296k GitHub starsUsed in 2 repos~5.1k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    37k GitHub starsUsed in 8 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Skill Creator

    Azure/azqr

    Official

    Create new skills, modify and improve existing skills, and measure skill performance.

    794 GitHub starsUsed in 89 repos~8.2k tokens
    Agent WorkflowsAuto-check passed

More from AgentToolkit/altk-evolve

All 21 skills in this repo
  • Agent Wiki Compare Outcomes

    AgentToolkit/altk-evolve

    Contrasts successful and failed agent runs of the same task and derives guidelines backed by evidence from transcripts, tool calls and outcome judgments.

    122 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Trajectory Skill Synthesizer

    AgentToolkit/altk-evolve

    Turns a saved agent trajectory into a reusable skill with a SKILL.md and supporting scripts, so later sessions can call the workflow instead of rediscovering it.

    122 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Evolve Memory Mirror

    AgentToolkit/altk-evolve

    Copies a memory the agent just saved into the shared evolve store with a retrieval trigger, so it can be shared across a team and audited like other entities.

    122 GitHub stars~922 tokensUpdated today
    Auto-check passed
  • Agent Wiki Consult

    AgentToolkit/altk-evolve

    Has the agent read a project wiki's AGENTS.md and pull the guidelines that fit the task it is about to start, instead of loading the wiki at session start.

    122 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Wiki Guideline Extractor

    AgentToolkit/altk-evolve

    Reads a normalized Claude Code trajectory JSON and turns its errors and solutions into reusable guideline pages in wiki-twobatch/guidelines.

    122 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Agent Wiki Ingest

    AgentToolkit/altk-evolve

    Ingest one or more agent trajectories (raw bob/claude traces or normalized JSON) into an agent-wiki end-to-end — convert, summarize, extract guidelines, synthesize skills, optionally compare…

    122 GitHub stars~4k tokensUpdated today
    Auto-check passed

Categories

Questions about Retention

What does Retention do?

Apply data-retention rules to the local evolve store — flag or delete stale and unused memories and expired sessions (dry-run by default). Retention is an agent skill from AgentToolkit/altk-evolve.

When should I use Retention?

Retention fits situations like: agent Workflows work in your project.

How do I install Retention in Claude Code?

Run `npx skills add AgentToolkit/altk-evolve --skill retention -a claude-code`. Or copy the skill folder (platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/retention in AgentToolkit/altk-evolve) into .claude/skills/retention in your project. Claude Code loads it when a task matches its description.

How do I install Retention in Codex?

Run `npx skills add AgentToolkit/altk-evolve --skill retention -a codex`. Or copy the skill folder (platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/retention in AgentToolkit/altk-evolve) into .agents/skills/retention in your project. Codex loads it when a task matches its description.

Can I use Retention in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AgentToolkit/altk-evolve --skill retention -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/retention, .gemini/skills/retention, .github/skills/retention and .opencode/skills/retention in your project.

What does Retention need to run?

Going by SKILL.md and its folder, Retention needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and git). Our summary lists: Python 3.

Does Retention access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Retention safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Retention use?

Retention is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Retention use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Retention?

Skills that share tags, products or a category with Retention: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 37k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 296k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Retention?

AgentToolkit (a GitHub organization) maintains it in AgentToolkit/altk-evolve, which has 122 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 7, 2026.

Source: AgentToolkit/altk-evolve on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.