Agent skill
continual-learning
Guide for implementing continual learning in AI coding agents — hooks, memory scoping, reflection patterns. Use when setting up learning infrastructure for agents.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/continual-learning
SKILL.md
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 and initialize project memory (two commands):
cp -r hooks/continual-learning .github/hooks/
mkdir -p .copilot-memory && cp hooks/continual-learning/conventions.md.template .copilot-memory/conventions.md
Initialize the SQLite DB:
sqlite3 .copilot-memory/learnings.db "
CREATE TABLE IF NOT EXISTS learnings (
id INTEGER PRIMARY KEY AUTOINCREMENT,
scope TEXT NOT NULL,
category TEXT NOT NULL,
content TEXT NOT NULL UNIQUE,
source TEXT,
created_at TEXT DEFAULT (datetime('now')),
hit_count INTEGER DEFAULT 1
);
"
All azure-python-* agents load .copilot-memory/conventions.md and the DB automatically at the start of every session.
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:
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:
# .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
- One step to install — if it takes more than
cp -r, it won't get adopted - Scope correctly — global for tool patterns, local for project conventions
- Be specific —
"Use semantic_configuration_name="beats"use the right parameter" - Let it compound — small improvements per session create exponential gains over weeks
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?