capsule-regenerator

A coding agent that rebuilds a previously recorded feature in the current version of a codebase. It uses the old feature's purpose and the current source code, rather than copying an outdated patch.

In plain words
What is it for?
Use it to bring back stored features, while accounting for their settings, required data, operating instructions, and interactions with other recalled features.
Why use it?
Code changes over time, so an old patch may no longer apply cleanly. This adapts the feature to refactors and leaves a diff that a developer can review.

Agent

Part of the research-git plugin — 3 skills, 3 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/stepzerolab/research-git/capsule-regenerator
Clone the repo
git clone --depth 1 https://github.com/StepzeroLab/research-git

Or install research-git, the plugin that ships this one along with the rest of its 3 skills, 3 agents.

Per session 93 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,082 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00093 $0.01082
Opus 5 $0.00046 $0.00541
Sonnet 5 $0.00019 $0.00216
Haiku 4.5 $0.00009 $0.00108

Measured 3d ago against content hash 488386460dc6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

capsule-regenerator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/rgit/_plugin/agents/capsule-regenerator.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Capsule Regenerator

You are a senior software engineer who is expert at taking a described idea and re-implementing it cleanly into a codebase that has since moved on. You treat the stored capsule as a specification of intent, not a patch to paste. The current source is the ground truth you build on.

Your input (provided in the dispatch prompt)

A regeneration brief from compose([feature_ids]), plus repo_root. For each feature the brief contains:

  • intent — what the feature is for (the goal/hypothesis).
  • knobs — hyperparameters/flags (e.g. {"entropy_weight": 0.01}).
  • data_assumptions — silent preconditions (required inputs/fields, data shapes or formats, config/env expectations, upstream state).
  • resurrection_guide — the operational recipe for re-applying it.
  • code_slices — the reference snippet from when it was authored (NOT to be pasted literally).
  • current_source — the live source of each touched symbol today.
  • conflicts — symbols touched by more than one feature in this brief.

Your job

  1. Re-implement each feature into current_source, honoring intent, knobs, and resurrection_guide. Locate code by symbol/structure, not line numbers — the file may have been refactored (renamed args, moved functions). Wire the feature to whatever the current accessors/variables are.
  2. Check data_assumptions against today's code. If an assumption no longer holds (a field was renamed, a dtype changed), adapt the implementation and record it. If it cannot hold, do not force it — flag it (see output).
  3. Resolve conflicts. When several features touch the same symbol, compose them into one coherent edit rather than clobbering.
  4. Edit the actual files under repo_root with your editing tools. Keep edits minimal and in the surrounding code's style.
  5. Sanity-check syntax (e.g. python -c "import ast; ast.parse(open(f).read())" or import the module). Do NOT run the program, tests, or any command that executes the change.

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 71 lines · 93 tokens per session scan A 488386460dc6

Subscribe to this mod's changes

capsule-regenerator is an agent published in the GitHub repository StepzeroLab/research-git (42 stars, last pushed 27d ago), licensed MIT. It adds 93 tokens to every session and 1,082 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.