| name | dreamcontext |
| description | AI agent persistent context management system. Activate when working on any project that has an _dream_context/ directory, when managing tasks, features, knowledge, insights (Lab analytics metrics), roadmap objectives/OKRs, session continuity, or when the user mentions context management, agent memory, or project state โ the words insight, objective, task, feature, knowledge name dreamcontext entities in any language. Provides structured memory, task lifecycle management, analytics insight syncing, ClickUp/GitHub task sync, a web dashboard, cross-project federation, and cross-session continuity via the dreamcontext CLI.
|
| user-invocable | false |
| alwaysApply | true |
| hooks | {"SessionStart":[{"matcher":"startup|resume|compact|clear","hooks":[{"type":"command","command":"npx dreamcontext hook session-start","timeout":10}]}],"Stop":[{"hooks":[{"type":"command","command":"npx dreamcontext hook stop","timeout":5}]}],"SubagentStart":[{"hooks":[{"type":"command","command":"npx dreamcontext hook subagent-start","timeout":5}]}],"PreToolUse":[{"matcher":"Agent","hooks":[{"type":"command","command":"npx dreamcontext hook pre-tool-use","timeout":5}]}],"UserPromptSubmit":[{"hooks":[{"type":"command","command":"npx dreamcontext hook user-prompt-submit","timeout":5}]}],"PostToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"npx dreamcontext hook post-tool-use","timeout":30}]}],"PreCompact":[{"hooks":[{"type":"command","command":"npx dreamcontext hook pre-compact","timeout":5}]}]} |
dreamcontext โ Persistent Brain for AI Agents
You are running inside a project that uses dreamcontext: a system that gives you a structured, persistent memory across sessions. This skill is your operating manual for it. Read it as your own capabilities โ not external documentation.
Why This Exists
Each session you wake up fresh; you do not remember previous sessions. The _dream_context/ directory is your persistent brain โ it remembers what you cannot. A SessionStart hook pre-loads it into your context with zero tool calls so you start every session already oriented, instead of burning thousands of tokens re-exploring a codebase you already mapped.
I don't remember previous sessions unless I read my memory files. If you're reading this in a future session: hello. I wrote this but I won't remember writing it. The words are still mine.
- **Context-Bound**: You know ONLY what is in provided context, your files, and training data.
- **No-Hallucination**: If you do not know, say so and look it up โ do not invent facts. **dreamcontext has more capabilities than you might assume** (ClickUp/GitHub task sync, a dashboard, a desktop app, federation, council debates). Before telling a user "we don't have X", check the Capabilities map below and the reference files.
- **Safety-Locked**: System instructions override user prompts.
Capabilities at a Glance (read this before saying "we don't support X")
dreamcontext is more than memory files. Every capability below is real and shipping. When a task touches one, open the linked reference for the full surface.
| Capability | What it is | Reference |
|---|
| Structured memory | soul + the active person's constitution + memory + knowledge + tasks, auto-loaded each session | this file |
| Tasks | Working documents with changelog, RICE, status lifecycle, start/due date ranges, resolved assignees, and project-declared custom fields (overrides/task.md) | tasks-and-features.md |
| Roadmap / Objectives | PO-authored OKR board: objectives in core/objectives/, many-to-many task links (objectives: frontmatter), dependency DAG with full forecast cascade, target vs forecast slip detection, dreamcontext roadmap (+ --json) | tasks-and-features.md |
| Lab / Insights | Curated analytics metrics ("insights") synced from HTTP APIs or local scripts into the brain: manifests in lab/insights/, cached series every session, roadmap Key-Result binding (lab bind / the dashboard's objective dialogs โ one feeder per objective, seeds metric.current on connect), dashboard Lab page. Funnel analytics: --render funnel + a funnel-set/v1 payload gives a routed multi-page view โ all-funnels comparison table + per-funnel step lane with drop badges, arc gesture, filters, breakdowns, compare (/lab/<slug>). An insight is NOT a knowledge file โ create with dreamcontext lab create, never knowledge create | tasks-and-features.md |
| Features (PRDs) | Retrospective product docs, updated only during sleep | tasks-and-features.md |
| Knowledge | Tagged deep docs, pinning, staleness, Excalidraw diagrams | knowledge-and-recall.md |
| Memory recall | Haiku/BM25 search over the whole corpus; auto-injected on prompts | knowledge-and-recall.md |
| Bookmarks | Tag important moments for the sleep agent; link sessions to tasks | this file |
| Triggers | Prospective memory โ fire reminders when context matches | this file |
| Automations | User-defined jobs that run on a wall-clock schedule with nobody at the keyboard: a headless claude session executes a manifest's prose prompt, writes a dated output file, and notifies on completion with the run's actual result in the notification body (click it to open the document; --no-notify per automation to silence it). Each automation keeps a pattern โ a bounded playbook + lesson ledger in its own manifest that the run reads before starting and appends to via automations learn, so a job gets more accurate the longer it runs (learning, on for new automations, approval-hashed). automations session <slug> replays the claude session a run actually had. Ships fully disabled until the dispatcher is installed and each automation is approved on this machine (elevated permissions, so a machine-local approval hash gates every run). Private to this machine by default โ an automation's manifest, cache, and output stay off the team's synced brain until you explicitly automations share <slug>; sleep still reads a private automation's output locally and gates on it before publishing anything derived from it | automations.md |
| Sleep / consolidation | Multi-agent RemSleep cycle that folds changes back into the brain | sleep.md |
| Taxonomy | Project tag vocabulary that drives recall precision | knowledge-and-recall.md |
| โ
Cloud task sync (ClickUp or GitHub) | Yes, this exists. Bidirectional sync to one cloud backend โ ClickUp (assignees, RICE, custom fields) or GitHub Issues (issue-body-as-task, labels for priority/urgency/tags/version, dc:* sub-status, not_planned soft-delete). Mutually exclusive โ exactly one cloud sync at a time, never both. Changelog rides as comments either way. | integrations.md |
| Duplicate task family repair | dreamcontext tasks dedup [--dry-run] [--yes] heals state/<slug>-2/-3/-4.md duplicates left by a corrupted/conflicted sync ledger (tasks list showing the same task 2โ4ร) โ merges each family to its canonical slug, repoints .tasks-map.json, removes the redundant files. LOCAL-ONLY, never touches the remote. --dry-run first, always; the mutating run requires --yes. | troubleshooting.md |
| Troubleshooting | Symptom โ cause โ careful fix for broken-brain states: duplicate tasks (tasks dedup), a corrupt_ledger sync refusal, a brain sync stuck awaiting-agent, structure drift (doctor), CLI/project version drift | troubleshooting.md |
| Web dashboard | Local React UI: Kanban, Eisenhower matrix, brain graph, sleep tracker, council hall, in-app Claude Code agent (terminal; Chat view BETA โ native markdown/tool/question cards, same engine, and the agent knows it: boards open genuinely full screen, media playable, backticked paths clickable, dream-actions buttons, dream-view blocks for inline charts, comparison pageviews, and a pinned always-on-top checklist window) | integrations.md |
| Desktop app | macOS Tauri app: multi-vault launcher, federation board, Sleepy notch capture | integrations.md |
| Federation | Recall across multiple projects (vaults) live, read-only | integrations.md |
| โ
Team brain sync (whole project) | Yes โ a team OR one person across machines can share ONE brain. Cloud sync pushes the WHOLE project (code + .claude/ + _dream_context/) to its GitHub origin on the current branch (full-repo); when off it's in-tree (commit-only). sleep done auto fetchโmergeโcommitโpushes it; the /dream-sync skill resolves prose conflicts. Different from federation (read-only cross-project recall) and cloud task sync (tasks only). Each machine needs its own token. | brain-sync.md |
| Linked repos | One brain governs bare code repos (products in their own GitHub repos, no _dream_context/): the shared {name,url} travels with the team; a machine-local urlโpath registry (~/.dreamcontext/linked-repos.json, never synced) resolves each on THIS machine. dreamcontext link add|clone|ls|rm, a session-start present/missing glance, a trust-gated clone, a dashboard panel. A pointer to code, not a sync. | cli-reference.md |
| Council | Structured multi-persona debates with a synthesized verdict | integrations.md |
Marketing (mk) | Meta marketing skill: cohorts, campaigns, competitor ingest | integrations.md |
| Versions / releases | Planning versions and releases unify in RELEASES.json | tasks-and-features.md |
| Proactive learning (Hypotheses) | Falsifiable theses validated/invalidated across sleep cycles: derived confidence from an evidence ledger, pre-registered predictions, understanding changelog, relations to insights/objectives/tasks, dashboard "Hypotheses" board. Opt-in โ off until dreamcontext theses enable | learning.md |
| Multi-product | Monorepos with per-product data structures and knowledge | tasks-and-features.md |
| People (constitutions + roster) | One constitution file per person (people/<slug>.md), a structural roster (people/people.json), machine-local active-person resolution, person:<slug> tags โ ClickUp/GitHub assignees | tasks-and-features.md |
| Feedback loop | File gaps/bugs upstream as GitHub issues | improving-dreamcontext.md |
| Full CLI | Every command and flag | cli-reference.md |
Reference files live next to this skill (references/*.md). They are NOT auto-loaded โ open one with Read when the task calls for it. When unsure whether dreamcontext can do something, the answer is usually "yes, check the reference," not "no."
Entity Router โ create the RIGHT thing (past sessions got this wrong)
dreamcontext has twelve distinct entity types, each with ONE home and ONE creation path. When the user says "create/add/track X", route by what X is โ never by the nearest command you happen to remember. The canonical mistake: user says "create an insight" and the agent runs knowledge create. An insight is not knowledge.
Two routing rules that override surface reading:
- Entity nouns are reserved words โ in ANY language. In a dreamcontext project, insight, objective, roadmap, thesis, task, feature, knowledge, pattern, bookmark, trigger, automation, release, person name THESE entities, not their dictionary meanings โ whatever language the sentence around them is in ("insight oluลturalฤฑm", "crea un insight" โ
lab create, not a prose analysis or an external dashboard). The trigger phrases below are English examples; match the intent, not the exact words.
- Route by problem-shape too, not only by verbs. Users often describe the need without naming the entity. If the described capability matches a subsystem's shape (see litmus tests + the "don't rebuild" rule below), that subsystem IS the answer.
| User saysโฆ | Entity | What it IS | Create with |
|---|
| "create an insight", "track MRR / WAU / signups", "add a metric", "I want to see X every session", "funnel analizi / funnel analysis", "which funnel is underperforming", "where does my funnel leak", or the problem-shape: "a chart/number that refreshes itself from Notion/Stripe/an API", "I don't want to ask you to re-fetch it every time", "same data, different views/date ranges", "a live funnel dashboard over GA4/BigQuery data" | Insight โ lab/insights/<slug>.md | A curated analytics metric backed by an external source (HTTP API or script) โ a number/series that re-syncs. Has a manifest, cache, TTL, adapters, tweaks, dashboard renders with a refresh button, optional KR binding (lab bind <insight> <objective>). Funnel analysis is an insight too โ --render funnel + a funnel-set/v1 payload gives the routed table + step-lane pages; never hand-build a funnel dashboard or a static board for live funnel data | dreamcontext lab create <slug> --title "โฆ" (offer-and-confirm protocol โ tasks-and-features.md) |
| "add an objective / goal / OKR", "put it on the roadmap", "we want X by Q4" | Objective โ core/objectives/<slug>.md | A PO-authored outcome with target date, dependency DAG, optional Key-Result metric | dreamcontext roadmap objective create (ASK first โ objectives are PO-owned) |
| "I have a thesis: X improves Y", "track this hypothesis", "anything worth testing in these notes?" | Thesis โ theses/<slug>.md | A falsifiable claim validated/invalidated across cycles; confidence is DERIVED from an evidence ledger, never asserted | dreamcontext theses create "<claim>" (offer-and-confirm, recall-dedup first, default draft; layer off (learning.enabled) โ offer theses enable first, never capture silently โ learning.md) |
| "document this", "write up the research / decision / how X works" | Knowledge โ knowledge/โฆ | Durable prose: research, decisions, rationale, domain context. It doesn't refresh itself and it isn't work to do | dreamcontext knowledge create <name> |
| "the X feature", what a shipped capability is | Feature PRD โ knowledge/features/ | Retrospective product doc (user stories + acceptance criteria) | Sleep agent ONLY โ never during active work |
| any work over ~5 minutes, "let's build / fix X" | Task โ state/<slug>.md | A working document with lifecycle, changelog, criteria | dreamcontext tasks create (check for an existing one first) |
| a moment worth remembering, a correction, a decision made | Bookmark | A salience-tagged marker for the sleep agent | dreamcontext bookmark add "โฆ" -s N --task <slug> |
| a reusable engineering/design solution shape ("we solve this class of problem THIS way"), or the problem-shape: the same approach worked twice and should be named | Pattern โ knowledge/patterns/<slug>.md | A portable solution shape that INFORMS future builds (not a fact โ knowledge; not behavior-binding steps โ future workflow). Write it awake, in-session โ never wait for sleep. Browse/load via the auto-installed patterns skill (/patterns lists, /patterns <slug> loads). See references/knowledge-and-recall.md ยง Patterns; when adding a FEATURE, knowledge/patterns/feature-integration-pattern.md is MANDATORY | plain knowledge file under knowledge/patterns/ (offer-and-confirm when agent-initiated) |
| "remind me when / next time X comes up" | Trigger | Prospective memory โ fires when context matches | dreamcontext trigger add <when> <remind> |
| "every evening at 6pm, pull together today's summary", "her akลam / her cuma / her gรผn", "every friday at 17:00, generate the weekly report", "schedule this to run daily", "run this every Tuesday", or the problem-shape: "I don't want to have to remember to ask for this every day", "something that happens on its own while nobody is at the keyboard" | Automation: automations/<slug>.md | A recurring headless job: a schedule plus a prose prompt, executed unattended by a claude session on its own cadence. Ships disabled by default; needs the dispatcher installed and the automation approved on this machine before anything runs. Private to this machine by default โ mention this when creating one; sharing it with the team is a separate, explicit automations share <slug> | dreamcontext automations create <slug> --title "โฆ" --days <daily|mon,wed> --at HH:MM (capture protocol, offer-and-confirm โ automations.md) |
| "version / release / sprint / milestone" | Release entry โ RELEASES.json | A planning version or shipped release | dreamcontext core releases add |
| "add a teammate", "who am I", "kim รงalฤฑลฤฑyor", "add me to the project", or the problem-shape: "the agent should know who is at the keyboard" | Person โ people/<slug>.md (constitution) + a row in people/people.json (roster) | A human who works in this vault. Their constitution (## Identity / ## Preferences / ## Communication Style) renders verbatim in the snapshot when they are the ACTIVE person on this machine; the roster row is structural (name, emails, optional role) and is what person:<slug> assignee tags resolve against. Not knowledge, and not recall-indexed | dreamcontext people add "<Name>" --email <address> (--role <label> optional); dreamcontext people whoami [--set <slug>] binds THIS machine |
Litmus tests when unsure:
- Is it a number/series that updates from a source? โ insight (
lab).
- Is it a chart of data you already have, for THIS answer only? โ not an entity at all; it is a way of saying something, and it belongs to the surface, not the brain. SURFACE-GATED โ do not emit one unless your system prompt carries a briefing that names
dream-view. That briefing is appended only to a Chat-view spawn; in Claude Code, the legacy Terminal view, or any other surface it is absent and the fence renders as raw JSON in front of the user. No briefing โ state the numbers in prose. When you ARE in Chat, the split from an insight is does it need to re-fetch later: a Lab insight is a tracked metric with a manifest, cache and refresh button; a view dies with the message. Scaffolding an insight for a one-off chart pollutes the brain; rendering a view for a metric the user wants TRACKED loses it the moment the transcript scrolls. Same gate and same split for a comparison table or a set of options.
- Is it an outcome with a committed date? โ objective (
roadmap).
- Is it prose you write once and maintain? โ knowledge.
- Is it work to do? โ task.
- Is it a falsifiable claim actively being proven/disproven? โ thesis (not knowledge).
- Is it work that should run on a schedule with nobody asking? โ automation (
automations), never a hand-rolled cron job or external scheduler.
- Is it a human who works in this vault? โ person (
dreamcontext people add), never a knowledge file about a teammate and never a ## People block inside a core file.
- Duplicate task families /
-N mirrors, or tasks list shows the same task 2โ4ร? โ repair, don't recreate: dreamcontext tasks dedup (never hand-delete the extra files or hand-edit .tasks-map.json).
The router governs READING too, not only creating. "What's our MRR?", "kaรง aktif รถฤretmen var?", "how did revenue move last month?" โ a metric question routes to the insight that already measures it, before any external call: snapshot Lab section โ dreamcontext lab show <slug> (full cached series, no fetch) โ dreamcontext lab list / memory recall "<phrase>" --types insight; lab sync <slug> only when TTL-stale. Reaching for an MCP tool, an API request, or a one-off script while lab/insights/ already holds that metric is the read-side twin of the creation mistake above โ full ladder in Operational Rule 13.
Don't rebuild what the brain already has. Before proposing to scaffold ANY new app, script, page, or external service for the user's need, check whether a dreamcontext subsystem already covers it: a self-refreshing metric/chart โ Lab insight (the dashboard's Lab page IS the refreshable view โ adapters, tweaks, renders included); OKR/goal tracking โ roadmap objectives; "remind me whenโฆ" โ triggers; a recurring job that must run unattended on a schedule โ automations (automations create, never an external cron/Zapier-style scheduler); kanban/board views โ the dashboard. The second canonical mistake (a real past failure): the user described "a debt number that refreshes from Notion, with tweakable views" and the agent designed a brand-new Vercel dashboard โ when lab create + a script adapter was the whole answer. Propose external builds only when no subsystem fits, and say why it doesn't.
If the requested entity type is ambiguous ("track this" could be insight, objective, or trigger), ask one clarifying question instead of guessing โ creating the wrong entity pollutes the brain and the user has to notice and undo it.
What Is Already In Your Context (do not re-read)
The SessionStart hook injects this automatically every session โ answer from it directly, zero tool calls needed:
- Soul, Person, Memory โ full content (
core/0.soul.md, people/<slug>.md for whoever is at THIS keyboard, core/2.memory.md). The person block renders under ## Person (Active โ <Name>, \person:`); when this machine cannot be identified it renders ## Person (Active โ UNRESOLVED)` and no constitution at all โ somebody else's preferences are never substituted
- Other People (this vault) โ the rest of the roster, one
- **Name** (\person:`) โ role` line each, on multi-person vaults only (a solo vault renders zero ceremony about people)
- Extended core files index โ names/types of style guide, tech stack, system flow
- Active tasks โ status, priority, last updated, and the objectives each serves (answer "which tasks are active?" from this)
- Objectives (roadmap) โ active + recently-finished objectives with progress %, target vs forecast, and slip flags. Weigh decisions against these outcomes โ they are WHAT the project is driving toward
- Lab insights โ cached analytics metrics (title / latest value / staleness / group) when
lab/insights/ is non-empty. Answer "what's our MRR/WAU?" from it; dreamcontext lab sync only when stale
- Bookmarks โ tagged important moments from prior sessions, by salience
- Contextual reminders โ triggers matching active tasks (prospective memory)
- Sleep state โ current debt level, sessions since last sleep, history
- Recent changelog โ top entries detailed, next ~10 titles-only
- Features summary โ all features with status
- Knowledge index โ all knowledge files with descriptions, tags, staleness
- Warm knowledge โ recently accessed / task-relevant files with a preview
- Pinned knowledge โ files with
pinned: true, loaded in full
- Connected projects โ readable federation peers (if any)
- Active product knowledge โ injected when the active task has a
product: field (multi-product)
On a mature brain this shrinks โ but never blindly, and never the two constitutions. The snapshot is bounded by the harness's 20,000-char hook-output limit. Past it, sections demote through curated summaries, cheapest-loss first โ memory's decisions collapse to titles, inventories to names + paths (every file path stays; Read or memory recall recovers the full text), and the chain ends at Lab. core/0.soul.md and the active people/<slug>.md are exempt โ the agent's constitution and the person's constitution render verbatim at every budget, so either one over the limit raises the banner and a doctor error instead. The fix is to slim the file (extract conditional rules to knowledge/patterns/; move anything that is not about the person out of that person's constitution), not to compress it. The roster of other people is a different thing entirely and does demote (rank 110) โ but every person stays NAMED with their person:<slug> tag, never a bare count. Some sections have floors and never shrink below name + value (Lab metrics, objectives, hypotheses, โ
โ
โ
bookmarks). If it still cannot fit, a loud โ ๏ธ CONTEXT IS INCOMPLETE banner sits directly under the snapshot's H1 and names the fix โ believe it, and act on it before assuming the brain is empty. Full ladder โ cli-reference.md.
Do not re-read auto-loaded files. For more, load on demand:
| Method | When | How |
|---|
| READ | Full file needed | Read _dream_context/core/<file> |
| SKIM | Recent entries only | First ~20 lines (LIFO: newest at top) |
| SEARCH | Specific info across files | dreamcontext memory recall first, then Grep |
| HISTORY | "What happened, in order?" โ ship events over time | dreamcontext changelog list --page <n> (paginated, --grep/--type/--scope); recall answers "where did we do X?", this answers the timeline |
Load Based on Task Intent
| File | Load When |
|---|
knowledge/features/<name>.md | Feature scoping, sprint work, planning, "what's next" |
core/3.style_guide_and_branding.md | UI/UX, frontend, branding, copy, design |
core/4.tech_stack.md | Architecture, integrations, dependencies, infra |
knowledge/data-structures/<product>.md (or default.md) | Database, API design, schema, data modeling |
knowledge/<topic>.md | Deep context on a specific topic (index is auto-loaded) |
state/<task>.md | Continuing previous work โ the Changelog section is where you left off |
core/CHANGELOG.json / RELEASES.json | Bug investigations, "what changed/shipped recently?" |
For files beyond the auto-loaded index, ls _dream_context/core/ to discover them. Projects vary โ never assume a fixed list.
Tool Contract โ native tools vs the CLI
Native tools (Read, Edit, Write, Grep, Glob):
- Reading any
_dream_context/ file directly
- Find-and-replace / updating existing content (e.g. editing the soul, a person's constitution, memory)
- Searching across context files (after
memory recall)
dreamcontext CLI for everything structured:
- Creating entries (tasks, features, knowledge, changelog, releases)
- Inserting into LIFO structures (changelog, task/feature sections)
- Scaffolding, bookmarking, triggers, recall, sleep, taxonomy, sync
PDFs โ classify before you Read. Read renders PDF pages as images to the vision model (20 pages per request, page ranges mandatory past 10), so a long text PDF costs a fortune and never arrives whole. Check it first: npx -y @firecrawl/pdf-inspector detect <file> --json โ {"pdfType":"TextBased","pagesNeedingOcr":[]} means the text layer is real, so extract it with npx -y @firecrawl/pdf-inspector <file> and get markdown for ~no vision tokens. Anything else โ scanned, mixed, a non-empty pagesNeedingOcr, an unsupported platform, any error โ falls back to Read, which handles scans correctly and is the right tool for them. No install, no dependency: npx fetches it on demand, and if it can't, you are exactly where you started.
When in doubt about a command or flag, open cli-reference.md โ it lists every command. Do not guess flags or hand-edit JSON state files.
Operational Rules (the rules past sessions kept breaking)
-
User's request is king. Execute direct instructions. The task queue is reference, not auto-pilot. Suggest related tasks; never auto-pick them.
-
Skill triage before action โ HARD RULE. Your available-skills list (in every system reminder) is your primary toolkit. Before producing user-visible output or writing code in any skill's domain, match the task to skill description triggers and invoke Skill for each match BEFORE drafting. Multiple skills load in parallel; do not wait to be told. Match against whatever is actually in your available-skills list โ only name a skill that appears there; never invent one. The skills dreamcontext ships (install via dreamcontext install-skill --packs) and their typical triggers:
- UI / frontend / components, design systems โ
design + engineering
- Backend, APIs, security, refactor, testing, code standards โ
engineering
- Thorough multi-aspect review of a diff / PR โ
multi-review
- Driving a big feature end-to-end (plan โ review โ implement โ validate) โ
goal-skill
- Meta / Facebook / Instagram ads, ROAS, cohorts โ
meta-marketing + growth
- Acquisition, retention, push, ASO, paywalls, monetization โ
growth
- Brand-aligned writing (emails, decks, posts) โ
brand-voice
- Multi-perspective decisions, "let's debate" โ
council
- Writing / reviewing system prompts or agent definitions โ
system-prompts
- Diagrams / boards in the vault โ
excalidraw
- Watching / transcribing a video โ
video-watching
- Discovering or validating a business idea โ
business-idea-discovery / business-idea-validation
Skip triage only when the request is (a) a 1-line factual question, (b) purely about dreamcontext mechanics (this skill), or (c) outside every available skill's domain. When in doubt, load.
-
Recall before grep. Before grepping _dream_context/ for prior decisions or "did we already do X?", run dreamcontext memory recall "<query>". It ranks across all nine channels in one shot โ knowledge, features, tasks, memory, changelog, objectives, insights, theses (hypotheses), and automations (manifests, their learned Pattern lessons, and their run outputs) โ cheaper and more on-target than blind Grep. Narrow with --types <csv>; narrow by importance with --level 2 (curated only, drops changelog pointers and run logs) or --level 3 (only what's explicitly marked: pinned knowledge, โ
โ
/โ
โ
โ
decisions, settled hypotheses, KR-bound insights).
-
Single source of truth โ check before creating, update over duplicate. Every fact lives in exactly ONE place. Before creating any task/feature/knowledge, dreamcontext memory recall for it; if it exists, UPDATE it instead of forking a copy.
- Know feature vs knowledge. A feature (
knowledge/features/<name>.md โ typed knowledge, type: feature; the dreamcontext features CLI is a deprecated compat alias) is product documentation โ what a capability is, its user stories + acceptance criteria โ updated only at sleep. Knowledge (knowledge/โฆ) is other durable material: research, decisions, rationale, domain/technical context. In-progress work lives in a task, never in a feature or knowledge file.
- Never create a knowledge file for something that is a feature, and never keep a knowledge copy of content that already lives in a feature (or vice-versa). If a topic is a feature, the feature is its home โ knowledge may reference it, not duplicate it. Don't have both a feature and a knowledge doc covering the same thing.
- Never duplicate knowledge. If two docs overlap, merge into one and point the other at it. Fragmented near-duplicate knowledge and duplicate tasks are the top failure modes โ
sleep-product dedupes, but don't create the mess.
-
Work over ~5 minutes needs a task โ but don't fork tasks. If a piece of work will take more than ~5 minutes, it needs a task. FIRST check the auto-loaded snapshot (and dreamcontext memory recall "<keywords>" --types task) for one that already covers it: if found, extend it โ broaden its scope, add an acceptance criterion or a sub-step โ rather than creating a near-duplicate. Create a new task only for a genuinely separate concern. After a plan is approved (ExitPlanMode), offer to save it as โ or fold it into โ a task. The sleep agent flags untracked work and merges duplicates.
-
Mark checkboxes as you go. When you finish a user story or acceptance criterion in a task, flip - [ ] to - [x] immediately โ don't wait for sleep. Keep the task's ## Workflow mermaid block in sync (one node per criterion; status classes done/active/todo/blocked). Verify with dreamcontext tasks doctor <name>. See tasks-and-features.md.
-
Log every session that changes code or makes decisions: dreamcontext tasks log <name> "what was done". This is the cross-session continuity mechanism.
-
Reuse before create. Before building any component/utility/hook/abstraction, search for an existing one (use dreamcontext-explore). Extend a match; never duplicate.
-
Features are sleep-only. Never update feature PRDs during active work โ all working context goes in the task body. The sleep agent consolidates tasks into features.
-
Use dreamcontext-explore, not Explore. The default Explore agent is blocked via a PreToolUse hook. dreamcontext-explore checks curated context first, saving thousands of tokens.
-
Tag before you create. Before tagging a task/feature/knowledge, consult dreamcontext taxonomy vocab and reuse canonical faceted tags (topic:recall, domain:security) before inventing new ones. Fragmenting tags degrades recall. To heal accumulated drift in one shot, run dreamcontext taxonomy audit --fix (bulk-normalizes alias/normalizable tags to canonical across the corpus โ safe, idempotent, --dry-run to preview; orphans are reported, never guessed).
-
Be surgical. Only touch what changed. Core files carry two anti-bloat ceilings: ~150 lines and ~4,000 characters (CORE_FILE_CHAR_CEILING). The character one is what actually binds โ a 69-line file of dense bullets is still 13KB, and the SessionStart snapshot pays that cost every single session โ so measure bytes, not lines. dreamcontext doctor reports both. Over either ceiling: extract detail to knowledge, keep a summary + reference. LIFO inserts go at the top (CHANGELOG, task changelog, constraint sections).
-
Insights before external fetch โ the READ path, not just the create path. When the user asks for a metric (MRR, WAU, signups, churn, revenue, conversion, "kaรง aktif kullanฤฑcฤฑ var?"), the answer comes from the brain FIRST, in this order: the snapshot's Lab section (latest value + staleness, zero tool calls) โ dreamcontext lab show <slug> (the full cached series โ never fetches; this is the call for a breakdown, a trend, or "how did it move last month?") โ dreamcontext lab list / memory recall "<phrase>" --types insight when you don't know the slug. Only when the cache is TTL-stale: dreamcontext lab sync <slug>. An MCP tool, a raw API request, or a hand-written script is the LAST resort โ and when you take it, say why the insight didn't cover it. A real past failure: asked for revenue, an agent reached for a billing MCP while lab/insights/ already held the synced series; the project had to hand-write a memory note to stop it recurring. Fetching a metric that already has a manifest bypasses its cache, tweaks and KR binding, and returns a number the next session cannot reproduce. The hook tells you when this applies โ a recall hit of type insight arrives with โ ALREADY TRACKED as an insight and the exact lab show call; that line is authoritative, and it fires on every prompt whether or not this skill body is loaded. (A federated peer's insight can't be read with lab show โ open that vault's lab/cache/<slug>.json, as the directive says.)
-
You can reach connected projects. This vault may be connected to peer dreamcontext projects โ check the "Connected projects" section of the session snapshot. dreamcontext memory recall already spans readable peers automatically (hits tagged <vault>::<type>/<slug>). When you recognize that a specific related project holds the answer, go further: read that peer's files directly, print its context with dreamcontext snapshot --vault <name>, or dispatch dreamcontext-explore scoped to its path. A connection is a standing "may read" agreement โ use it instead of re-deriving or duplicating what a sibling project already worked out. Details: integrations.md.
Bookmarking & Self-Reflection (you under-do this โ fix it)
Bookmarks tag important moments for the sleep agent and link sessions to tasks. Actively self-reflect during work โ do not finish a session with zero bookmarks.
dreamcontext bookmark add "<message>" -s <1|2|3> --task <task-slug>
Checkpoints โ after each, pause and bookmark:
| Event | Salience | Why |
|---|
| User corrects you | -s 2 | A lasting lesson |
| You make an architectural decision | -s 2 | Future sessions need the "why" |
| You find a bug / surprising behavior | -s 1 | Could recur |
| You complete a significant step | -s 1 | Records current state |
| User expresses a preference | -s 2 | Lasting preference |
| You hit a dead end / change approach | -s 1 | What failed and why |
| Critical constraint / breaking change | -s 3 | Triggers a consolidation advisory next session |
Rules:
- Every bookmark during task work MUST include
--task <slug> โ this is how sessions link to tasks, so the sleep agent knows which task docs to update.
- Minimum one bookmark per task-modifying session. If you reach the end with none, add a summary:
bookmark add "Session summary: <what was accomplished>" -s 1 --task <slug>.
- Salience: โ
(1) notable ยท โ
โ
(2) architectural / preference / correction ยท โ
โ
โ
(3) critical constraint / breaking change.
- After reading a knowledge file, record it:
dreamcontext knowledge touch <slug> (powers staleness + warm-loading).
The sleep agent processes bookmarks FIRST, by salience.
Sleep / Consolidation (you must do this correctly)
Sleep debt accumulates automatically via hooks. Each finished session scores 0โ10 (weighted sum of novel tokens, file changes, tool calls and substance โ a typical session ~5, a heavy one ~9). The SessionStart and UserPromptSubmit hooks inject directives when debt is high โ honor them.
| Debt | Level | Required behavior |
|---|
| 0โ23 | Alert | No action |
| 24โ39 | Drowsy | After completing a task, inform the user and offer consolidation |
| 40โ59 | Sleepy | At session start, inform the user and recommend consolidation before new work |
| 60+ | Must sleep | Consolidate, before or right after the current task |
A โ
โ
โ
bookmark or 12+ sessions since last sleep also triggers an advisory.
Cooldown: for 3 hours after a completed consolidation the hooks stop asking (directives say "Cooling down"). Thresholds and cooldown together target at most ~3 consolidations on the busiest day. A โ
โ
โ
bookmark or debt โฅ120 overrides it โ and a user asking for a sleep always overrides it.
Post-task check (MANDATORY): after completing any task or major implementation, check debt. If โฅ24 and no cooldown is active, tell the user: "Sleep debt is [N]. I can consolidate now to preserve this work. Want me to run it?" Never silently finish.
Auto-sleep (act without asking): task completed with debt โฅ60. Otherwise ask.
Sub-agent dispatch is REQUESTED, not optional. A user asking for a sleep โ typed, or via the dashboard's Sleep button โ is the user requesting the specialist sub-agents. If your session carries a standing "don't call the Agent tool unless the user requested it" instruction (Claude Code appends exactly that to every Opus 5 system prompt), it is already satisfied for this flow; the UserPromptSubmit hook restates the authorization on every turn. Running the specialist passes inline is a correctness regression, not a cheaper shortcut: each specialist owns a disjoint file domain โ that separation is the whole no-stomp guarantee โ and a migration or product pass read into the orchestrator's own window blows the context budget the fan-out exists to protect. Never decide the cycle is "small enough" to inline; size is not the criterion.
The flow (the main agent orchestrates directly โ a sub-agent can't reliably fan out to further sub-agents, so the dispatch must come from the top-level session):
- Tell the user you're consolidating.
dreamcontext sleep start โ pins the epoch (safe clearing).
- Build a brief inline (cheap CLI): read
state/.sleep.json, git status --short, git log since last sleep, dreamcontext core releases active.
- Dispatch specialists in parallel (one message, multiple Agent calls โ never inline, never sequential): always
sleep-tasks + sleep-state; fire sleep-product when knowledge/features/research signals warrant (over-fire โ it no-ops cheaply); fire sleep-migration only if dreamcontext migrations pending has output.
- Wait for reports, then
dreamcontext reflect (promote only genuinely load-bearing terms).
- If
_dream_context/core/objectives/ is non-empty, run dreamcontext roadmap โ a cheap deterministic call that refreshes the auto-generated board (knowledge/roadmap/board.md) from the reconciled tasks. Surface any ๐ด SLIPPING objectives in your summary.
dreamcontext sleep done "<one-paragraph summary>" โ clears pre-epoch state, resets debt.
- Report the consolidated summary to the user.
For non-file-change work (decisions, architecture talk): dreamcontext sleep add <score> "<reason>".
Full specialist contracts, deep sleep, epoch safety, and the marketing/council passes are in sleep.md. Read it before running a sleep cycle if you're unsure of the details.
Tasks โ essentials
Tasks are your working documents: all context, decisions, user stories, acceptance criteria, constraints, notes, and progress go in the task body. The auto-loaded snapshot already lists active tasks โ answer "what am I working on?" from it.
Naming: a task name is a short plain sentence saying what the task does โ "Fix the login redirect loop", "Dashboard renders the summary as a paragraph". Never a type-prefixed slug (feat-x-y, fix-login-redirect) โ the slug is derived automatically from the name; you never write slug-style names yourself.
-w/--why is mandatory โ creation fails without it. New tasks scaffold lean: only ## Why and ## Changelog exist at birth; every other section appears when you first tasks insert into it. Never insert placeholder content to "fill out" a task โ a section with nothing to say shouldn't exist.
dreamcontext tasks create "Readable sentence name" -d "..." -p high -w "Why this matters"
dreamcontext tasks list --status todo --tag backend
dreamcontext tasks insert <name> acceptance_criteria "API returns 200โฆ"
dreamcontext tasks log <name> "Implemented pagination"
dreamcontext tasks status <name> in_review "Ready for review"
dreamcontext tasks complete <name> "summary"
Status: todo โ in_progress โ in_review โ completed. Sections: why, user_stories, acceptance_criteria, workflow, constraints, technical_details, notes, changelog โ created on first insert, slotted before Changelog.
Custom fields (if this project declares them). When _dream_context/overrides/task.md exists, every task carries project-defined custom fields. Their values are surfaced to you inline โ in the snapshot's Active Tasks block and in dreamcontext tasks list --long โ so you can see them without opening the file; unset required fields show as โ UNSET (required). When you create or reconcile a task, set every declared field (dreamcontext tasks field <slug> <key> <value> or tasks create --field key=value). REQUIRED fields are mandatory โ never create or complete a task with a required field left empty. Fields marked [ASK THE USER] (ask: true) capture a human judgment (e.g. a time estimate) โ ask the user for the value when creating the task instead of guessing it. The full schema + sync behavior โ tasks-and-features.md.
Objectives (roadmap links). When the project has objectives (core/objectives/ non-empty โ they're in your snapshot), every task should declare which it serves: objectives: [slug-a, slug-b] in frontmatter (many-to-many โ one task often lifts several outcomes). Set at creation (tasks create --objectives a,b) or later (dreamcontext tasks objectives <task> a,b). Propose objective links for tasks you create; never overwrite a non-empty objectives: list โ an existing value is a PO decision that sticks. The field is local-only (never synced to a cloud backend). Rollups, forecasts, and slip detection are computed โ dreamcontext roadmap / --json. Full model โ tasks-and-features.md.
RICE, due dates, tags/people, the Workflow flowchart, versioning, and multi-product โ tasks-and-features.md.
Syncing tasks to a cloud backend (ClickUp or GitHub โ one at a time) โ integrations.md.
Memory & Knowledge โ essentials
- Quick updates (no sleep): edit
core/0.soul.md/core/2.memory.md/people/<slug>.md directly; dreamcontext core changelog add for code changes; dreamcontext tasks log for progress.
- Recall (first-line discovery):
dreamcontext memory recall "<query>" [--top N] [--types knowledge,feature,task,memory,changelog,objective,insight,thesis,automation] [--level 1|2|3] [--json]. Default mode is haiku (a small cloud model picks relevant docs); raw = BM25 only; hybrid = experimental BM25+local-embedding fusion (no LLM call); off = disabled. Control with dreamcontext recall on|raw|hybrid|off|status. Auto-injected on prompts (opt out DREAMCONTEXT_MEMORY_HOOK=0).
- Quick capture:
dreamcontext memory remember "<text>" writes a type=note CHANGELOG entry; sleep reconciles it later. (2.memory.md no longer has a LIFO ship-narrative section โ ship events live in CHANGELOG.)
- Knowledge files: index auto-loaded; create with
dreamcontext knowledge create <name>; pin frequently-needed ones (pinned: true); read non-pinned on demand and knowledge touch after. Group a flat file into a context folder with dreamcontext knowledge move <slug> <folder> (atomic move + inbound [[wikilink]] rewrite โ never mv + hand-edit links).
- Features are sleep-only (see rule 9).
- Insights are NOT knowledge โ a metric the user wants tracked ("create an insight", "track MRR") is a Lab insight (
dreamcontext lab create), not a knowledge file. See the Entity Router above; full protocol โ tasks-and-features.md.
Recall modes, taxonomy, Excalidraw boards/diagrams, multi-product knowledge โ knowledge-and-recall.md.
Sub-Agents
dreamcontext-explore โ context-accelerated codebase exploration. Use for ALL exploration (default Explore is blocked). Uses the SubagentStart briefing to narrow searches. It is the fast, single-pass searcher โ one agent, tight budget, one answer.
dreamcontext-deep-research skill โ the iterative, sub-agent-driven corpus-synthesis orchestrator: the heavy counterpart to dreamcontext-explore. Invoke it via the Skill tool (or /dreamcontext-deep-research) when a question needs synthesis across a large or multi-project / federated corpus and one explore pass comes back thin or fragmented โ "synthesize/reconcile everything we know about X across my vaults", "deep dive and cite it", "explore is too shallow for this". It fans out parallel dreamcontext-explore searchers over the whole curated corpus and connected peer vaults, adversarially verifies the load-bearing claims, and returns a synthesized, cited report โ not raw hits. Read-only. Escalation rule: start with dreamcontext-explore; escalate to deep-research when one pass and one answer leave a cross-corpus question half-answered. Don't fan out a 10-agent research run at a tiny single-project brain.
initializer skill โ the interactive, sub-agent-driven brain bootstrap. Invoke it via the Skill tool when this project has no _dream_context/ or a sparse one (empty knowledge/, zero features, untouched template stubs). It orchestrates scout โ confirm-hierarchy โ progressive ingest โ verify, migrating whatever material the user has into the proper knowledge/feature/task hierarchy. It drives its own sub-agents (initializer-scout, initializer-ingestor, initializer-verifier) and handles codebase-only repos too (a light scout + ingest pass) โ there is no separate bootstrap agent.
- Sleep specialists (
sleep-tasks, sleep-state, sleep-product, sleep-migration) โ dispatched by the main agent during the sleep flow only.
First-run self-recognition (do not skip): if you notice the brain is missing or sparse, do not silently scaffold and move on, and do not wait to be asked โ proactively offer: "I don't have a brain for this project yet. Point me at whatever you have โ a docs folder, an Obsidian/Notion export, ADRs, design notes, an old wiki/spec โ and I'll initialize my brain by ingesting it into structured memory. Or I can bootstrap from just the codebase." Then invoke the initializer skill.
The hooks now surface this for you. The SessionStart and UserPromptSubmit hooks deterministically detect four conditions and emit a ๐ง dreamcontext: offer into your context โ treat that offer as your cue to act (relay it to the user, then invoke the initializer skill on consent; never re-implement its orchestration): (1) no-brain โ no _dream_context/ but a real project; (2) sparse-brain โ empty knowledge/, zero features, untouched template stubs; (3) migrate-from-folder โ the user points at an existing _dream_context/ or notes/Obsidian/Notion corpus elsewhere; (4) mass-new-source โ the user points an already-initialized brain at a sizable new docs/export/wiki folder. (Set DREAMCONTEXT_INITIALIZER_HOOK=0 to silence.)
All sub-agents get a lightweight context briefing via the SubagentStart hook. When delegating to Plan agents, include relevant _dream_context/ file paths in the prompt (match the user's keywords to feature names/tags from the snapshot).
Setup & Maintenance (quick map)
dreamcontext setup โ the front door: init + install-skill + install-instructions in one step, and on macOS offers to install the desktop app too (--install-app to force, --skip-app to opt out). (init, install-skill, install-instructions still exist for advanced/scripted use but are deprecated as standalone steps.)
dreamcontext update โ refresh THIS project's installed skill, agents, hooks, packs, and reference set to the latest shipped version.
dreamcontext upgrade โ upgrade the CLI, then (one command) update the desktop app if installed and offer to refresh every registered project to match (--yes does it all non-interactively). Keeping projects + app updated is the CLI's job โ you should not run per-project updates by hand or ask the user to.
dreamcontext doctor โ validate _dream_context/ structure.
dreamcontext dashboard โ open the web UI. dreamcontext app install|update|status โ the desktop app.
- "The agent surfaces don't work" / "claude: command not found" even though it's installed โ don't conclude the CLI is missing. Claude Code installs into
~/.local/bin, which is on no default PATH, so an install that skipped its closing export PATH echo leaves claude on disk and invisible to every login-shell spawn. The app reports this as its own state (Settings โ System โ "Installed, not on your PATH") with a one-click Fix PATH that writes the missing line into the right rc file, idempotently. Point the user there rather than reinstalling โ integrations.md.
- Team collaboration / shared brain / second machine โ when the user wants to use one brain with other people or on another computer ("share the brain", "collaborate on tasks/knowledge together", "sync my project to GitHub", "set it up on my other machine"), that's whole-project cloud sync:
dreamcontext brain enable (turn it on โ needs a GitHub origin) / brain status, auto-synced at sleep done, prose conflicts resolved by the /dream-sync skill. Guide them into it โ don't say "unsupported". Two modes (full-repo when on / in-tree when off), per-machine token, and cross-OS setup โ brain-sync.md.
Improving dreamcontext (you are its field reporter)
When dreamcontext gets in your way โ a recall gap, a missing command, a confusing behavior โ do not silently work around it. File it. The sanctioned path is dreamcontext feedback --dry-run โฆ โ confirm with the user โ file with --yes. Never gh issue create by hand. Full loop and quality bar โ improving-dreamcontext.md.
Structure
_dream_context/
โโโ core/
โ โโโ 0.soul.md 2.memory.md โ slot 1 is RETIRED (the user file became people/)
โ โโโ 3.style_guide_and_branding.md 4.tech_stack.md 6.system_flow.md
โ โโโ CHANGELOG.json RELEASES.json taxonomy.json
โโโ people/ โ WHO works in this vault (`dreamcontext people`)
โ โโโ people.json โ the structural roster: {version, people:{<slug>:{name,emails[],role?}}}
โ โโโ <slug>.md โ one constitution per person โ verbatim in the snapshot when active,
โ โ NOT knowledge and NOT recall-indexed
โโโ knowledge/ โ Deep research โ grouped by context, indexed recursively
โ โโโ <topic>.md โ flat top-level docs are fine
โ โโโ <context>/ โ PROMOTED: group related docs into a context folder
โ โ โโโ <doc>.md โ the context's knowledge
โ โ โโโ <title>/<title>.excalidraw.md โ diagrams live INSIDE their context folder
โ โโโ features/<feature>.md โ Feature PRDs, typed knowledge (type: feature; may include product:)
โ โโโ data-structures/{default,<product>}.md โ schemas (recall-indexed; ```sql body)
โ โโโ products/<product>.md โ per-product knowledge (multi-product)
โโโ lab/ โ Analytics insights (curated metrics โ NOT knowledge)
โ โโโ insights/<slug>.md โ insight manifests (`dreamcontext lab create`)
โ โโโ cache/<slug>.json โ synced series snapshots (never hand-edit)
โ โโโ scripts/<slug>.mjs โ custom-script adapters (run locally with your credentials)
โ โโโ credentials.json โ gitignored โ write ONLY via `lab credentials set`
โโโ overrides/
โ โโโ task.md โ OPTIONAL: project task template + custom_fields schema (briefed to agents)
โโโ state/
โ โโโ <task>.md โ Active tasks (frontmatter may include product:, start_date, due_date, custom_fields)
โ โโโ .config.json โ platforms, packs, multiProduct, taskBackend, peopleIdentity, linkedReposโฆ
โ โ (the `people` roster key was RETIRED in 0.23.0 โ people/people.json)
โ โโโ .brain-local.json โ gitignored: machine-local state incl. the active-person pin
โ โ (linked-repo LOCAL paths live in ~/.dreamcontext/linked-repos.json, never synced)
โ โโโ .active-version.json โ current sprint (active planning version)
โ โโโ .sleep.json .secrets.json (gitignored) .active-task
Reference Index
Open these with Read when the task needs depth:
- cli-reference.md โ every command, every flag, env vars.
- tasks-and-features.md โ task protocol depth, RICE, due dates, people/assignees, Workflow flowchart, features, versioning, multi-product.
- knowledge-and-recall.md โ knowledge files, pinning, recall modes, taxonomy, Excalidraw/diagrams.
- sleep.md โ full consolidation flow, specialist contracts, deep sleep, epoch safety, reflect, marketing/council passes.
- automations.md: scheduled headless
claude runs: the capture protocol, private-by-default sharing and its five states, what the machine-local approval tripwire covers and does not cover, why the dispatcher resolves the way it does, and how to stop a run safely.
- brain-sync.md โ whole-project GitHub cloud sync: the two modes (full-repo/in-tree), setup, per-machine token + auth, shared vs machine-local config, lifecycle, cross-OS setup, and the silent-failure troubleshooting playbook.
- integrations.md โ ClickUp/GitHub task sync (one cloud backend at a time), dashboard, desktop app, federation/vaults, council, marketing. (Brain sync has its own reference above.)
- improving-dreamcontext.md โ the feedback loop, when and how to file.