New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@devcxl/opencode-memory

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devcxl/opencode-memory

Simple markdown-based memory plugin for OpenCode

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
10
Maintainers
1
Weekly downloads
 
Created
Source

@devcxl/opencode-memory

npm version npm downloads license CI

English | 中文

Simple markdown-based memory plugin for OpenCode.

Installation

Add to your OpenCode configuration at ~/.config/opencode/opencode.json:

{
  "plugin": ["@devcxl/opencode-memory"]
}

Memory Files

FilePurpose
MEMORY.mdLong-term memory (crucial facts, decisions, preferences)
IDENTITY.mdAI identity (name, persona, behavioral rules)
USER.mdUser profile (name, preferences, context)
daily/YYYY-MM-DD.mdDaily logs (day-to-day activities)
BOOTSTRAP.mdFirst run setup instructions (deleted after setup)

Storage Location

  • macOS/Linux: ~/.config/opencode/memory/
  • Windows: %APPDATA%/opencode/memory/

Tool: memory

Actions:

ActionDescriptionParameters
readRead memory filetarget: memory, identity, user, daily; date, scope (optional)
writeWrite to memory filetarget, content, mode: append/overwrite; date, scope (optional)
editEdit specific part of filetarget, oldString, newString; date, scope (optional)
deleteDelete entry by timestamptarget, timestamp; date, scope (optional)
searchSemantic search memory filesquery, max_results, period, scope (optional)
listList memory filesperiod (optional)

Examples:

Use --scope project for the current project memory. The project ID is auto-detected from git; if detection fails, memory falls back to global.

memory --action read --target memory
memory --action write --target memory --content "Remember to use PostgreSQL for all projects"
memory --action write --target daily --content "Fixed critical bug in auth module"
memory --action edit --target memory --oldString "Project: Auth Service" --newString "Project: Payment Service"
memory --action delete --target daily --timestamp "2026-06-06 15:40:23"
memory --action search --query "PostgreSQL"
memory --action search --query "bug" --period 2026-06 --scope project
memory --action list
memory --action list --period 2026-06
memory --action write --target memory --scope project --content "Use port 5432"

First Run Flow

Important: First setup must be done in OpenCode build mode (not plan mode). AI cannot write files in plan mode.

  • Plugin detects no MEMORY.md exists
  • Creates BOOTSTRAP.md with setup instructions
  • AI reads BOOTSTRAP.md and asks user questions interactively
  • AI writes to MEMORY.md, IDENTITY.md, USER.md
  • AI deletes BOOTSTRAP.md
  • Setup complete

The setup can be triggered manually with /memory-init at any time (only available when the memory system is not yet fully initialized).

Context Injection

MEMORY.md, IDENTITY.md, and USER.md are automatically injected into the system prompt at session start.

Daily logs must be accessed via the memory tool.

License

MIT

Keywords

opencode

FAQs

Package last updated on 20 Jul 2026

Related posts