big-little
v2.0.0
Published
OpenCode plugin that routes large reads to cheap worker subagents
Readme
OpenCode plugin. Big model keeps orchestration. Little worker subagents do bulk reads and boilerplate.
Contents
Requires OpenCode 2.x (tested on 2.0.16).
Install
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["big-little"]
}Restart OpenCode after install. Restart picks up config changes.
Local plugin directories need a top-level index.js/index.ts entrypoint for
OpenCode discovery; this package ships one that re-exports dist/index.js, so
both "plugins": ["/absolute/path/big-little"] and the npm package work.
Verify your install
Project plugins load when their location boots (for example on session start),
not for debug commands. With a session open in a project that enables this
plugin, run:
opencode api agent.list --param 'location[directory]=/path/to/project'Check that bulk-reader and code-writer appear with mode: "subagent" and a
permissions array (no temperature, no prompt, no bash/task actions).
This uses no model. (opencode debug config only lists config sources, and
debug agents does not reflect plugin-registered agents.)
Configuration
Every option is optional. Env vars apply only when the matching option is absent.
With options (object form):
{
"plugins": [
{ "package": "big-little", "options": { "minLines": 500 } }
]
}| Option | Env fallback | Default | Rule |
| --- | --- | --- | --- |
| minLines | BIGLITTLE_MIN_LINES, then deprecated SHUNT_MIN_LINES | 350 | Positive integer. Zero, negative, or garbage means 350. |
| bulkReaderModel | BIGLITTLE_BULK_READER_MODEL | unset (inherit caller model) | Example opencode/nemotron-3.5-lightning-free. |
| codeWriterModel | BIGLITTLE_CODE_WRITER_MODEL | unset (inherit caller model) | Same semantics. |
Model picks below are OpenCode Zen free-tier models (opencode/nemotron-3.5-lightning-free reads, opencode/mimo-v2.5-free writes), so most users already have them. Free-tier availability is limited-time — run /models in the TUI to confirm before pinning.
Examples
- Defaults only (350-line threshold, workers inherit your model):
{
"plugins": ["big-little"]
}- Custom threshold only:
{
"plugins": [{ "package": "big-little", "options": { "minLines": 500 } }]
}- Cheap bulk-reader only (the main cost saver; threshold stays 350):
{
"plugins": [{ "package": "big-little", "options": { "bulkReaderModel": "opencode/nemotron-3.5-lightning-free" } }]
}- Code-writer model only:
{
"plugins": [{ "package": "big-little", "options": { "codeWriterModel": "opencode/mimo-v2.5-free" } }]
}- Both workers pinned, default threshold:
{
"plugins": [
{
"package": "big-little",
"options": {
"bulkReaderModel": "opencode/nemotron-3.5-lightning-free",
"codeWriterModel": "opencode/mimo-v2.5-free"
}
}
]
}- Everything set:
{
"plugins": [
{
"package": "big-little",
"options": {
"minLines": 500,
"bulkReaderModel": "opencode/nemotron-3.5-lightning-free",
"codeWriterModel": "opencode/mimo-v2.5-free"
}
}
]
}Any option left out falls back to its env var, then the default (see table above). Env-only setup with zero options:
export BIGLITTLE_MIN_LINES=500
export BIGLITTLE_BULK_READER_MODEL=opencode/nemotron-3.5-lightning-free
export BIGLITTLE_CODE_WRITER_MODEL=opencode/mimo-v2.5-freeHow it works
bulk-reader flow
flowchart LR
primary["Primary agent"]
hook["execute.before hook"]
br["bulk-reader subagent"]
code[("Codebase")]
primary -- "full read, file over minLines" --> hook
hook -- "block: delegate to bulk-reader" --> br
br -- "grep / glob / narrow reads" --> code
br -- "summary + paths + line numbers" --> primary
primary -- "offset/limit re-read of edit target" --> code
primary -- "edit" --> codeTargeted reads (offset/limit set) and piped shell commands skip the hook entirely.
code-writer flow
flowchart LR
primary2["Primary agent"]
cw["code-writer subagent"]
code2[("Codebase")]
primary2 -- "spec + reference file + target path" --> cw
cw -- "read reference, match patterns" --> code2
cw -- "write finished file via edit" --> code2
primary2 -- "run tests + lint (writer has no shell)" --> code2What it does
- Registers
bulk-reader(read-only explorer) andcode-writer(boilerplate writer viaedit) throughctx.agent.transform(upsert viaeditor.update). - Blocks full-file
readover threshold viactx.tool.hook("execute.before"). Message namesbulk-readerand offersoffset/limitretry. The guard reads the V2pathkey and resolves relative paths against the calling session's directory (cached lookup, fail open). - Blocks
cat|head|tail|less|moreover threshold on theshelltool. Piped commands pass. - Targeted reads (
offsetorlimitset) always pass.
Limits
- Set a cheap worker model or you get discipline without cost saving.
- Re-read target sections with
offset/limitbefore edit. Worker line numbers can drift. - Keep debugging and architecture on the main model.
code-writercannot run shell or network. Caller runs tests and lint.- Relative paths are resolved against the calling session's directory; if that lookup fails the guard fails open to raw-path behavior.
Benchmark selection
- https://hub.harborframework.com/tasks/terminal-bench/data-anonymization
- https://hub.harborframework.com/tasks/terminal-bench/multi-source-data-merger
- https://hub.harborframework.com/tasks/swe-bench/scikit-learn__scikit-learn-14053
- https://hub.harborframework.com/tasks/swe-bench/scikit-learn__scikit-learn-14710
