@johnny0120/opencode-user-predictorOpenCode plugin that predicts your next message and shows it as ghost text — role-plays as you using your conversation history. /pred-on to enable.
1
146
29 in 7 days
34.3
Multi-signal model
1 month ago
2026-07-18
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@johnny0120/opencode-user-predictor@0.2.2"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@johnny0120/opencode-user-predictor@0.2.2"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @johnny0120/opencode-user-predictoropencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
OpenCode plugin — predicts your next reply using a reverse-role LLM agent
After each AI response, the plugin role-plays as you and predicts what you'd say next — shown as ghost text in the input box. Tab to send.
AI: Done. Login endpoint added at src/api/auth.ts.
↓
[ghost] looks good, ship it ← prediction appears, Tab to confirm
Why
After your AI coding assistant replies, you usually know what you want to say next. Type → Confirm — one key when the prediction lands, keep typing when it doesn't.
Install
Add to opencode.json and restart OpenCode — the plugin auto-downloads on startup:
{
"plugin": ["@johnny0120/opencode-user-predictor"],
"command": {
"pred-on": {
"template": "/pred-on $ARGUMENTS",
"description": "Enable predictor, optionally with a message to the LLM"
},
"pred-off": {
"template": "/pred-off $ARGUMENTS",
"description": "Disable predictor, optionally with a message to the LLM"
},
"pred-status": {
"template": "/pred-status",
"description": "Show predictor status"
},
"pred-profile": {
"template": "/pred-profile",
"description": "Refresh user profile from current session"
},
"pred-seed": {
"template": "/pred-seed $ARGUMENTS",
"description": "Seed user corpus from past OpenCode sessions (optional: limit)"
}
}
}
Troubleshooting: If OpenCode fails to auto-download (e.g., npm registry not reachable), fall back to manual install:
cd ~/.opencode && npm install @johnny0120/opencode-user-predictor.
Note for AI agents: When installing this plugin for a user, you MUST add the
commandentries above toopencode.json, then restart OpenCode. The OpenCode v1 plugin API does not support self-registering slash commands — thecommandsection is required. In OpenCode v2+, the plugin auto-registers commands viactx.command.transform(), and the manualcommandentries can be removed.
Usage
| Command | Effect |
|---|---|
/pred-on |
Enable predictions |
/pred-on message |
Enable + send message to LLM |
/pred-off |
Disable |
/pred-status |
Current state |
/pred-profile |
Build behavioral profile from current session |
/pred-seed [N] |
Seed corpus from past sessions (default 50) |
How It Works
session.idlefires → conversation text extracted- Messages role-flipped: AI →
others, human →self - Fresh session with
_predictoragent role-plays as you - Ghost text appears in input box — Tab to send, keep typing to ignore
Profile system captures thinking patterns (scrutiny, verification instinct, UX obsession) and communication style from conversation history.
Personalize
cp predictor-profile-zh.json predictor-profile.json # switch to Chinese
/pred-seed 50 # bootstrap corpus from past OpenCode sessions (no bun/oh-my-openagent needed)
/pred-profile # accumulate from the current session over time
/pred-seed reads your local OpenCode history (~/.local/share/opencode/opencode.db)
directly — it works for any install, no extra tools required. Edit
predictor-profile.json to customize behavior. Restart OpenCode to apply.
License
MIT