GaleDocs

Tools

Learnings

Gale saves corrections from your chats into one ranked, correction-gated store, injects the evergreen ones into prompts, and caps stores by eviction instead of compaction.

Learnings store

When Auto-learn from chats is on, Gale keeps a ranked store at ~/.gale/learnings/v2 — one JSON store per repo git root plus one Gale-wide global store. Extraction is correction-gated: only a turn with human pushback, a thumbs-down, a turn that errored, an abort with pushback or tool failures, a recovered tool retry roadblock, or a manual Learn from this chat saves notes. Recurring tasks, research subagents, and synthetic wake turns never pollute repo-wide learnings. The extractor follows a ban list (enforced both in prompt and deterministically): no code written during the turn, no file:line references, no specific source-file edit prescriptions, no one-off spec/review tasks, no bug symptoms or fix steps, no task state, nothing a git log already answers. Secrets stay redacted.

Every note carries a permanence class — preference, workflow, repo-convention, or fact — and sub-app notes carry a relative pathPrefix beneath git root. Universal personal preferences route automatically to the Gale-wide global store unless they name the repo or sub-app. A first sighting lands as a candidate: visible in Settings, not yet injected, and auto-pruned after 21 days if never re-sighted. Once the note is re-sighted enough times (Sightings to promote, default 2) or reinforced by ID, it promotes to active — or Auto-promote off keeps candidates waiting until you promote them manually. Manual Learn from this chat and thumbs-down notes skip the wait. Every note carries a tool tag, so Settings groups the list under tool headings with Promote, Graduate to rule, Move to, and Retire actions.

Stores are capped, not compacted: 30 active notes per workspace and 50 Gale-wide. Injection uses a two-tier context-aware selector ranked by Bayesian effectiveness rate (decayed applied + followed per injection, minus misleading penalty): Tier 1 carries always-on core preferences and repo-wide/matching-sub-app conventions (~1,200 chars, up to 6 notes), and Tier 2 fills the remainder up to 4K characters by combining token relevance, sub-app pathPrefix boost/dampening, tool match, and effectiveness. Non-manual notes injected 50+ times with zero applications or follows are excluded from prompts and auto-retired in Hybrid and Full auto cleanup.

A daily learning-finder pass (small model, up to 2 chunks per pass on oversized stores) retires, merges, or moves stale notes under your Nightly cleanup mode and checks recent git commits to retire already-shipped work: Prepare only stages every proposal for review, Hybrid also auto-applies the lossless ops — tool tags, moves between stores, zero-application retires, misleading retires, and decay retires of automatic never-followed notes not injected in 30 days — and Full auto applies everything. Retire and rewrite-merge proposals wait in Cleanup proposals for Apply or Discard. Retired notes are kept in the store, so a retire is reversible. Discarding a proposal keeps those notes as-is: cleanup stops re-proposing that change while the note text stays the same, and Reset kept notes clears those decisions.

First launch — or Rebuild now, the one-time migration in Settings — converts the legacy markdown stores into the ranked store: the old ~/.gale/learnings tree is archived as a tar backup, high-value Gale-wide notes are kept, the per-folder backlog is discarded, folder memory and any legacy learnings.md / roadblocks.md sidecars are imported, and the old cleanup review queue is cleared.

Select notes in the Inbox and use Promote to make candidates active immediately, Graduate to rule to write durable active notes into .gale/rules/ (auto-retiring the learning), Merge to combine notes in the same store, Dismiss to retire notes so they stop being injected, or Open PR to have a Build chat implement them in a new worktree.

Auto-learn from chats

booleanGale
Default
false
Location
Settings → Tools → Learnings
Storage
preferences.autoLearnFromChats

After a turn that was corrected — thumbs-down, abort, error, manual Learn from this chat, or detected pushback in your message — save reusable notes to Gale's learnings store at ~/.gale/learnings/v2. Clean turns extract nothing. A first sighting lands as a candidate (visible in Settings, not injected into prompts); a second sighting of the same note promotes it to active. Manual Learn from this chat and thumbs-down notes skip the wait. Notes follow a ban list: no code written this turn, no file:line references, no bug post-mortems, no task state, nothing git log answers. Off by default.

Auto-promote

booleanGale
Default
true
Location
Settings → Tools → Learnings
Storage
preferences.learningsAutoPromote

Promote a candidate note to active automatically once it hits the sighting threshold. Off keeps candidates waiting until you promote them manually from the Learnings pane; manual Learn from this chat and thumbs-down notes still land active immediately.

Sightings to promote

enumGale
Default
2
Location
Settings → Tools → Learnings
Storage
preferences.learningsPromoteThreshold
Values
1 · 2 · 3

How many times Gale must re-sight a candidate note before it promotes to active and starts being injected into prompts. 1 promotes on the first sighting (no candidate stage); 3 suits noisier extractors that over-save one-off notes.

Nightly cleanup

enumGale
Default
off
Location
Settings → Tools → Learnings
Storage
preferences.learningsCleanupMode

Daily learning-finder pass per store (small model): Off does nothing; Prepare only stages every proposal for review; Hybrid auto-applies the lossless ops (tool tags and moves between stores) plus the 30-day decay retire — automatic, never-followed notes not injected for 30 days — while staging retire and text-rewriting merge proposals for review; Full auto applies everything and logs a one-line summary. Retired notes are kept in the store, so a retire is reversible.

Auto-retire age

enumGale
Default
30
Location
Settings → Tools → Learnings
Storage
preferences.learningsAutoRetireDays
Values
30 · 60 · 90

How old a never-re-sighted candidate note must be (in days) before Hybrid nightly cleanup auto-retires it instead of staging a review proposal. Applies only in Hybrid; Prepare only always stages, and Full auto retires on the finder's judgment regardless of age.

Run cleanup now

actionGale
Default
—
Location
Settings → Tools → Learnings
Storage
~/.gale/learnings

Run the learning finder across all stores immediately under the currently selected mode. Staged proposals show up in the Cleanup proposals section with Approve / Discard. Discarding keeps the notes as-is — cleanup stops re-proposing that change unless the note text changes, and Reset kept notes clears those decisions.

Reset kept notes

actionGale
Default
—
Location
Settings → Tools → Learnings
Storage
~/.gale/learnings/review.json

Clear the keep-as-is decisions recorded when you discarded cleanup proposals. Only shows after a discard; resetting lets cleanup propose those notes again on the next run.

Rebuild learnings

actionGale
Default
—
Location
Settings → Tools → Learnings
Storage
~/.gale/learnings/v2/<git-root-hash>.json

One-time rebuild into the ranked, correction-gated store: backs up the old store as a tar, keeps the all-folders active notes plus heavily used notes, discards the rest of the backlog, imports folder memory and legacy sidecars, and clears the cleanup review queue. Notes carry a permanence class (preference, workflow, repo-convention, or reference-only fact); only the first three are injected.

Learnings store

stringGale
Default
~/.gale/learnings/v2
Location
Settings → Tools → Learnings
Storage
~/.gale/learnings/v2/<git-root-hash>.json

One ranked JSON store per repo git root plus a Gale-wide store. Notes are only extracted on correction events — thumbs-down, abort, error, manual Learn, or detected pushback in your message — never from clean turns. Stores hold at most 30 active notes per workspace and 50 Gale-wide; a new automatic note past the cap evicts the lowest-ranked never-followed note. Injection ranks followed notes first, then time-decayed uses, then recency, capped at 4K characters.

Promote

actionGale
Default
—
Location
Settings → Tools → Learnings
Storage
~/.gale/learnings/v2

Promote selected candidate notes to active in the v2 store so Gale begins injecting them immediately. Active notes also offer Graduate to rule to write a persistent .gale/rules/<slug>.mdc rule (glob-scoped to its sub-app path prefix when set) and retire the learning so it does not double-inject. Dismiss retires selected notes so they stop being injected. Candidates show a Seen pill with Promote; notes carry a tool tag so the list groups under tool headings, and selected notes from one store can merge into one. Move to moves a note between the Gale-wide store and a folder store.

Graduate to rule

actionGale
Default
—
Location
Settings → Tools → Learnings
Storage
.gale/rules/<slug>.mdc (or ~/.gale/rules/<slug>.mdc)

Convert an active learning into a permanent .mdc rule in .gale/rules/ (workspace notes, glob-scoped when the learning has a sub-app path prefix) or ~/.gale/rules/ (Gale-wide notes), mirror it to .cursor/rules/, and retire the original v2 note automatically.

Open PR

actionGale
Default
—
Location
Settings → Tools → Learnings
Storage
workspace .gale/worktrees/learn → gh pr create

Start a Build chat in a new gale/learn worktree for notes picked from the store. The agent implements them there and runs gh pr create. Does not write the current checkout's AGENTS.md; the notes stay in the store until you Promote or Dismiss them.