opencode-leaner plugin prunes coding agent context from ~10.3k to ~1.3k tokens
laerciosantana · reddit · 2026-10-06
Developer laerciosantana dug into how opencode builds its context and shipped the open-source plugin opencode-leaner to prune it for small-context local LLMs.
Key findings:
- opencode context = environment message + agent prompt + agent.md instructions + skills descriptions + tool descriptions, and it's highly customizable
- A blank agent (no agent.md, no tools) starts at just 220 tokens
- A bash-only, mini-swe-agent-style agent cuts baseline context from 10.3k to 1.3k tokens; a pi-like agent gets 5.5k
- The author also removed overlapping and out-of-scope tool instructions (e.g. GitHub PR/issue guidance inside the bash tool description)
Install: {"plugin": ["opencode-leaner"]}. Very useful for running coding agents on local small-context models.
More from coding & agent
- Solo dev ships real client work in 36 hours orchestrating Grok Bot with a multi-agent team — alexcovo_eth · 2026-10-06
- FlowBank (NeurIPS 2026): precomputed workflow portfolios give agents query-level adaptivity at task-level cost — furongh · 2026-10-06
- Dev vibe codes a browser CS2 remake in one week, runs smooth on weak GPUs — TAbrodi · 2026-10-06
- SkillGym: Fine-Tuning on Verified Skill Runs Lifts Terminal-Bench 2.1 Success by 19 Points — rohanpaul_ai · 2026-10-06
- PinkWallet ships an MCP server that gates agent payments against business rules before money moves — No_Brief_5075 · 2026-10-06
- Security Engineer's Month-Long 180 on Vibecoding: From 'Ew' to 'Incredible' — eschadiol · 2026-10-06