pull-learnings

pull-learnings is a command for Claude Code from closedloop-ai/claude-plugins. It costs 12 tokens per session (558 once invoked), scanned A, original, Apache-2.0.

A command that imports shared organization patterns into a local TOON file, a compact text format intended for language models. It converts the shared JSON data and keeps local identifiers unique.

In plain words
What is it for?
Use it to pull the latest shared patterns, convert them for local use, merge them into the local learnings file, and skip duplicate-origin entries.
Why use it?
It brings reusable lessons into a project while avoiding patterns that originally came from that same project. This prevents the project from importing its own data back in a loop.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the self-learning plugin — 2 skills, 6 commands shipped together

Good fit Use it to pull the latest shared patterns, convert them for local use, merge them into the local learnings file, and skip duplicate-origin entries.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/closedloop-ai/claude-plugins/pull-learnings
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.

Clone the repo
git clone --depth 1 https://github.com/closedloop-ai/claude-plugins

Made for: Claude Code.

Or install self-learning, the plugin that ships this one along with the rest of its 2 skills, 6 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pull-learnings

README.md
[![agentmods](https://agentmods.dev/badge/commands/closedloop-ai/claude-plugins/pull-learnings.svg)](https://agentmods.dev/commands/closedloop-ai/claude-plugins/pull-learnings)
Your own site
<a href="https://agentmods.dev/commands/closedloop-ai/claude-plugins/pull-learnings"><img src="https://agentmods.dev/badge/commands/closedloop-ai/claude-plugins/pull-learnings.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 558 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00012 $0.00558
Opus 5 $0.00006 $0.00279
Sonnet 5 $0.00002 $0.00112
Haiku 4.5 $0.00001 $0.00056

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

Security

Grade A, and why

pull-learnings 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.

plugins/self-learning/commands/pull-learnings.md · 82 lines

How it starts

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

Pull Learnings Command

Imports organization patterns from a shared repository into local TOON format.

Prerequisites

  • CLAUDE_ORG_ID environment variable must be set
  • Must run git pull first to get latest shared patterns
  • Local .learnings/ directory must exist

Process

  1. Read shared patterns: Load $CLOSEDLOOP_WORKDIR/.closedloop-ai/learnings/org-patterns.json
  2. Convert JSON → TOON: For LLM consumption
  3. Regenerate local IDs: Maintain unique IDs within local file
  4. Skip echo patterns: Exclude patterns that originated from this project
  5. Merge into local: Update $CLOSEDLOOP_WORKDIR/.learnings/org-patterns.toon

Echo Prevention

To avoid circular pattern propagation:

  1. Read sources.json to identify pattern origins
  2. Skip patterns where source_project matches current project
  3. This prevents: Project A → Shared → Project A (echo)

JSON to TOON Conversion

# JSON
{
  "id": "P-001",
  "scope": "org",
  "category": "pattern",
  "trigger": "auth_flow",
  "confidence": "high",
  "seen_count": 5,
  "success_rate": 0.85,
  "flags": "",
  "applies_to": ["impl-subagent"],
  "summary": "Check token expiry"
}

# TOON
P-001|org|pattern|auth_flow|high|5|0.85||impl-subagent,"Check token expiry"

Merge Strategy

When merging into local patterns:

  1. New patterns: Append to file with new local ID
  2. Existing patterns (same trigger): Update metadata, keep higher seen_count
  3. Conflicting patterns: Prefer pattern with higher success_rate

Local ID Generation

Local IDs are regenerated during pull to:

  • Avoid collisions with existing local patterns
  • Maintain consistent ID sequence in local file
  • Original shared ID preserved in metadata comment

Usage

# First, pull latest from remote
git pull origin main

# Then pull learnings (via ClosedLoop orchestrator)
# Requires CLAUDE_ORG_ID to be set
export CLAUDE_ORG_ID="my-organization"

Output

Updates $CLOSEDLOOP_WORKDIR/.learnings/org-patterns.toon with:

  • New patterns from shared repository
  • Updated metadata for existing patterns
  • Comments indicating pattern sources

Read the full file on GitHub · 82 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 · 82 lines · 12 tokens per session scan A 9b5a59949118

Subscribe to this mod's changes

pull-learnings is a command published in the GitHub repository closedloop-ai/claude-plugins (103 stars, last pushed yesterday), licensed Apache-2.0. It adds 12 tokens to every session and 558 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-09-07.