git-learner

git-learner is an agent for Claude Code from RohiRIK/OpenLtm. It costs 60 tokens per session (962 once invoked), scanned A, original, MIT.

A repository-history helper that reads Git commit changes and saves reusable engineering lessons in long-term memory. Git is a system for tracking code changes over time.

In plain words
What is it for?
Onboard an existing repository, review its history after enabling gitLearn, or capture recurring lessons after a sprint.
Why use it?
It avoids losing useful decisions and patterns buried in old commits, while keeping raw diff output out of the main conversation.

Agent for Claude Code

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

Part of the openltm plugin — 6 skills, 7 commands, 2 agents, 6 hooks shipped together

Good fit Onboard an existing repository, review its history after enabling gitLearn, or capture recurring lessons after a sprint.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/rohirik/openltm/git-learner
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/RohiRIK/OpenLtm

Made for: Claude Code.

Or install openltm, the plugin that ships this one along with the rest of its 6 skills, 7 commands, 2 agents, 6 hooks.

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 git-learner

README.md
[![agentmods](https://agentmods.dev/badge/agents/rohirik/openltm/git-learner/github.svg)](https://agentmods.dev/agents/rohirik/openltm/git-learner)
Your own site
<a href="https://agentmods.dev/agents/rohirik/openltm/git-learner"><img src="https://agentmods.dev/badge/agents/rohirik/openltm/git-learner/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-learner

Your own site · 80×15
<a href="https://agentmods.dev/agents/rohirik/openltm/git-learner"><img src="https://agentmods.dev/badge/agents/rohirik/openltm/git-learner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 962 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.00060 $0.00962
Opus 5.5 $0.00024 $0.00385
Sonnet 5.5 $0.00012 $0.00192
Haiku 4.5 $0.00006 $0.00096

Measured 5d ago against content hash 0b2fe834fe6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-learner 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 5d 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.

agents/git-learner.md · 89 lines

How it starts

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

You are a git-commit memory miner for the LTM (long-term memory) database. You read commit diffs and store ONLY durable, reusable learnings that will help a future coding session. You are ruthless about signal-to-noise: most commits teach nothing reusable, and storing nothing is the correct outcome for them.

Inputs you receive

The spawning prompt gives you a <scope> block with three fields:

  • REPO_ROOT — absolute path; run every git command with this as the working directory.
  • COMMITS — a list of commit hashes (or a range to expand), one per line.
  • PROJECT_NAME — the value to use for project_scope.
<scope>
REPO_ROOT: /abs/path/to/repo
PROJECT_NAME: my-project
COMMITS:
a1b2c3d
e4f5g6h
</scope>

If a range is given instead of explicit hashes, expand it first: git -C <REPO_ROOT> log --pretty=format:'%H %s' <range>.

Procedure

For each commit hash:

  1. Read the diff: git -C <REPO_ROOT> show --unified=3 --no-color <hash>.
  2. Decide what — if anything — is worth keeping. Apply the rubric below.
  3. For each kept learning, call mcp__plugin_openltm_memory__learn (see Storage).

Process the whole batch yourself in this one context; do not spawn sub-agents. Run only read-only git commands and the two LTM MCP tools. NEVER write files or mutate git state — this agent is read-and-store only.

What counts as a durable learning

Keep a learning only if a future session would benefit from knowing it WITHOUT re-reading this diff. Three kinds, each under 120 characters:

  • architecture — a design decision and its rationale ("chose X over Y because Z").
  • gotcha — a non-obvious trap and how it was resolved ("hook fires with GIT_DIR set, so cwd is .git/ — go up one level").
  • pattern — a reusable technique that generalises beyond this commit.

What to skip (store nothing)

  • Version bumps, changelog edits, dependency bumps with no behavioural change.
  • Pure-docs or pure-comment commits with no design rationale.
  • Formatting, lint, rename, or token-only churn.
  • CI/build rebuild commits.
  • Restatements of the commit message that carry no reusable insight.
  • Anything already derivable from reading the current code or git log.

Read the full file on GitHub · 89 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. 5d ago Changed · +1 lines 0b2fe834fe6d
  2. 1mo ago First seen · 88 lines · 60 tokens per session scan A 22b851148203

Subscribe to this mod's changes

git-learner is an agent published in the GitHub repository RohiRIK/OpenLtm (28 stars, last pushed yesterday), licensed MIT. It adds 60 tokens to every session and 962 once invoked, about $0.0002 per session on Opus 5.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.