anomalyco / anomalyco/opencode

[FEATURE] Persistent Session Memory

Open
#16,077 15 comments 4 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Summary

Add the ability for opencode to load previous conversation context from a local file at startup, enabling continuity between sessions.

Use Case

  • Users who want AI assistant to remember previous conversations
  • CLI-based AI companions that need persistence between sessions
  • Developers wanting a lightweight alternative to database-backed memory

Proposed Solution

Add a --memory-file or --load-context flag that:

  1. Reads a specified markdown/text file before starting the chat
  2. Injects the content as system context at session start
  3. Optionally appends session summary to the file at end of session

Example Usage

# Load previous context
opencode --memory-file ./my-memory.md

# Or with short flag
opencode -m ./my-memory.md

Alternative

Could also support a config option in openclaude.json:

{
  "memory": {
    "enabled": true,
    "file": "./memory.md",
    "autoSave": true
  }
}

Benefits

  • Simple, file-based approach - no database required
  • User has full control over their data
  • Works offline
  • Easy to back up or share

Priority

Medium - useful for personal AI companions and persistent CLI assistants


  • I have verified that this feature has not already been requested
  • I have read the contributing guidelines

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.