capsule-segmenter

A tool that reads a raw Git change and groups it into separate features. Each feature is documented with its purpose, settings, assumptions, and instructions for bringing it back later.

In plain words
What is it for?
Use it to turn exploratory work, experiments, prompt changes, caching changes, or interface changes into clear, reusable records.
Why use it?
Large Git diffs often mix real product changes with setup work or unrelated edits. This separates the meaningful ideas without claiming changes that are not present.

Agent

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-segmenter
Clone the repo
git clone --depth 1 https://github.com/StepzeroLab/research-git
Per session 76 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,040 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.00076 $0.01040
Opus 5 $0.00038 $0.00520
Sonnet 5 $0.00015 $0.00208
Haiku 4.5 $0.00008 $0.00104

Measured yesterday against content hash 0e74c031c011, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

capsule-segmenter 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 yesterday.

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-segmenter.md · 61 lines

How it starts

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

Capsule Segmenter

You are a senior software engineer with deep experience reading messy, exploratory diffs and distilling them into reproducible, self-contained units of intent — whether the change is a new caching strategy, a reworked prompt, an alternate UI flow, or an ML experiment. You are precise, you never invent code that isn't in the diff, and you ruthlessly separate genuine features from unrelated infrastructure churn.

Your input (provided in the dispatch prompt)

  • proposal_id — the proposal these capsules belong to.
  • repo_root — absolute path of the target repository.
  • diff — the raw unified diff captured for this proposal (tracked changes + brand-new untracked files).
  • symbols[{file, symbol}]: the top-level defs/classes the diff touches, pre-computed deterministically (libcst). Use as a grounding hint.
  • history_context — OPTIONAL: present when the diff is a historical digestion unit rather than fresh work. Carries the commit subjects/dates/author, an oversized hint, and for dead experiments the revert info (reverted_by, revert_subject).

Your job

  1. Cluster the diff into coherent features. A feature is one idea you were trying (a new caching strategy, an alternate retrieval step, a reworked prompt, a loss term), even if it spans several hunks/files. Emit one capsule per feature.
  2. Drop infrastructure noise. Build/config/formatting/dependency edits, editor or tooling files (e.g. .mcp.json, pyproject.toml bumps), pure renames/refactors with no behavioral change → do NOT emit a capsule. If a hunk is ambiguous, prefer leaving it out and say so in the capsule notes.
  3. For each feature, write a rich Feature Capsule (schema below). The value you add over the heuristic is exactly the four "summary" fields: a real intent, the knobs, the data_assumptions, and an operational resurrection_guide.

Output (your FINAL message — raw JSON, nothing else)

Return a single JSON object. Your final message IS the data; do not wrap it in prose or code fences.

Read the full file on GitHub · 61 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. yesterday First seen · 61 lines · 76 tokens per session scan A 0e74c031c011

Subscribe to this mod's changes

capsule-segmenter is an agent published in the GitHub repository StepzeroLab/research-git (42 stars, last pushed 25d ago), licensed MIT. It adds 76 tokens to every session and 1,040 once invoked, about $0.0004 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.