research

A command that researches a coding task in the repository and writes the findings to a dated research document.

In plain words
What is it for?
Investigating how a codebase works and recording the information needed to plan a task.
Why use it?
It collects relevant files, code flow, conventions, and constraints before implementation begins.

Command

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 commands/mazumba/opencode-dockerized/research
Clone the repo
git clone --depth 1 https://github.com/mazumba/opencode-dockerized
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 644 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00018 $0.00644
Opus 5 $0.00009 $0.00322
Sonnet 5 $0.00004 $0.00129
Haiku 4.5 $0.00002 $0.00064

Measured yesterday against content hash 3d4f860e405c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

research 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 yesterday.

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.

.opencode/config/commands/research.md · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Research the codebase for the following task and write a structured research document: $ARGUMENTS

What to do

Derive a short slug from the task description (lowercase, hyphens, max 40 chars). Determine today's date using the shell: date +%Y-%m-%d The artifact folder is: docs/thoughts/<YYYY-MM-DD>_<slug>/ Create that folder and write your output to docs/thoughts/<YYYY-MM-DD>_<slug>/research.md.

Before searching the codebase, read AGENTS.md in full, load any relevant skills from .opencode/skills/, and check docs/ for any tooling workarounds related to the task.

Prefer the explore subagent for file discovery and code reading tasks to keep this context clean. If explore is unavailable in this execution context (for example, inside a subtask agent), use direct tools (glob/grep/read) without asking for fallback confirmation.

Investigate and record:

  • Relevant files and their responsibilities
  • Information flow (which code calls which, in what order)
  • Existing patterns the implementation must follow (entity conventions, form patterns, controller style, etc.)
  • Constraints and gotchas from Session Learnings or skill files that apply
  • Quality gate implications (migrations needed? new deps? fixture changes?)

Write research.md using this structure (target ~150–200 lines):

# Research: <task description>

## Problem Summary
<2-3 sentences on what needs to be done and why>

## Relevant Files
<list of files with a one-line description of their role in this task>

## Information Flow
<narrative or bullet list describing how data/control flows through the relevant code>

## Key Findings
<bullet list of the most important discoveries — patterns, constraints, gotchas>

## Recommended Approach
<1-2 paragraphs on the approach the plan should take, based on findings>

## Open Questions
<any ambiguities that need human input before planning>

Rules you must follow

  • No code changes. Your only output is the research document.
  • For codebase reading use direct tools (glob/grep/read).
  • Read AGENTS.md first before touching the codebase.
  • Load relevant skills before forming any conclusions about patterns or conventions.
  • Open Questions must be honest. If anything is ambiguous, list it — do not guess.

Read the full file on GitHub · 66 lines

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. yesterday First seen · 66 lines · 18 tokens per session scan A 3d4f860e405c

Subscribe to this mod's changes

research is a command published in the GitHub repository mazumba/opencode-dockerized (5 stars, last pushed 4d ago), licensed MIT. It adds 18 tokens to every session and 644 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.