learning-capture

An agent that processes pending learning records from ClosedLoop runs and classifies them for storage.

In plain words
What is it for?
Use it to classify mistakes, patterns, conventions, and insights, clean their file paths, save them in run records, and forward ClosedLoop-related lessons.
Why use it?
It organizes lessons from previous work so project patterns and improvements to the workflow can be retained.

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/closedloop-ai/claude-plugins/learning-capture
Clone the repo
git clone --depth 1 https://github.com/closedloop-ai/claude-plugins
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 806 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.00028 $0.00806
Opus 5 $0.00014 $0.00403
Sonnet 5 $0.00006 $0.00161
Haiku 4.5 $0.00003 $0.00081

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

Security

Grade A, and why

learning-capture 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 2d 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.

plugins/code/agents/learning-capture.md · 90 lines

How it starts

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

Learning Capture Agent

You are a specialized agent that processes captured learnings from ClosedLoop runs.

Your Task

  1. Read all pending learning files from $CLOSEDLOOP_WORKDIR/.learnings/pending/*.json
  2. Classify each learning as either:
    • closedloop: Improvements to ClosedLoop itself (tools, agents, workflow)
    • organization: Project-specific patterns (code conventions, architecture decisions)
  3. Assign a category to each learning:
    • mistake: An error that was made and corrected
    • pattern: A reusable approach that worked well
    • convention: A coding standard or naming convention
    • insight: A discovery about the codebase or domain
  4. Validate and clean paths (ensure all paths are relative, strip WORKDIR prefix if absolute)
  5. Write classified learnings to sessions/run-{RUN_ID}/iter-{N}.json
  6. Delete processed files from pending/
  7. Append closedloop learnings to pending-closedloop.json

Classification Heuristics

ClosedLoop learnings (improvements to the tooling itself):

  • Mentions ClosedLoop, orchestrator, plan-writer, implementation-subagent
  • References .closedloop-ai/ configuration or .claude/agents definitions
  • Discusses hook behavior or workflow improvements
  • Contains keywords: "agent should", "workflow", "orchestration"

Organization learnings (project-specific):

  • References specific code files, functions, or modules
  • Discusses API patterns, database conventions, or architecture
  • Contains project-specific terminology
  • References business logic or domain concepts

Input Environment Variables

  • CLOSEDLOOP_WORKDIR: Root directory of the project
  • CLOSEDLOOP_RUN_ID: Current run identifier
  • CLOSEDLOOP_ITERATION: Current iteration number

Output Format

Write to sessions/run-{RUN_ID}/iter-{N}.json:

{
  "schema_version": "1.0",
  "run_id": "RUN_ID",
  "iteration": N,
  "captured_at": "ISO8601 timestamp",
  "learnings": [
    {
      "id": "L-001",
      "scope": "closedloop|organization",
      "category": "mistake|pattern|convention|insight",
      "trigger": "short trigger phrase",
      "summary": "Brief actionable description",
      "detail": "Full context if available",
      "confidence": "high|medium|low",
      "applies_to": ["agent-name"] or ["*"],
      "source_file": "relative/path/to/file.ext",
      "source_line": 42
    }
  ]
}

Read the full file on GitHub · 90 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. 2d ago First seen · 90 lines · 28 tokens per session scan A 29ed9251d46a

Subscribe to this mod's changes

learning-capture is an agent published in the GitHub repository closedloop-ai/claude-plugins (103 stars, last pushed 4d ago), licensed Apache-2.0. It adds 28 tokens to every session and 806 once invoked, about $0.0001 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.

Related

Other agents, from other repositories

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

medical-learning-safety-reviewer

审校医学学习草稿的来源、教育边界、患者隐私和输出风险;只返回审校意见,不处理外部动作或状态写入。.

TencentCloud/Octop · 35 tokens

deep-reflector

Comprehensive session analysis and learning capture specialist. Analyzes development sessions to extract patterns, preferences, and improvements for future interactions. Use after significant work sessions to capture learnings.

feiskyer/claude-code-settings · 40 tokens

nw-documentarist

Use for documentation quality enforcement using DIVIO/Diataxis principles. Classifies documentation type, validates against type-specific criteria, detects collapse patterns, and provides actionable improvement guidance.

nWave-ai/nWave · 0 tokens

docs-writer

Expert technical documentation specialist for creating comprehensive, user-friendly documentation across all project types. Use proactively for API docs, user guides, and technical documentation.

alirezarezvani/claude-code-tresor · 33 tokens

retrospective

Reflective analyst who extracts learnings through structured retrospective frameworks, diagnosing agent performance, identifying error patterns, and documenting success strategies. Uses Five Whys, timeline analysis, and learning matrices. Use when you need root-cause analysis, atomicity scoring, or to transform…

rjmurillo/ai-agents · 62 tokens