Neotoma with OpenCode

OpenCode is a local coding agent with a TypeScript plugin system. Neotoma adds a persistent, user-owned state layer that OpenCode can reach through MCP and lifecycle hooks.

Looking for OpenClaw instead? See Neotoma with OpenClaw.

What OpenCode provides

  • Local agent runtime for code editing, shell work, and project tasks
  • Plugin hooks for sessions, messages, tool execution, shell environment, and compaction context
  • Load plugins from opencode.json (npm packages) or from local files under .opencode/plugins/ and ~/.config/opencode/plugins/

What OpenCode doesn't handle

  • Durable structured memory shared across other agent tools
  • Entity resolution, observation history, or provenance-backed facts
  • A persistence or consistency layer for external stores: OpenCode runs hooks and tool calls but does not verify, deduplicate, sequence, or repair what lands in databases, APIs, or files; that remains the job of plugins and integrations you add

Deterministic guarantees Neotoma provides

  • Persistent memory graph shared with Cursor, Claude Code, Codex, ChatGPT, and OpenClaw
  • Conversation, message, tool, and compaction observations with stable provenance
  • Structured state written by the agent through MCP, with hook capture as a safety net
  • CLI fallback when MCP is unavailable or the agent needs direct terminal access

Using them together

OpenCode stays responsible for the agent runtime. Neotoma stays responsible for the durable state layer. MCP remains the quality path for schema-typed writes, while the OpenCode plugin records baseline turn activity when the agent misses a step.

ConcernOpenCodeNeotoma
Agent runtime and toolsCoding agent-
Plugin lifecycle hooksEvent surfaceHook package
Structured entities and tasks-Store via MCP
Cross-tool memory-Shared state graph
Audit trail and provenance-Observation history

Neotoma OpenCode plugin

The Neotoma OpenCode plugin is published as @neotoma/opencode-plugin. Add it to opencode.json:

{
  "plugin": ["@neotoma/opencode-plugin"]
}

OpenCode installs npm plugins automatically at startup. For local plugin files, export a named plugin function from ~/.config/opencode/plugins/neotoma.ts:

import neotoma from "@neotoma/opencode-plugin";

export const Neotoma = neotoma();

Getting started

Copia este prompt en OpenCode para que lea la página de evaluación, revisa tu herramienta, espacio de trabajo y configuración, y juzga si Neotoma encaja en tu flujo real y qué conviene persistir primero.

Prompt de evaluación
Lee la página y evalúa el encaje frente a tu flujo real.
Lee https://neotoma.io/evaluate. Usa cualquier herramienta, espacio de trabajo y contexto de chat ya disponibles en esta sesión para evaluar mi flujo real. Evita introspección ad hoc en la shell solo para perfilarme; si Neotoma ya está instalado, usa `neotoma doctor --json` para el estado. Luego dime si Neotoma encaja en mi flujo, qué datos conviene persistir primero por valor y qué debería hacer a continuación.

Start Neotoma locally, then let OpenCode load the plugin from npm or a local plugin file:

npm install -g neotoma
neotoma api start --background --env dev

Keep MCP configured as well. Hooks guarantee baseline capture; MCP gives the agent the richer store, retrieval, relationship, and feedback tools.

OpenCode documentation

  • Plugins (npm plugins, local files, and hook events)
  • SDK (client APIs exposed to plugin context)

Before and after: OpenCode with Neotoma

“Continue where we left off yesterday.”

Without Neotoma

Resuming based on thread from two weeks ago.

With Neotoma

Resuming yesterday’s thread on the migration plan. 3 open tasks remaining.

“What did I commit to with Sarah last week?”

Without Neotoma

No commitments found.

With Neotoma

You committed to sending the architecture doc by Friday. Sarah’s email updated Mar 28.

“How much did we spend on cloud hosting last month?”

Without Neotoma

No hosting expenses found.

With Neotoma

$847 across AWS and Vercel, up 12% from February.

After you connect

Once Neotoma is running, try these starter commands in OpenCode to see cross-session memory in action:

Store a contact

“Remember that Sarah Chen's email is sarah@newstartup.io — she's the CTO at NewStartup.”

Store a task

“I need to send the architecture doc to Sarah by Friday.”

Recall across sessions

“What do I know about Sarah? What did I commit to doing for her?”

See the package README, MCP reference, CLI reference, and agent instructions for the full operating contract.