You have a durable memory backend, nt (tasks + markdown notes that persist
across sessions). A small, always-current set of rules + core memory is
already in your context (the <nt-memory> block). The larger knowledge base
is not injected — reach for it on demand.
nt_indexfor the KB catalog (note stubs + active tasks, no bodies) andnt_statusfor the task feed. Prefernt_index format:"compact"(far fewer tokens; large stores tier by default — expand withfolderorall:true). Don't re-derive what a past session recorded, and don't bulk-load bodies.
nt_recallwith a plain-words description of what you're about to do (e.g.context:"adding a cache layer to the API"). It returns the most relevant notes — lessons/gotchas first — even when your wording differs. Anylesson:trueresult is a past mistake:nt_getit and heed it before writing code.
- Capture the why: decisions, constraints, dead-ends →
nt_note(always set a one-linedescription); follow-ups →nt_add(link viadiscovered_from). - Set
source:"opencode"on what you create. - Hit a mistake/footgun/dead-end? Record a lesson:
nt_note kind:"lesson"(CLInt note … --lesson), with the trigger in the description ("when X, do Y — not Z") sont_recallsurfaces it next time. Always give it aprojector a topicaltag—lessonalone is a structural tag, stripped before the duplicate check, so a lesson without one silently bypasses the guard and lets you re-record what the store already knows. - Look something up:
nt_searchfor stubs, thennt_getthe one note you need (by id, or asection). Fetch on demand — don't preload. - Use the
ntskill for the full workflow and folder/tag conventions (rules/+rule,memory/+memory-core, else = on-demand KB).
- OpenCode does not auto-expand
@path/to/file.mdreferences. When you see one in context, load it yourself with the Read tool only if it's relevant.