Claude Code memory
How Claude Code remembers between sessions with CLAUDE.md and auto memory, where it keeps transcripts, and what Dray saves for your other agents to search.
Coding agents Facts checked 12 October 2026
OpenCode’s docs describe rules, not memory: it follows the AGENTS.md files you write and keeps your sessions on disk. Dray saves each turn to your Dray account, where every agent you connect can search it, and removes a session when you delete it in OpenCode.
AGENTS.md in your project root for project-specific rules.” OpenCode finds it by walking up from the current folder. OpenCode docs: rules~/.config/opencode/AGENTS.md and apply to all your OpenCode sessions. That file isn’t committed to Git or shared with your team. OpenCode docs: rulesCLAUDE.md in the project, and ~/.claude/CLAUDE.md for global rules. The first matching file wins in each case, and OPENCODE_DISABLE_CLAUDE_CODE=1 turns the fallback off. OpenCode docs: rulesinstructions option in opencode.json adds more instruction files. /init creates an AGENTS.md, or improves the one you have. OpenCode docs: rules~/.local/share/opencode/ on macOS and Linux. OpenCode docs: troubleshootingopencode --continue (-c) continues the last session and --session (-s) opens a specific one. opencode session list and opencode session delete <id> manage them. OpenCode docs: CLIopencode export writes a session as JSON and opencode import reads one back. In the TUI, /sessions lists and switches sessions, and /export saves one as Markdown. OpenCode docs: CLI OpenCode docs: TUI~/.config/opencode/plugins/dray.js, which OpenCode loads at startup. When a session goes idle, it saves what you typed and the answer the turn ended on to your Dray account. OpenCode docs: pluginsdray tokens on. On your computer, it outlines big files and shrinks big browser screenshots before OpenCode reads them. OpenCode can still read the full file. It can’t overwrite one it has only seen in outline until it has read all of it. Dray: connect~/.config/opencode/commands: /link links this chat with your other chats, /link CODE joins a link another chat made, /unlink leaves it, and /dray-status checks what Dray has saved. Dray: connectOne command sets up OpenCode and the other agents it finds on your computer. It needs Node.js 18 or later on macOS or Linux, and no Chrome extension.
curl -fsSL https://api.withdray.com/cli/install.sh | sh~/.config/opencode/opencode.json. If your settings are in opencode.jsonc, setup leaves that file alone and prints the lines to add.To set up OpenCode on its own, or add it later:
dray setup --agents opencodeAdd this to opencode.json. Connecting this way does not save your sessions.
{
"mcp": {
"dray": { "type": "remote", "url": "https://mcp.withdray.com/mcp" }
}
}Sign in with opencode mcp auth dray and check with opencode mcp list.
opencode run one-shot runs are not saved unless you run dray config scripted on.Facts checked on 12 October 2026 against these pages.