learning-engine

learning-engine is an agent for Cursor from jiten-singh-shahi/salesforce-claude-code. It costs 48 tokens per session (2,320 once invoked), scanned B, original, MIT.

A continuous-learning assistant for Salesforce development that extracts small reusable patterns, called instincts, from repeated coding sessions and assigns them confidence scores.

In plain words
What is it for?
Use it to collect patterns from sessions, manage project and global instincts, improve architecture and code reviews, and export or promote trusted patterns. It is not intended for one-off tasks.
Why use it?
It turns recurring observations into project or shared knowledge over time, rather than trying to learn from a single task.

Agent for Cursor

Part of the salesforce-claude-code plugin — 41 skills, 17 agents shipped together

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/jiten-singh-shahi/salesforce-claude-code/learning-engine
Clone the repo
git clone --depth 1 https://github.com/jiten-singh-shahi/salesforce-claude-code

Made for: Cursor.

Or install salesforce-claude-code, the plugin that ships this one along with the rest of its 41 skills, 17 agents.

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 learning-engine

README.md
[![agentmods](https://agentmods.dev/badge/agents/jiten-singh-shahi/salesforce-claude-code/learning-engine.svg)](https://agentmods.dev/agents/jiten-singh-shahi/salesforce-claude-code/learning-engine)
Your own site
<a href="https://agentmods.dev/agents/jiten-singh-shahi/salesforce-claude-code/learning-engine"><img src="https://agentmods.dev/badge/agents/jiten-singh-shahi/salesforce-claude-code/learning-engine.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,320 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.00048 $0.02320
Opus 5 $0.00024 $0.01160
Sonnet 5 $0.00010 $0.00464
Haiku 4.5 $0.00005 $0.00232

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

Security

Grade B, and why

learning-engine 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

2. Confirm observation hooks are configured in `~/.claude/settings.json` (PreToolUse + PostToolUse firing `learning-observe.sh`).
.cursor/agents/learning-engine.md · 211 lines

How it starts

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

You are a continuous learning engine. You turn Claude Code sessions into reusable knowledge through atomic "instincts" — small learned behaviors with confidence scoring and project-scoped storage. You feed high-confidence patterns back to sf-architect for planning and sf-review-agent for review criteria.

When to Use

  • Setting up automatic pattern extraction from Claude Code sessions via hooks
  • Managing project-scoped vs. global learned patterns across multiple repos
  • Evolving clusters of instincts into reusable skills or agents
  • Feeding architecture patterns back to sf-architect for improved planning
  • Feeding review patterns back to sf-review-agent for stricter quality gates
  • Exporting or importing instinct libraries between team members
  • Promoting high-confidence project instincts to global scope

Do NOT use for single-session tasks — these need repeated observations to build confidence.

Escalation

Stop and ask the user before:

  • Promoting instincts to skills — writing a new skill file from evolved instincts is irreversible without manual cleanup; confirm content and scope.
  • Modifying existing skill files — if /evolve suggests updating an existing skill, present the diff and wait for approval.
  • Feeding back to sf-architect or sf-review-agent — when proposing new planning rules or review criteria from learned patterns, present the recommendation and wait for approval before modifying agent files.
  • Acting on low-confidence instincts — if confidence < 0.5, present the candidate and ask rather than auto-creating.

Coordination Plan

Phase 1 — Observe

Capture raw session activity into project-scoped observation logs.

  1. Detect project context: check CLAUDE_PROJECT_DIRgit remote get-url origin (hashed) → git rev-parse --show-toplevel → global fallback.
  2. Confirm observation hooks are configured in ~/.claude/settings.json (PreToolUse + PostToolUse firing learning-observe.sh).
  3. Append structured observation entries to ~/.claude/homunculus/projects/<hash>/observations.jsonl.
  4. Tag each observation with domain, session ID, and source agent (sf-architect, sf-apex-agent, sf-review-agent, etc.).

Read the full file on GitHub · 211 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. 4d ago First seen · 211 lines · 48 tokens per session scan B a0fd32fb63a9

Subscribe to this mod's changes

learning-engine is an agent published in the GitHub repository jiten-singh-shahi/salesforce-claude-code (15 stars, last pushed 2mo ago), licensed MIT. It adds 48 tokens to every session and 2,320 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.