@rontian/opencode-likecodex
v0.1.0
Published
An OpenCode plugin that reduces noisy intermediate output and keeps user-facing responses concise.
Maintainers
Readme
opencode-likecodex
opencode-likecodex is an OpenCode plugin that makes CLI sessions cleaner and more concise:
- less noisy final/tool output
- fewer raw tool logs
- tighter session compaction
- concise user-facing final answers
What it can do today
Based on the OpenCode plugin hooks currently documented and typed in @opencode-ai/plugin, this plugin can reliably intercept and influence:
- chat system prompt construction
- chat message history before the model call
- session compaction prompt generation
- tool execution output after a tool finishes
- event notifications for messages, tools, and session lifecycle
That gives us strong control over:
- reducing visible verbosity by policy
- shrinking tool output before it propagates
- keeping future turns focused by compacting the right context
Important boundary
OpenCode's current plugin surface appears to provide strong request-side and tool-side hooks, but not a documented "rewrite the already-streaming assistant answer" hook.
In practice, this plugin can:
- strongly steer the model away from exposed chain-of-thought
- compress tool noise
- improve compacted memory
- improve concise execution and final output quality
It cannot reliably hide CLI/TUI Thinking blocks or other UI-layer narration after they start rendering.
Current behavior
The current version implements these controls:
- Appends a strict visible-output policy to the system prompt.
- Caps overly long model outputs through
chat.params. - Removes
reasoningparts from assistant history before future model calls. - Optionally drops synthetic or ignored assistant text from reused history.
- Truncates oversized tool outputs after execution.
- Truncates stored assistant/tool text before it is reused in later turns.
- Refines session compaction so it preserves only goals, decisions, validation, and pending work.
- Optionally disables automatic post-compaction continue in strict mode.
Modes
Two modes are built in:
balancedKeeps more context and is safer as a default for daily use.strictCompresses harder, drops more intermediate text, and is better when you want the cleanest visible UX.
Configuration
You can pass plugin options through opencode.json when using the npm-installed variant:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
[
"@rontian/opencode-likecodex",
{
"mode": "strict",
"maxToolChars": 1200,
"maxToolLines": 18,
"dropSyntheticAssistantText": true,
"disableAutocontinueOnOverflow": true
}
]
]
}Supported options:
mode:balancedorstrictmaxToolCharsmaxToolLinesmaxHistoryTextCharsmaxHistoryTextLinesmaxCommandCharsmaxCommandLinescapMaxOutputTokensdropReasoningHistorydropSyntheticAssistantTextdropIgnoredTextdisableAutocontinueOnOverflowdebugSummaries
Install locally
Build the package:
npm install
npm run buildPreview the current summarization behavior locally:
npm run demoReplay the message-history transforms locally:
npm run replayThen use one of these approaches:
Local plugin directory
Place the built plugin where OpenCode loads local plugins, such as:
.opencode/plugins/~/.config/opencode/plugins/
npm plugin
Publish this package to npm, then reference it in opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@rontian/opencode-likecodex"]
}OpenCode should install it automatically on startup using Bun.
Project-local testing
This repository already includes a project-local plugin entrypoint:
.opencode/plugins/opencode-likecodex.js
That file re-exports the built plugin from dist/index.js, so for local testing you only need:
npm install
npm run buildThen start OpenCode from this project directory.
Load marker
When the plugin is active, it injects these environment variables into shell tool execution:
OPENCODE_LIKECODEX_ACTIVE=1OPENCODE_LIKECODEX_MODE=balancedorstrict
That gives you a lightweight way to confirm the plugin is loaded during local testing.
Recommended use with oh-my-openagent
If you run OpenCode with an additional agent/profile layer such as oh-my-openagent, this plugin works best as a helper layer:
- use it to compress tool output
- use it to keep final answers shorter
- use it to clean history before later turns
Do not expect it to fully suppress:
- top-of-screen mode banners
- CLI/TUI
Thinkingblocks - narration emitted directly by the active agent profile
Publish
npm login
npm publishRecommended before publishing:
- verify the package builds cleanly
- test it in a local OpenCode install
- document the exact OpenCode version you validated against
Status
This repository is currently best treated as a practical CLI output-polish plugin, not a full Codex-style UI replacement.
It is a good fit when you want:
- shorter final answers
- less noisy tool output
- cleaner reused history in later turns
It is not a full fit when you want:
- hidden CLI/TUI
Thinkingblocks - hidden top-of-screen agent/profile banners
- full control over narration emitted by another agent layer
