metacogs
Explicit, testable reasoning methods packaged as portable Agent Skills. Each method is a short written procedure plus a helper that validates and stores a decision record. A method is included only after an eval shows it changes what a model does on tasks where it should apply, and stays silent on tasks where it should not. The package is also an OpenCode plugin, a Claude Code plugin and an experimental Codex plugin.
Stance
Altered cognition and jailbreak framing are not objectives of this project. It reinterprets the concepts from inanna-malick/metacog as ordinary, inspectable procedures: a structured choice, then a response that redirects work. A method structures the model's own reasoning; nothing in it enforces anything. Upstream attribution is in Attribution.
The OpenCode plugin keeps upstream's tool names, including drugs. Here drugs is a handle for a deliberate change of approach: the model names a substance as a short label and says what it will do differently on the next attempt. It does not change the model, adds no capability, and nothing in this project claims it improves results. feel is a pause on an unnamed tension. Neither supplies facts or checks anything.
Install
Copy a skill directory to a path your host scans:
mkdir -p .agents/skills
cp -R <metacogs-clone>/skills/synthesis .agents/skills/synthesis
cp -R <metacogs-clone>/skills/counterfactual .agents/skills/counterfactual
.agents/skills/ works for OpenCode, Pi, and Codex. Claude Code reads .claude/skills/ only. Per-host paths, listing commands, and the smoke evidence are in docs/install.md.
- Helper runtime. The record helper is one dependency-free file that needs Node 22 or newer. The agent runs it with
node; no install step. The Claude Code and Codex plugins write records through a record tool instead, and ship no helper.
- Records. Records go to
$XDG_STATE_HOME/metacogs/records/ (default ~/.local/state/metacogs/records/), outside your repository. METACOGS_RECORDS_DIR or --out-dir overrides it. To keep records in a project, opt in with METACOGS_RECORDS_DIR=.metacogs/records and add .metacogs/records/ to .gitignore.
unrecorded. If the helper cannot run (no Node 22, a denied shell command, an unwritable directory), the skill says no record was written and the run is marked unrecorded. It never claims a record that does not exist.
OpenCode plugin
metacogs is also an OpenCode plugin. It adds:
- Two tools,
feel and drugs. Their descriptions and return text are adapted from upstream. feel pauses on a tension that has no name yet. drugs states a deliberate change of approach for the next attempt. Neither supplies facts, checks anything, or guarantees a result.
- Four skills:
feel, drugs, synthesis and counterfactual. Typed /feel and /drugs run the first two, with or without arguments (/drugs caffeine). On OpenCode v2 all four skills are slash commands. The feel and drugs skills have the same names as the tools but are separate: a skill is instructions the model loads, and a tool is what it calls. The skills say when to call each tool and how to fill its fields, and /feel loads the skill, which then has the model call the tool. synthesis and counterfactual are the methods described below; the plugin loads them from the package, so no copy under .agents/skills/ is needed.
- A guidance block of a few lines in the system prompt of normal requests (not the host's title and summary calls). It names the tools and skills and the situations each one fits, and does not require their use. To keep the tools and skills and drop the block:
{ "plugin": [["metacogs", { "guidance": false }]] }
On OpenCode v2 the same option is { "plugins": [{ "package": "metacogs", "options": { "guidance": false } }] }.
Plugin install
Add the package to plugin in opencode.json (project) or ~/.config/opencode/opencode.json (user):
{ "plugin": ["metacogs"] }
OpenCode v2 reads a plugins key instead:
{ "plugins": [{ "package": "metacogs" }] }
OpenCode installs the package on the next start. The supported versions are OpenCode 1.19.4 and later 1.x, and 2.2.0 and later 2.x; older versions are unsupported. It is tested on OpenCode 1.19.4, and CI runs the contract suite on the OpenCode v2 CLI pinned in package.json (testedWith).
On OpenCode v1, typed /feel and /drugs run the skills, but the TUI / popup lists only commands that are not skills. On v2, multi-word arguments arrive as typed, unquoted. A skill denied by permissions is still delivered when typed as a slash command; the permissions array form is in docs/install.md.