Caveman mode for OpenCode 2.x: per-session mode state, ruleset injection, and a badge in the prompt footer.
Upstream caveman covers Claude Code, Codex, Cursor and OpenCode 1.x/2.x. This plugin is the OpenCode adapter only, with three differences:
- Per-session state. Upstream writes one machine-wide flag file, so two TUI windows show whichever mode was set last. State here is keyed by session.
- Badge. Upstream's OpenCode adapter has none, on the grounds that the TUI
cannot host one. V2 exposes
prompt.footer.status, so it can. - Ruleset injection at write time. The skill body goes into the session's
instruction entry instead of being re-appended to
system[]every request.
Not on npm yet. Clone and point plugins at the directory:
git clone https://github.com/chanidog/opencode-caveman.git ~/Projects/opencode-caveman| Option | Default | Meaning |
|---|---|---|
defaultMode |
unset | Seed every new session with this mode. caveman, ultracave, megacave. Unset or manual disables seeding. |
skillsDir |
~/.agents/skills |
Where <mode>/SKILL.md is read from. |
The parser's own default is caveman, matching upstream's
caveman-config.js. Seeding is separate and opt-in, so a fresh session stays
quiet until you ask for a mode.
| Input | Effect |
|---|---|
@caveman, caveman, caveman mode on, enable caveman |
caveman |
@caveman ultra, /caveman ultra, @ultracave |
ultracave |
@caveman wenyan, @megacave |
megacave |
@caveman off, caveman off, stop caveman, normal mode |
off |
@caveman status, /caveman status |
reports, changes nothing |
caveman on without mode is not a trigger. That matches upstream: only
caveman mode (on|please|now) activates.
One-shot skills (caveman-commit, caveman-review, caveman-compress) never
enter mode state, so the badge cannot stick.
CAVEMAN, ULTRACAVE, MEGACAVE in 256-color 172, the same orange as the
upstream Claude Code statusline. Off renders nothing at all.
- OpenCode 2.x. The badge needs the V2 TUI slot API; 1.x has none.
- A caveman skill installed under
skillsDir, e.g.npx skills add JuliusBrussee/caveman -g. Without it the plugin falls back to upstream's built-infallbackRuleset, which is a rule headline list, not the full skill.
Apache-2.0. parse.ts is a port of upstream caveman-parse.js; see NOTICE.