{
  "id": 8119465,
  "title": "Giving an OpenCode Coding Agent Persistent, Editable Memory",
  "url": "https://urgent.news/2026/09/17/giving-an-opencode-coding-agent-persistent-editable-memory",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-17T22:24:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ghilteras/giving-an-opencode-coding-agent-persistent-editable-memory-458n"
  },
  "original_language": "en",
  "account": "OpenCode coding agents are adept at utilizing context from their current session, but they struggle to retain valuable context across multiple sessions. Project conventions, decisions made during debugging, and obvious preferences can be lost after a restart or context compaction. To address this, the author created @ghilteras/opencode-agent-memory, an experimental plugin for OpenCode that presents agent memory as editable, scoped Markdown state on disk instead of an opaque remote service.\n\nThree tools are provided by the plugin: memory_list, memory_set, and memory_replace. Memory blocks are plain Markdown files with YAML frontmatter, enabling structured state where some facts belong globally across all projects, while others are specific to a single codebase. Each block has a label, filename, description field to guide the agent's usage, and a maximum character limit. The plugin also includes an optional append-only journal for observations, dead ends, discoveries, and decisions, allowing for local semantic search using local embeddings.\n\nThe plugin's three tools enable the agent to list, set, and replace memory blocks. Memory blocks are plain Markdown files with YAML frontmatter, facilitating structured state for facts that need to persist across sessions. The journal records the agent's observations, including wrong conclusions, and is opt-in to prevent silent collection. Semantic retrieval is available through local embeddings, and the system includes measures to handle versioning, indexing, and retrieval efficiency.\n\nInstallation requires OpenCode v1.0.115 or later, with the plugin included in the OpenCode configuration. Restarting OpenCode after configuration changes is necessary for the new plugin version to load. The author invites feedback on memory management, handling stale memories, the usefulness of semantic retrieval, and what should survive context compaction.",
  "summary": "Giving an OpenCode Coding Agent Persistent, Editable Memory AI coding agents are good at using the context currently in front of them. They are much less reliable at carrying useful context from one session to the next. Project conventions, decisions made during a debugging session, and preferences that were obvious yesterday often need to be re-explained after a restart or after context…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}