Skip to content

About

Some opencode plugins to bring back the claude code features that I miss most.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

Repository files navigation

OpenCode Productivity Plugin

Scheduled wakeups, background command management, context analysis, and prompt history search for OpenCode 2.

Context usage

Enter /oc-context in a session to inspect the last model request. The overview shows estimated tokens and percentages for the system prompt, AGENTS.md and other instruction files, available and loaded skills, tool definitions, user and assistant messages, tool calls/results, and compaction or provider state when present. The scrollable text report includes instruction files and individual tools, sorted by size, together with the model, capture time, and context limit when available. Use the arrow keys, Page Up/Page Down, or mouse wheel to scroll; Escape closes the report.

This command runs locally without sending a model request. Counts use one token per four Unicode characters, not a model tokenizer; message framing and media token costs are excluded, and opaque provider state cannot be measured accurately. Categories describe recognizable sections at this plugin's context hook; subsequent plugin changes are excluded. The snapshot precedes the response, so new output and pending composer edits are excluded. Send another message to refresh it.

Only aggregate counts and source/tool names are kept in server memory, for up to 100 sessions per location. No prompt bodies are retained. After a server/plugin restart, a session needs another request before /oc-context has a snapshot.

Install

Requires a Unix-like system, OpenCode 2.0.16, and Node.js 26 or newer.

git clone https://github.com/jia-kai/opencode-productivity.git
cd opencode-productivity
npm install
npm run link
opencode

npm run link builds the plugin, installs it globally, and restarts the OpenCode background service. Restart any open OpenCode TUI afterward. Keep this checkout in place: the installed plugin points to its compiled files. To apply source updates, run npm run link again.

Tools

Wakeups

Ask the agent to resume a task later—for example, “Check the build again in five minutes.” Wakeups send a message to the session that scheduled them and can run once or repeat.

Agent tool Purpose
ScheduleWakeup Schedule by time (runAt) or delay (delaySeconds), with optional repeatSeconds.
ListWakeups Show wakeups and their status.
CancelWakeup Cancel a wakeup by ID or name.

Active timers appear in the sidebar. Use /oc-timers to view or cancel them. Timers are lost when the OpenCode server stops.

Background commands

Run a command with OpenCode's built-in shell tool using background: true, or press Ctrl+B while a shell command is running. Running commands appear in the sidebar and in the agent's context.

Agent tool Purpose
ListBackgroundCommands List the current session's running commands, shell IDs, PIDs, and output files.
KillBackgroundCommand Stop a command and its process tree by shell ID.

Use /oc-background to view commands and stop one after confirmation. Stopping a command also deletes its captured output file.

Background management requires the normal OpenCode background service; --standalone servers are unsupported. Only commands observed while the plugin is active are tracked. Processes detached by scripts with & are not managed.

Prompt history

Press Ctrl+R or enter /oc-history words to find to search previous prompts. Search uses complete words and requires every word to match. Results appear newest first; selecting one inserts it into the composer for editing without sending it.

Search covers up to 4,096 recent manually entered prompts in the local OpenCode database, even when connected to a remote server. Set OPENCODE_HISTORY_DB to use a different database path.

About

Some opencode plugins to bring back the claude code features that I miss most.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages