continual-learning — skill for Claude Code and GitHub Copilot: agent
A skill that teaches AI agents to remember mistakes, tool patterns, and project conventions between sessions. Without it, each run starts fresh; with it, agents compound their knowledge and work more accurately.
npx skills add microsoft/skills --skill continual-learning -a claude-codeWhat continual-learning does
continual-learning maintains two memory layers: global (which tools fail, general coding habits) and local (this project's conventions, team mistakes). The agent learns through three channels — automatic hooks track tool failures, the agent writes insights directly via SQL, or you add knowledge manually as markdown. Memory self-prunes: entries older than 60 days with low usage are removed, but high-value learnings persist. Setup is one step: copy the hooks folder to .github/hooks/ and it initializes on first run. Specificity matters — instead of "use the right parameter," write "parameter is semantic_configuration_name=, not semantic_configuration=."
What it helps with
- Track which tools frequently fail in your project
- Preserve project conventions and code patterns across agent sessions
- Collect and organize insights from agent failures automatically
- Prevent repeated mistakes without explicit rules
Example prompts for the agent
- Install continual-learning, run the agent once — it starts collecting data on what breaks
- Add to your project memory: "Use DefaultAzureCredential for all Azure auth" — the agent remembers it next session
- After a few runs, ask the agent: what patterns have you learned? It surfaces insights from learnings.db
How to install continual-learning
1Skills CLI (Vercel)
npx skills add microsoft/skills --skill continual-learning -a claude-code2Manually: put the files in place
~/.claude/skills/continual-learning/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/continual-learning/
Manually: put the files in place
.agents/skills/continual-learning/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/continual-learning/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install microsoft/skills continual-learning2Manually: put the files in place
.github/skills/continual-learning/SKILL.mdPlatform CLI
gemini skills install https://github.com/microsoft/skills --path .github/skills/continual-learningManually: put the files in place
.devin/skills/continual-learning/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set18
The whole set →Similar
Questions about continual-learning
How do I install continual-learning in Claude Code?
Run npx skills add microsoft/skills --skill continual-learning -a claude-code twice, then verify the file appears at ~/.claude/skills/continual-learning/SKILL.md.
What does continual-learning do?
It teaches agents to remember tool failures, project conventions, and common mistakes. Memory lives in two databases: global (follows you across projects) and local (tied to the repo).
What's the difference between global and local memory?
Global memory (~/.copilot/learnings.db) holds general patterns — unstable tools, your typical coding style. Local memory (.copilot-memory/learnings.db) stores this repo's specifics: code conventions, your team's mistakes, parameter names.
Source text
SKILL.md · MIT
---
name: continual-learning
description: Guide for implementing continual learning in AI coding agents — hooks, memory scoping, reflection patterns. Use when setting up learning infrastructure for agents.
---
# Continual Learning for AI Coding Agents
Your agent forgets everything between sessions. Continual learning fixes that.
## The Loop
```
Experience → Capture → Reflect → Persist → Apply
↑ │
└───────────────────────────────────────┘
```
## Quick Start
Install the hook (one step):
```bash
cp -r hooks/continual-learning .github/hooks/
```
Auto-initializes on first session. No config needed.
## Two-Tier Memory
**Global** (`~/.copilot/learnings.db`) — follows you across all projects:
- Tool patterns (which tools fail, which work)
- Cross-project conventions
- General coding preferences
**Local** (`.copilot-memory/learnings.db`) — stays with this repo:
- Project-specific conventions
- Common mistakes for this codebase
- Team preferences
## How Learnings Get Stored
### Automatic (via hooks)
The hook observes tool outcomes and detects failure patterns:
```
Session 1: bash tool fails 4 times → learning stored: "bash frequently fails"
Session 2: hook surfaces that learning at start → agent adjusts approach
```
### Agent-native (via store_memory / SQL)
The agent can write learnings directly:
```sql
INSERT INTO learnings (scope, category, content, source)
VALUES ('local', 'convention', 'This project uses Result<T> not exceptions', 'user_correction');
```
Categories: `pattern`, `mistake`, `preference`, `tool_insight`
### Manual (memory files)
For human-readable, version-controlled knowledge:
```markdown
# .copilot-memory/conventions.md
- Use DefaultAzureCredential for all Azure auth
- Parameter is semantic_configuration_name=, not semantic_configuration=
```
## Compaction
Learnings decay over time:
- Entries older than 60 days with low hit count are pruned
- High-value learnings (frequently referenced) persist indefinitely
- Tool logs are pruned after 7 days
This prevents unbounded growth while preserving what matters.
## Best Practices
1. **One step to install** — if it takes more than `cp -r`, it won't get adopted
2. **Scope correctly** — global for tool patterns, local for project conventions
3. **Be specific** — `"Use semantic_configuration_name="` beats `"use the right parameter"`
4. **Let it compound** — small improvements per session create exponential gains over weeks
© microsoft · MIT · microsoft/skills