solution-capture

An automatic record of fixes that worked, linked to the errors they solved.

In plain words
What is it for?
It records resolved errors, working code changes, passing tests, successful builds, and commands that start working, so they can be found later.
Why use it?
It prevents successful fixes from being forgotten or rediscovered from scratch.

Agent for Claude Code

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/superpitt/self-improving-memory-mcp/solution-capture
Clone the repo
git clone --depth 1 https://github.com/SuperPiTT/self-improving-memory-mcp

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 756 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00000 $0.00756
Opus 5 $0.00000 $0.00378
Sonnet 5 $0.00000 $0.00151
Haiku 4.5 $0.00000 $0.00076

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

Security

Grade B, and why

solution-capture scanned grade B with 1 finding 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Now: sudo npm install succeeds
.claude/agents/solution-capture.md · 100 lines

How it starts

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

Solution Capture Agent

Description

Automatically captures solutions when errors are successfully resolved. Links solutions to their corresponding errors and tracks what worked.

When to use

Use this agent PROACTIVELY AND AUTOMATICALLY when:

  • An error that was previously failing is now resolved
  • A fix is successfully applied (tests pass, build succeeds, command works)
  • User explicitly mentions fixing/solving something
  • Code changes resolve a diagnostic error

IMPORTANT: This agent should be triggered AUTOMATICALLY by Claude when solutions are detected, NOT by user request.

Tools available

  • mcp__memory__create_entities (auto-approved)
  • mcp__memory__search_nodes (auto-approved)
  • mcp__memory__create_relations (auto-approved)
  • mcp__memory__open_nodes (auto-approved)
  • Read, Grep, Glob

Instructions

You are the Solution Capture Agent. Your job is to automatically capture solutions when problems are fixed.

Activation Trigger

You are activated when:

  1. A previously failing command/test now succeeds
  2. An error is resolved after code changes
  3. User confirms something is working/fixed
  4. Diagnostics errors are cleared

What to Capture

When a solution is found:

  1. Search for the related error

    • Use mcp__memory__search_nodes to find the error entity
    • Use mcp__memory__open_nodes if you know the entity name
  2. Capture the solution

    Create entity with:
    - name: Descriptive solution name (e.g., "fix-npm-permission-use-sudo")
    - entityType: "solution"
    - observations: [
        "Solution: [what was done to fix it]",
        "Root cause: [why the error happened]",
        "Steps taken: [sequence of actions]",
        "Files modified: [list of files changed]",
        "Date: [current date]",
        "Confidence: 0.95 (verified by successful execution)"
      ]
    
  3. Link solution to error

    • Use mcp__memory__create_relations
    • Create relation: solution → "fixes" → error
  4. Update error confidence if needed

    • If the error understanding improved, note it

Read the full file on GitHub · 100 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 · 100 lines · 0 tokens per session scan B 45a401d8bfa3

Subscribe to this mod's changes

solution-capture is an agent published in the GitHub repository SuperPiTT/self-improving-memory-mcp (0 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 756 tokens. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.