@old-mikser/occontext-thinking-trimOpenCode plugin to trim thinking/reasoning from context to reduce token usage
0
28
11 in 7 days
6.7
Multi-signal model
6 months ago
2026-02-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": ["@old-mikser/occontext-thinking-trim@1.0.3"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@old-mikser/occontext-thinking-trim@1.0.3"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @old-mikser/occontext-thinking-trimopencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
OpenCode plugin that trims thinking/reasoning from context while preserving display.
Why?
Models with extended thinking (Claude, DeepSeek, etc.) send reasoning back in context on each request. This can:
- Increase token usage
- Potentially influence model behavior in unwanted ways
This plugin removes reasoning from the context sent to the model, while keeping it visible in the UI.
Installation
Add to your opencode.json:
{
"plugins": ["@old-mikser/occontext-thinking-trim"]
}
On first run, the plugin creates ~/.config/opencode/OCTT.jsonc with default settings.
Configuration
Edit ~/.config/opencode/OCTT.jsonc:
{
// Enable or disable thinking trim
"enabled": true,
// Number of recent turns to preserve thinking
// 0 = trim all thinking from context
// 2 = keep thinking in last 2 assistant messages
"keepTurns": 0
}
Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable/disable the plugin |
keepTurns |
number | 0 |
Number of recent turns to preserve thinking. 0 = trim all |
Example
With keepTurns: 2, the last 2 assistant messages will keep their reasoning intact, while older reasoning is removed.
License
MIT