DGC v0.48.4 is out
Navigate
Install DGC
DGC v0.48.4Edit on GitHub ↗
Using DGC/Memory

DGC.md, #fact, and /memory — guidance that loads every session

Memory

#

Memory is a Markdown file the native agent reads at the start of a session: project conventions, commands that actually work here, facts you asked it to keep. It is not the context-notes trace (those are written from tool results — see Context notes), and delegated subscription turns do not receive this DGC injection.

Where it lives

#
  • Project — DGC.md at the project root. Loaded into every native session in that repo.
  • Personal — ~/.dgc/DGC.md. Loaded in every project, after the project file.

Both are bounded (about 32k characters of prompt view, 1 MiB on disk) and redacted the same way saved sessions are. Missing files are simply empty.

Rules survive a long file

#

A file over that bound keeps its beginning and its newest end, and the middle is left out. A rule must never be the part that goes, so say which parts are rules. A section whose heading starts with the word Rule or Rules (## Rule: run the tests before committing, ### Rules), or any section containing <!-- dgc:rule -->, is kept whole and placed first. A section runs from its heading to the next one.

If the rules alone do not fit, DGC keeps as many as fit, in order, and names the ones it left out, so you know the file needs consolidating — only you can choose what to cut. A file within the bound loads exactly as written.

Writing it

#
  • #a fact in the composer — appends that line to project DGC.md atomically.
  • /memory add TEXT — the same, for project memory.
  • /memory add user TEXT — appends to personal ~/.dgc/DGC.md.
  • /memory — show what is loaded.
  • The model's save_memory tool does the same write, with scope project (default) or user.
  • /init inspects the repo and prepares or updates DGC.md using ordinary edit permissions. In plan mode it proposes the guide first. See Plan mode.

A # line is memory, not a comment: it is written to the file, then the prompt is not sent as a normal question.

What DGC remembers about you

#

Separately from these files, DGC keeps one memory about you that ChatDGC, Work sessions and Pips share: short facts you told ChatDGC, a Work session or a Pip (each keeps what you state about yourself, or ask it to remember, and says so) or added yourself, plus your projects, from your Work sessions. A Work session reads those facts under # Memory. See, change or delete everything in Settings → Memory, where one switch turns it off everywhere. A fact is kept only when you said it yourself, never a password, key or account number, and temporary chats are never remembered.

It also learns by itself: once a chat or a session has been quiet a couple of minutes, or a turn ends after you've written a paragraph or so, DGC looks back over what you said and keeps at most three preferences, facts, decisions or outcomes, by the same rules. The chat shows each once as Remembered: … · Forget. Settings → Memory → History lists every change, who made it and when, with Undo. Memory off means it never looks.

/learn (or /learn what) turns what was just done into a skill: DGC drafts a SKILL.md from the session and shows it with Save, Edit and Cancel. Nothing is written until you save; it goes to the project's .dgc/skills when the folder is trusted, otherwise to ~/.dgc/skills, and Undo in History deletes it again.

What belongs in it

#

Stack, layout, build/test/lint commands, house style, durable facts. Not credentials, personal details, private absolute paths, or a dump of the last session — use Handoff for a continuation document, and /export for a transcript.

The date and the clock

#

Memory is not the only thing DGC puts in front of the model. It also tells it what time it is, because a model with no clock writes "what I completed tonight" in the middle of the afternoon.

  • The session prompt carries the day and where this machine is: Date: 2026-09-20 (Asia/Kolkata, UTC+05:30). The zone name comes from the machine itself — TZ, or the /etc/localtime link on Linux and macOS. A machine that records no name shows the offset alone (UTC+05:30), and one that records nothing shows UTC. Nothing is looked up online.
  • Every message you send carries the day and the time of day, on its own line: Local time: Sunday 2026-09-20 14:32 (Asia/Kolkata). It is on the message rather than in the session prompt so that two questions a minute apart still send a byte-identical prompt, which is what lets a provider charge cached-input rates for the second one. The date is on it too, so a chat picked up days later doesn't reuse the last date it saw. Resumed chats and /export show what you typed, without it.

A day boundary reaches the model on your next message, so an overnight session does not keep calling it yesterday. A sub-agent is told the same two things. A turn DGC starts by itself on a background monitor gets no clock line: the events it delivers are already timestamped.

The same rule keeps the start of every request the same from one turn to the next, which is what lets a provider (OpenAI, DeepSeek, Anthropic, Ollama cloud) charge cached-input rates and a local Ollama or llama.cpp skip re-reading the conversation. What one message needs for itself rides on that message, just before the clock line, in a <dgc-turn-notes> block: the how-to for showing you a page when you ask to see one, the note when you ask to choose between options and the picker is not offered, a skill your words matched, the hand-back while an approved plan still has steps, and the note after you cleared the checklist. The session prompt and the tool list stay as they were. A large MCP catalog is cut to the tools a chat needs, and a tool offered once in a chat stays offered while its budget lasts, so the tool list changes only when a new tool joins. Resumed chats and /export show what you typed, without the notes. What still changes the start, by design: switching the mode, the thinking level or the model, naming a skill with $, remembering or forgetting something, a goal, plugins and skills installed mid-chat, a background job or sub-agent that adds the tools to manage it, and, in Auto mode, the options picker on a message that asks to choose. The adaptive tool profile still shapes its prompt and tool list from each message's words.

Documentation