Skip to content

refactor: simplify continual learning — single script, two-tier memory, auto-init#160

Merged
thegovind merged 1 commit intomainfrom
feature/continual-learning-v2
Feb 24, 2026
Merged

refactor: simplify continual learning — single script, two-tier memory, auto-init#160
thegovind merged 1 commit intomainfrom
feature/continual-learning-v2

Conversation

@thegovind
Copy link
Collaborator

Follow-up to #159. Redesigns the continual learning hook for simplicity.

What Changed

Before (v1): 3 separate scripts, 4-step install, flat memory, manual setup
After (v2): Single script, 1-step install, two-tier memory, auto-init

Install

cp -r hooks/continual-learning .github/hooks/

One step. Everything auto-initializes on first session.

Key Design Changes

Single Script

learn.sh handles all lifecycle events via argument — no multi-script complexity:

learn.sh sessionStart   → load learnings
learn.sh postToolUse    → track tool outcome (3ms)
learn.sh sessionEnd     → reflect, persist, compact

Two-Tier Memory

Scope Location Purpose
Global ~/.copilot/learnings.db Tool patterns — follows you everywhere
Local .copilot-memory/learnings.db Repo conventions — stays with the project

Compaction

  • Old low-value learnings decay (60-day TTL, low hit count)
  • High-value learnings persist indefinitely (ranked by hit_count)
  • Tool logs pruned after 7 days

Auto-Init

DBs and directories are created on first run. No manual mkdir, chmod, or setup steps.

Files Changed

  • hooks/continual-learning/learn.sh — new single script (replaces 3 scripts)
  • hooks/continual-learning/hooks.json — updated to call learn.sh with event args
  • hooks/continual-learning/README.md — concise, beads-style docs
  • .github/skills/continual-learning/SKILL.md — updated to match new design

…memory, auto-init

Redesign inspired by beads' invariants: one-step setup, zero config, structured data.

- Replace 3 scripts with single learn.sh handling all lifecycle events
- Two-tier memory: global (~/.copilot/learnings.db) + local (.copilot-memory/)
- Auto-initializes DBs and directories on first run
- Compaction: old low-value learnings decay (60-day TTL), tool logs pruned (7 days)
- Install is one step: cp -r hooks/continual-learning .github/hooks/
- Simplified README and SKILL.md to match
@thegovind thegovind merged commit f4d35f1 into main Feb 24, 2026
3 checks passed
@thegovind thegovind deleted the feature/continual-learning-v2 branch February 24, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant