New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

opencode-max

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opencode-max

Memory and task orchestration plugin for OpenCode with project/session isolation

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

OpenCode Max Plugin

OpenCode Max is the fundamental solution to the "Project Amnesia" problem in AI coding agents. It provides a strictly isolated, local-first memory architecture that guarantees coding efficiency and architectural consistency across long-term projects.

Unlike generic memory plugins that treat context as a flat list, OpenCode Max understands project boundaries and session lifecycles, ensuring your agent never "hallucinates" patterns from other repos or forgets architectural decisions made weeks ago.

The Core Value: Solving Global Memory Fundamentally

Most AI agents suffer from Context Drift: as a project grows, they lose track of established patterns, or worse, bleed context from Project A into Project B. OpenCode Max solves this at the architectural level:

1. Agent Efficiency & Zero-Shot Accuracy

  • Problem: Agents often waste tokens re-learning your project structure in every session.
  • Solution: With persistent, project-hashed memory, OpenCode Max instantly provides the exact relevant context (types, utils, patterns) before the agent writes a single line. This drastically reduces "correction loops" and makes the agent "get it right the first time."

2. Architectural Consistency (The "Deep Memory")

  • Problem: "Why did you use var here? We switched to const last week!" Agents forget past decisions.
  • Solution: By retrieving historical context scoped strictly to the current project, the agent maintains consistent coding styles, variable naming conventions, and architectural patterns throughout the project's lifecycle—whether it's Day 1 or Day 100.

3. Absolute Project Isolation (No "Cross-Talk")

  • Problem: Working on a Rust backend in the morning and a React frontend in the afternoon often confuses agents, leading to "hallucinated" imports or syntax.
  • Solution: Hard Directory Hashing. Vectors for Project A are physically stored in .opencode/vectors/<hash_A>. It is mathematically impossible for the agent to access Project B's context while working on Project A. This is not just a filter; it's a physical firewall for your context.

Why OpenCode Max: The Definitive Comparison

While plugins like opencode-supermemory or opencode-mem offer memory, they often rely on cloud services or loose tagging. OpenCode Max is built for Enterprise-Grade Consistency.

FeatureOpenCode MaxCloud Memory PluginsGeneric Local Plugins
Global Memory ProblemSOLVED (Physical Isolation)Mitigated (Tags/Filters)Unsolved (Flat File)
Agent ConsistencyHigh (Project-Scoped RAG)Medium (Global Context Noise)Low (Session Only)
Coding EfficiencyHigh (Precise Retrieval)Medium (Network Latency)Low (Limited Context)
Data Privacy100% Local (LanceDB)Cloud DependentLocal
Indexing StrategyIncremental & BackgroundFull Re-uploadManual / Sync

Verdict: If you need an agent that "codes like a senior engineer" who remembers the project history without getting confused by other projects, OpenCode Max is the only architectural solution.

Core Features

  • Task tracking and synchronization
  • Memory indexing and retrieval with LanceDB
  • Project‑level vector isolation via hashed project root
  • Session‑level retrieval filters for tasks and history
  • Incremental background indexing

Requirements

  • OpenCode CLI 1.1.37 (or later)
  • Node.js 18+

Installation

  • Ensure you have the OpenCode CLI installed.
  • Edit your OpenCode configuration file (usually ~/.config/opencode/config.json or %USERPROFILE%\\.config\\opencode\\config.json):
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "opencode-max"
  ]
}
  • Restart your OpenCode session. The plugin will be automatically downloaded and installed.

Option B: Local Development Install

If you want to modify the plugin or use a local version:

  • Clone this repository:
    git clone https://github.com/drpr/alex.git
    cd alex/opencode-max
    
  • Install dependencies:
    npm install
    
  • Build the plugin (if applicable) or ensure plugin.mjs is ready.
  • Point your OpenCode config to the absolute path of the opencode-max directory:
{
  "plugin": [
    "/Users/yourname/path/to/alex/opencode-max"
  ]
}

Configuration

To customize indexing behavior, create a .opencode-max.json file in the root of the project you are working on (not the plugin directory).

{
  "vectorDir": ".opencode/vectors",
  "include": ["**/*.{js,ts,jsx,tsx,py,java,cs,go,rs,md,c,cpp,h}"],
  "exclude": ["**/node_modules/**", "**/dist/**", "**/.git/**", "**/.vscode/**"],
  "topK": 8,
  "indexingDebounce": 1000
}

Configuration fields

FieldMeaningRecommendation
vectorDirVector storage directoryKeep default
includeFile patterns to indexCover primary languages
excludeFile patterns to ignoreExclude build outputs and dependencies
topKMax candidates per retrieval3–8

Usage

  • Install the plugin and complete configuration
  • First run builds the initial index (if missing, the plugin will auto-create the codebase table)
  • Retrieval is scoped by session and project automatically
  • Switching projects requires no manual cleanup because isolation is enforced

Troubleshooting

  • Bun Error Overlay (macOS)
    Use polling-based file watching instead of native fsevents (built-in). If the overlay persists, restart OpenCode and retry.
  • First retrieval returns “Table 'codebase' was not found”
    The plugin auto-detects and creates the codebase table. Wait for the initial indexing to complete.
  • Version alignment
    Ensure your host CLI and plugin interface align to @opencode-ai/plugin@1.1.37. Prefer installing via the npm package name to avoid loading stale local path versions.

Isolation Model

  • Project isolation: vectors live under .opencode/vectors/<projectId>, derived from a hash of the project root
  • Session isolation: task and history retrieval are filtered by session ID

Landscape and References

OpenCode Max is designed for developers who demand absolute context control.

References:

  • OpenCode plugin docs: https://opencode.ai/docs/plugins/
  • Community plugin directory: https://github.com/awesome-opencode/awesome-opencode
  • Find this plugin:

Development

npm install

Publish

npm publish --access public

License

MIT

Keywords

opencode

FAQs

Package last updated on 29 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts