{"slug": "self-learning-skill-for-claude-let-the-agent-capture-its-own-hard-won-patterns", "title": "Self-learning skill for Claude: let the agent capture its own hard-won patterns", "summary": "A new open-source meta-skill called 'self-learning' enables AI coding agents like Claude Code and Cursor to automatically capture and persist reusable workflows, commands, and project knowledge across sessions, preventing repeated rediscovery of hard-won patterns. The tool, available via the skills CLI, stores golden paths as skills or rules that auto-load in future sessions, while excluding secrets to avoid leaks.", "body_md": "**A self-improving skill for AI coding agents.** Works with Claude Code, Cursor,\nand any agent that reads an `AGENTS.md`\n\n/ standing-instructions file.\n\nEvery session you do hard debugging or rediscover the same thing — *how do I\nreach the prod DB? where do the creds live? what's the deploy command? how do I\nverify this live?* — and that hard-won knowledge evaporates when the session\nends. The next session starts from zero and re-learns it.\n\n**self-learning** fixes that. It teaches your agent to recognize the moment it\nhas just earned a reusable **golden path** and persist it where the tool will\nauto-load it next time — so the next session starts already knowing the route\ninstead of rediscovering it.\n\nIt's a *meta-skill*: it doesn't do the work, it captures **how** the work got\ndone — including the **failures**, since skipping a known dead-end next session\nis often worth more than the win itself.\n\n**Recognize the moment**— a task that only worked after several tries, a non-obvious command, a project fact you didn't know up front, an operational workflow likely to recur, or you simply saying*\"remember this\"*.**Capture it, no prompt needed**— it acts on the cue immediately, picks the scope/name itself, and tells you afterward. The*procedure*is captured (not a one-off answer), plus a \"what didn't work\" note.**Reuse**— next session the entry loads automatically, by skill/rule description or because the instructions file is always read.\n\nWhat differs per tool is only *where* knowledge is persisted and *how* it's\nauto-loaded:\n\n| Tool | Persists golden paths to | Auto-loads via |\n|---|---|---|\n| Claude Code / Agent Skills clients | a new `skills/<name>/SKILL.md` |\nskill description matching |\n| Cursor | a new `.cursor/rules/learned/<name>.mdc` |\nrule description / globs |\n| Codex, Zed, Aider, … | `AGENTS.md` (or project notes/memory) |\nalways-read instructions |\n\nUses the community [ skills](https://github.com/vercel-labs/skills) CLI, which\ninstalls into whatever agents it detects — Claude Code, Cursor, Codex, Cline,\nOpenCode, and more:\n\n```\nnpx skills add kulaxyz/self-learning-skills                 # this project (auto-detects agents)\nnpx skills add kulaxyz/self-learning-skills -g              # global — all your projects\nnpx skills add kulaxyz/self-learning-skills -a claude-code  # a specific agent\n```\n\nTry it once without installing:\n\n```\nnpx skills use kulaxyz/self-learning-skills --skill self-learning | claude\n/plugin marketplace add kulaxyz/self-learning-skills\n/plugin install self-learning@self-learning-skills\n```\n\n## Copy the files into place yourself\n\n```\ngit clone https://github.com/kulaxyz/self-learning-skills\n\n# Claude Code — global (or into a project's .claude/skills/ to share via git)\ncp -R self-learning-skills/skills/self-learning ~/.claude/skills/\n\n# Cursor — auto-loads .cursor/rules/ (harvested rules land in .cursor/rules/learned/)\nmkdir -p .cursor/rules\ncp self-learning-skills/.cursor/rules/self-learning.mdc .cursor/rules/\n\n# Any AGENTS.md agent (Codex, Zed, Aider, Gemini CLI, …)\ncurl https://raw.githubusercontent.com/kulaxyz/self-learning-skills/main/AGENTS.md >> AGENTS.md\n```\n\nIt won't bloat your config with one-liners. Each lesson is routed:\n\n| Lesson | Where it goes |\n|---|---|\nA multi-step, reusable procedure/workflow |\na new skill / rule |\nA single fact or one-line correction |\nlightweight notes/memory (e.g. a `MEMORY.md` ) |\nA genuine one-off |\nskipped |\n\nHarvested skills/rules get committed and shared, so this is built to **never\nwrite secret values** — no passwords, tokens, connection strings, or API keys.\nIt records only *where* to find a secret (env var name, a client/selector\nfunction, an MCP tool, a secret manager). Reproducing a secret into a shared\nfile leaks it.\n\n```\nself-learning-skills/\n├── AGENTS.md                          # generic, cross-tool version of the loop\n├── skills.sh.json                     # registry manifest for `npx skills` / skills.sh\n├── .claude-plugin/\n│   └── marketplace.json               # Claude Code plugin manifest\n├── skills/\n│   └── self-learning/                 # Agent Skills standard (Claude Code + clients)\n│       ├── SKILL.md                   # recognize-the-moment + harvest procedure\n│       ├── references/\n│       │   └── skill-authoring.md     # condensed spec the writer loads to author a good skill\n│       └── assets/\n│           └── SKILL.template.md      # fill-in template for harvested skills\n└── .cursor/\n    └── rules/\n        ├── self-learning.mdc          # Cursor adapter (always-applied rule)\n        └── learned/                   # harvested Cursor rules land here\n```\n\nBuilt on the open [Agent Skills](https://agentskills.io) standard.\n\n[MIT](/Kulaxyz/self-learning-skills/blob/main/LICENSE) © kulaxyz", "url": "https://wpnews.pro/news/self-learning-skill-for-claude-let-the-agent-capture-its-own-hard-won-patterns", "canonical_source": "https://github.com/Kulaxyz/self-learning-skills", "published_at": "2026-06-29 00:04:54+00:00", "updated_at": "2026-06-29 00:28:44.762895+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "machine-learning"], "entities": ["Claude Code", "Cursor", "Codex", "Zed", "Aider", "Gemini CLI", "skills CLI", "kulaxyz/self-learning-skills"], "alternates": {"html": "https://wpnews.pro/news/self-learning-skill-for-claude-let-the-agent-capture-its-own-hard-won-patterns", "markdown": "https://wpnews.pro/news/self-learning-skill-for-claude-let-the-agent-capture-its-own-hard-won-patterns.md", "text": "https://wpnews.pro/news/self-learning-skill-for-claude-let-the-agent-capture-its-own-hard-won-patterns.txt", "jsonld": "https://wpnews.pro/news/self-learning-skill-for-claude-let-the-agent-capture-its-own-hard-won-patterns.jsonld"}}