Memory¶
Memory lets gdc carry useful facts across sessions. Instead of re-explaining your preferences or a project's quirks every time, you (or the agent) write them down once, and gdc keeps them in mind in future conversations.
What memory is for¶
Good things to store in memory:
- Your preferences — "always use the project's formatter before committing", "prefer small, focused changes".
- Project facts that aren't obvious from the code — "the staging database is read-only", "integration tests need a running Redis".
- Decisions and constraints — "we're standardising on library X",
"don't touch the generated files under
gen/".
Memory is not for storing large documents or things that live in the code already — keep it to short, durable notes.
Scopes¶
Memory notes live in one of three scopes, so they apply exactly where they're relevant:
| Scope | Applies to | Stored in |
|---|---|---|
| User | You, in every project | ~/.gdc/memory/ |
| Project | Everyone working in this project | <project>/.gdc/memory/ |
| Local | This project, just for you | <project>/.gdc/memory.local/ |
Project memory is meant to be shared (checked into version control); local memory is meant to stay private (typically ignored by version control).
How it works¶
At the start of a session, gdc loads a short index of your notes and keeps it in view, so the agent is aware of what you've recorded. The agent can also read, search, and (with your approval) write and delete notes as it works.
Writing and deleting memory ask for your approval, just like other actions that change your files. Reading and searching are automatic.
Managing memory yourself¶
You don't have to go through the agent — you can manage notes directly:
gdc memory list # all notes for this project
gdc memory search redis # find notes mentioning "redis"
gdc memory show <name> # read one note
gdc memory write <name> \
--description "short summary" --type project --scope project \
--content "The staging database is read-only."
gdc memory delete <name> --scope project
Turning it off¶
If you'd rather gdc not load memory into a session automatically, you can disable the injection while keeping the ability to manage notes:
You can also disable individual scopes — see the Configuration reference.