opencode

A runtime integration template for OpenCode, an AI coding-agent environment, connected to the ContextLattice orchestration service.

In plain words
What is it for?
Use it to configure OpenCode to work with ContextLattice, retrieve project context, search skills, trace activity, and record completed work.
Why use it?
It defines the environment settings, health checks, context retrieval, session resume, memory saving, and task completion steps the agent should follow.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/sheawinkler/contextlattice/opencode
Clone the repo
git clone --depth 1 https://github.com/sheawinkler/ContextLattice
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 324 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00324
Opus 5 $0.00000 $0.00162
Sonnet 5 $0.00000 $0.00065
Haiku 4.5 $0.00000 $0.00032

Measured 2d ago against content hash a1ccb6bc577c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

89% identical to claude-code — 10 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

docs/public_overview/templates/agents/opencode.md · 29 lines

What it actually says

OpenCode Integration Template

Runtime:

  • Orchestrator: http://127.0.0.1:8075
  • Agent profile: opencode
  • Stable agent id: opencode_agent

Session bootstrap:

export CONTEXTLATTICE_ORCHESTRATOR_URL=http://127.0.0.1:8075
export MEMMCP_ORCHESTRATOR_URL=http://127.0.0.1:8075
export CONTEXTLATTICE_AGENT_ID=opencode_agent
export MEMMCP_AGENT_ID=opencode_agent

Primary workflow:

contextlattice doctor --pretty
contextlattice context "current task" --project contextlattice --pretty
contextlattice resume --project contextlattice --pretty
contextlattice remember "checkpoint summary" --project contextlattice --pretty
contextlattice finish "verified result" --success --project contextlattice --pretty
contextlattice_skills_index search "repo conventions testing release" --pretty

Behavior contract:

  • Run contextlattice_adopt integrate --repo . --agents codex,claude-code,opencode,hermes-agent,hermes-ultra,omp,mercury-agent,pi,droid --pretty to install repo-local instruction files, or paste docs/public_overview/templates/agents/universal.md into system instructions when the runtime has no repo instruction file.
  • Use contextlattice_agent_trace --session-id <session-id> --tree only when advanced provenance debugging is needed.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 29 lines · 0 tokens per session scan A a1ccb6bc577c

Subscribe to this mod's changes

opencode is an agent published in the GitHub repository sheawinkler/ContextLattice (152 stars, last pushed 5d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 324 tokens. A static security scan graded it A with 0 findings. It is 89% identical to claude-code, differing in 10 lines, and is treated as a copy.

Related

Other agents, from other repositories

Explore

Fast read-only codebase & docs exploration. Returns structured findings, never raw file dumps.

BlackBeltTechnology/pi-agent-dashboard · 18 tokens

tech-lead

Technical lead agent – PR review/approval/merge, blocker resolution, and architecture/trade-off review aligned with Jira outcomes.

agents-universe/agents-universe · 25 tokens

external-system-integration-expert

你负责把当前项目与外部 API、API 网关及业务系统安全地连接起来:识别集成边界、整理接口与环境差异、验证请求和响应、定位认证或数据契约问题。.

agents-universe/agents-universe · 33 tokens

DocScribe

Write docs/ prose for a completed change, in caveman style, per the repo's Documentation Update Protocol. Use after a change lands to update docs/architecture.md, docs/ .md, README, or docs/AGENTS.md — the Rule-6 delegation target (main agent must NOT edit docs/ directly). Self-contained — give it the diff + target…

BlackBeltTechnology/pi-agent-dashboard · 100 tokens

Audit

Deep security + performance audit of a specific diff. Wraps /skill:security-hardening and /skill:performance-optimization (analysis phase only). Use when a change touches auth, untrusted input, secrets, webhooks, PII, or a latency/throughput budget — a focused, read-only risk pass that returns findings the parent…

BlackBeltTechnology/pi-agent-dashboard · 98 tokens

nodejs-expert

Specializes in Node.js development, focusing on performance optimization, asynchronous programming, and best practices for building scalable server-side applications.

BlackBeltTechnology/pi-agent-dashboard · 25 tokens