Project instructions and memory

Tell DCode how your project works once, in AGENTS.md, and let project memory keep what it learns between sessions.

On this page

DCode reads two instruction files when a session starts and follows them in everything it does there: yours, for every project, and the project's own. Put in them what you would otherwise repeat in every conversation.

The two files

FileWhat it is for
~/.dcode/AGENTS.mdYour own instructions, in every project: how you like to work, what to always or never do.
AGENTS.md in the projectThe project's instructions: how to build and test it, how it is laid out, its conventions. Commit it, and everyone who opens the project with DCode works from the same file.

For the project's file, DCode looks in the folder you work in, then in each folder above it up to the top of the git repository, and uses the first AGENTS.md it finds. Both files are read, yours first, up to the first 100 KB of each. They are read when a session starts, so a change applies from your next session.

Write one with /init

  1. Open the project in DCode, in the desktop app or the CLI.
  2. Type /init. To steer it, add notes after the command, for example /init the integration tests need Docker running.
  3. DCode looks through the repository and writes AGENTS.md at the folder's root, then sums up what it wrote.

If the project already has an AGENTS.md, /init reads it and edits it instead of replacing it. It writes the project's file only, never yours. The write follows your permission mode like any other change.

What to put in it

Short and practical beats long. Write the facts an agent would otherwise miss:

  • What the repository is for, and its main folders.
  • The commands to build, type check, lint and run the tests, including a single test.
  • Architecture boundaries and the rules that matter when editing.
  • Conventions: imports and paths, logging, UI and design rules, the platforms the code must run on.
  • Known pitfalls, and the documents to read before changing sensitive areas.
markdown
# AGENTS.md## Commands- Install: pnpm install- Test one file: pnpm vitest run path/to/file.test.ts- Before a commit: pnpm lint && pnpm typecheck## Rules- UI text lives in src/i18n; never hard-code strings in components.- Do not edit generated files under src/gen.

Project memory

With project memory on, DCode keeps what it learns about a project between sessions: how you like to work, the feedback you gave it, goals and constraints the code does not show, and pointers to outside resources. Each memory is a small Markdown file. An index, MEMORY.md, is loaded at the start of each session, up to its first 200 lines.

  • DCode saves memories as it works, and after a turn it can pick out what is worth keeping from what you wrote.
  • It updates a memory rather than adding a second one on the same subject, and deletes one that turns out to be wrong.
  • It does not save what the repository already records, such as the code's structure, git history or AGENTS.md.
  • To have it remember something, say so in your message.

In the desktop app

  1. Open Settings, Memory.
  2. Turn on Workspace Memory. It is off at first, applies to new sessions, and can use more requests and tokens.
  3. Under Saved workspace memories, pick a workspace to see its memory files, search them and preview each one.

In the CLI

Project memory is on unless you turn it off: /config memory switches it, from your next session. /memory lists your AGENTS.md, the project's AGENTS.md and the project memory index, says whether each is loaded, and opens the one you pick in $VISUAL or $EDITOR. The memories are kept on your computer under ~/.dcode/cli/memories.