Local project memory with .gothel
A .gothel folder gives a project durable context that people and AI agents
can read next time they work on it: why decisions were made, what failed, what
constraints matter, and where to resume.
It is ordinary Markdown in your project. You can use it without installing anything, creating an account, or connecting to a memory server. Keep it in version control with the project so collaborators get the same context.
Quick start with an agent
Open your project in a coding agent that can read and edit its files. Give the agent this guide and paste the following prompt:
Set up local .gothel project memory using this guide.
Read the existing project instructions and canonical documentation first.
Create GOTHEL.md, .gothel/README.md, and .gothel/MEMORY.md using the starter
files in the guide, adapted to this project. Merge the memory instructions
into the project's active agent instructions (AGENTS.md or its equivalent).
Preserve existing instructions and memory; create only missing files and
review any proposed edits to existing files.
Name the actual canonical sources and the kinds of work that need memory
retrieval. Add a dated initialization entry based only on what you inspected;
do not invent project history. Keep secrets and unnecessary personal data out.
Do not configure remote publication.
Verify the paths and show the changes. Then demonstrate retrieval by reading
the guide and finding the initialization entry. Follow this project's normal
review and commit process.
The prompt works with the manual starter files below. Merely adding a hidden folder does not ensure an agent reads it: the instruction hook is essential. For a chat that cannot access local files, you must provide the relevant files or excerpts yourself.
Set up the four files yourself
Start at the root of the project, beside its main README. Create .gothel
with your editor or file manager. On macOS or Linux, you can also run:
mkdir -p .gothelUse the following layout:
your-project/
├── AGENTS.md
├── GOTHEL.md
└── .gothel/
├── README.md
└── MEMORY.md
If any file already exists, merge the relevant guidance into it. Do not
replace existing instructions or erase existing memory. If your agent uses
another instruction file, put the instruction hook there; AGENTS.md is the
convention used by this example.
1. GOTHEL.md — the discovery marker
Create this file at the project root:
# Gothel Enabled
This project keeps local project memory in `.gothel/`.
Before meaningful work, read `.gothel/README.md`, review recent entries in
`.gothel/MEMORY.md`, and search the log for the task's relevant concepts.
Verify retrieved context against current project sources.
Append useful decisions, discoveries, constraints, failures, and corrections
when they should survive the session. Never store secrets or unnecessary
personal data. The operating rules live in `.gothel/README.md`.2. .gothel/README.md — how this project uses memory
Copy this starter guide, then name your project's actual canonical documents and any areas that always require retrieval, such as releases or data changes:
# Project memory
This directory preserves context for future work on this project. It works
locally without a memory service. Keep it in project version control.
## Before meaningful work
1. Read this guide.
2. Review recent entries at the end of `MEMORY.md`.
3. Search the entire log for the task and related concepts.
4. Verify relevant findings against current project documentation, code,
tests, and other authoritative project sources before acting on them.
Memory records context and rationale. Current user direction and accepted
project decisions guide the work; current implementation and tests establish
observed behavior. Investigate disagreements instead of treating old notes
as instructions to override the task.
## What to record
Append durable decisions and their reasons, discoveries, constraints, failed
approaches, corrections, and useful resumption context. Record information
that a future collaborator would not quickly recover from normal project
documentation. Link to canonical sources instead of copying them wholesale.
Skip routine commands, transcripts, unsurprising test results, and private
reasoning traces. Never store secrets, credentials, tokens, private keys,
authentication cookies, or unnecessary personal or customer data.
## Entry format
Append to `MEMORY.md` using a dated heading and a short title. Include the
context, decision or finding, why it matters, consequences, and references.
Omit fields that add no value. Distinguish observations, decisions, assumptions,
and aspirations. For facts that can change, include the observation date and
relevant source revision or environment.
## Corrections and maintenance
Preserve safe history. Add a later correction or superseding entry when facts
or decisions change. Unsafe material is the exception: remove it, follow the
project's incident process, and keep only a safe explanation. Removing a
working-tree file does not erase Git history or revoke a leaked credential.
Improve this guide when the workflow becomes noisy or hard to use. Keep
current operating instructions here and the chronology in `MEMORY.md`.
Update the active agent instructions when the workflow changes.
## Sharing
These files follow the repository's access rules. A dot-prefixed directory is
not a privacy boundary. There is no automatic remote sync. Publication to a
memory service is a separate, optional integration.3. .gothel/MEMORY.md — the chronological log
Start with this heading, then append a dated initialization entry describing the sources you actually inspected and why memory was added. An empty log is better than invented history.
# Gothel MemoryFor later entries, use this shape and omit fields that add no value:
## YYYY-MM-DD HH:MM TZ — Short title
**Context:** What prompted this entry.
**Decision or finding:** What was decided or observed.
**Why:** Evidence, tradeoffs, or failed alternatives.
**Consequences:** What future collaborators should do, verify, or revisit.
**References:** Relevant files, issues, tests, or commit identifiers.Use the actual date and timezone. For example, a hypothetical useful entry might explain that an import fails on a partner's Windows-encoded CSV files, which fixture reproduces the failure, and why encoding normalization belongs at the import boundary. “Ran the tests” by itself is not useful memory.
4. AGENTS.md — make retrieval part of the workflow
Merge this section into the instruction file your agent actually reads:
## Local project memory
Before meaningful work, read `.gothel/README.md`, review recent entries in
`.gothel/MEMORY.md`, and search the log for relevant concepts. Verify memory
against current project sources.
After work, append only high-signal decisions, discoveries, failures,
constraints, corrections, or resumption context that future collaborators
would not readily learn from canonical documentation. Preserve safe history.
Never record secrets, credentials, tokens, or unnecessary personal data.
Follow this project's review and version-control rules. Local memory requires
no remote service; remote publication is a separate, optional integration.Use it during ordinary work
Before a meaningful task, read the guide, skim recent entries, and search for
the feature, decision, or constraint you are touching. If rg is available,
this example searches for deployment and rollback history:
tail -n 80 .gothel/MEMORY.md
rg -n -i 'deploy|rollback' .gothel/MEMORY.mdAn editor's search works just as well. Search the whole log: older decisions can remain relevant even when they are outside the recent tail. Trivial edits do not need ceremonial entries; record something only when it will help the next person or session.
After a task, update canonical documentation for the current behavior and append a short memory entry only for the additional context worth preserving. For a paused investigation, record what is known, what remains uncertain, and the next useful check. Review memory changes alongside the project change.
Check the setup
- Confirm the four files exist and the instruction hook is in the file your agent reads. Check project-relative paths and remove any placeholders.
- Ask a fresh agent session: “Read this project's memory instructions and summarize the latest relevant decision, citing its entry and sources.”
- Review every new file for accuracy and sensitive content. In a Git project,
confirm
.gothelis tracked rather than accidentally ignored. Keep unrelated changes out of the setup commit.
For Git projects, these commands help inspect the setup; new untracked files
still need to be opened and read because ordinary git diff omits them:
git status --short -- AGENTS.md GOTHEL.md .gothel
git diff -- AGENTS.md GOTHEL.md .gothelCommit the reviewed files using the project's normal process. If the project does not yet use Git, the files still work locally; use your normal backup method until version control is in place.
Grow only when needed
Start with one guide and one log. If search becomes difficult, add an index
or focused topic files and teach the agent instructions where to look.
Optional decisions/ and memories/ directories can hold curated records;
they are not required for the local workflow.
Remote Gothel is a separate service. Following this guide does not upload project files or make them available in other chats automatically. A future remote integration needs its own access, publication, and privacy decisions; ordinary Git sharing already carries these files to collaborators with access.