{"slug": "opencode-dynamic-context-pruning", "name": "opencode-dynamic-context-pruning", "category": "ai-coding", "category_name": "AI coding tools", "description": "", "recommenders": 3, "commenters": 4, "warners": 0, "score": 2.961, "rising": 0.02, "first": "2026-03-01", "latest": "2026-09-30", "why": "It works great for long-horizon tasks, and feels like it saves a boatload of tokens.", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 5, "neutral": 0, "compare": 1, "warn": 0}, "spark": [0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "It works great for long-horizon tasks, and feels like it saves a boatload of tokens.", "kind": "", "icon": true, "domain": null, "github_repo": "github.com/opencode-dcp/opencode-dynamic-context-pruning", "official_url": "https://github.com/opencode-dcp/opencode-dynamic-context-pruning", "pricing": "", "aliases": ["opencode-dynamic-context-pruning", "Dynamic Context Pruning"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 798522257, "item_id": 49907641, "url": "https://news.ycombinator.com/item?id=49907641", "by": "cyanydeez", "date": "2026-09-30", "version": null, "stance": "recommend", "quote": "So i've taken https://github.com/Tarquinen/opencode-dynamic-context-pruning and started improving it.", "excerpt": "running local models, now with Qwen3.8-Flash-Next, they have 256k, but when they get up there their speed is just too slow. So i've taken https://github.com/Tarquinen/opencode-dynamic-context-pruning and started improving it. It already worked well to get a lot of mileage out of just taking tool calls, code modifications, etc, and dumping them in favor of a summary. But they'd still inevitably get to long in the toot", "context": "", "use_case": "", "switched_from": "", "story": "You said no MCP"}, {"id": 795191120, "item_id": 49699445, "url": "https://news.ycombinator.com/item?id=49699445", "by": "cyanydeez", "date": "2026-09-14", "version": null, "stance": "recommend", "quote": "this and openviking appear to be all I need to get a proper 'do anything' setup.", "excerpt": "this is what I use: https://github.com/Opencode-DCP/opencode-dynamic-context-pruning ; this and openviking appear to be all I need to get a proper 'do anything' setup.", "context": "", "use_case": "context pruning for coding agent", "switched_from": "", "story": "Notes on gotchas while migrating 35kb preprompts from Opus to self-hosted Ollama"}, {"id": 782136608, "item_id": 48883538, "url": "https://news.ycombinator.com/item?id=48883538", "by": "bigyabai", "date": "2026-07-12", "version": null, "stance": "recommend", "quote": "It works great for long-horizon tasks, and feels like it saves a boatload of tokens.", "excerpt": "I recommend that Opencode users try Dynamic Context Pruning as well: https://github.com/Opencode-DCP/opencode-dynamic-context-pruning It works great for long-horizon tasks, and feels like it saves a boatload of tokens.", "context": "OpenCode user", "use_case": "saving tokens in OpenCode", "switched_from": "", "story": "Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k"}, {"id": 776921409, "item_id": 48557588, "url": "https://news.ycombinator.com/item?id=48557588", "by": "cyanydeez", "date": "2026-06-16", "version": null, "stance": "recommend", "quote": "I manage it with dynamic context pruning", "excerpt": "I don't really think you're making reasonable decisions at that size; but I suppose if you're not allowed to refactor it, maybe. I think the way these models work excludes sane behaviors the larger the context gets as each token introduces potential ambiguities between \"USER\" and \"SYSTEM\" messages leading to all the catastrophic behaviors. Anyway, with AMD395+ I'm finding ~100k is both speed and context usefulness un", "context": "", "use_case": "Context pruning for opencode", "switched_from": "", "story": "Running local models is good now"}, {"id": 773533553, "item_id": 48345847, "url": "https://news.ycombinator.com/item?id=48345847", "by": "cyanydeez", "date": "2026-05-31", "version": null, "stance": "recommend", "quote": "It allows the model to remove context pollution.", "excerpt": "opencode has a plugin for similar work: https://github.com/Opencode-DCP/opencode-dynamic-context-pruning It allows the model to remove context pollution.", "context": "", "use_case": "Pruning agent context", "switched_from": "", "story": "Cache hit rates of Inference are more meaningful than the headline costs"}]}], "caveats": [], "who": [{"by": "bigyabai", "context": "OpenCode user", "url": "https://news.ycombinator.com/item?id=48883538", "date": "2026-07-12"}], "tags": [], "use_cases": ["context pruning for coding agent", "saving tokens in opencode", "context pruning for opencode", "pruning agent context", "long opencode sessions", "context pruning in opencode"], "compared": [{"slug": "opencode", "name": "OpenCode", "co": 4, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=49906637", "title": "You said no MCP", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49697014", "title": "Notes on gotchas while migrating 35kb preprompts from Opus to self-hosted Ollama", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48883275", "title": "Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48555993", "title": "Running local models is good now", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48343690", "title": "Cache hit rates of Inference are more meaningful than the headline costs", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47677853", "title": "GLM-5.1: Towards Long-Horizon Tasks", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {}, "2026-01": {}, "2026-02": {}, "2026-03": {"compare": 1}, "2026-04": {"recommend": 1}, "2026-05": {"recommend": 1}, "2026-06": {"recommend": 1}, "2026-07": {"recommend": 1}, "2026-08": {}, "2026-09": {"recommend": 1}, "2026-10": {}}, "versions": [], "version_unnamed": 0, "family_ref": null, "runs_on": null, "lines": [], "quotes": [{"id": 798522257, "item_id": 49907641, "url": "https://news.ycombinator.com/item?id=49907641", "by": "cyanydeez", "date": "2026-09-30", "version": null, "stance": "recommend", "quote": "So i've taken https://github.com/Tarquinen/opencode-dynamic-context-pruning and started improving it.", "excerpt": "running local models, now with Qwen3.8-Flash-Next, they have 256k, but when they get up there their speed is just too slow. So i've taken https://github.com/Tarquinen/opencode-dynamic-context-pruning and started improving it. It already worked well to get a lot of mileage out of just taking tool calls, code modifications, etc, and dumping them in favor of a summary. But they'd still inevitably get to long in the toot", "context": "", "use_case": "", "switched_from": "", "story": "You said no MCP"}, {"id": 795191120, "item_id": 49699445, "url": "https://news.ycombinator.com/item?id=49699445", "by": "cyanydeez", "date": "2026-09-14", "version": null, "stance": "recommend", "quote": "this and openviking appear to be all I need to get a proper 'do anything' setup.", "excerpt": "this is what I use: https://github.com/Opencode-DCP/opencode-dynamic-context-pruning ; this and openviking appear to be all I need to get a proper 'do anything' setup.", "context": "", "use_case": "context pruning for coding agent", "switched_from": "", "story": "Notes on gotchas while migrating 35kb preprompts from Opus to self-hosted Ollama"}, {"id": 782136608, "item_id": 48883538, "url": "https://news.ycombinator.com/item?id=48883538", "by": "bigyabai", "date": "2026-07-12", "version": null, "stance": "recommend", "quote": "It works great for long-horizon tasks, and feels like it saves a boatload of tokens.", "excerpt": "I recommend that Opencode users try Dynamic Context Pruning as well: https://github.com/Opencode-DCP/opencode-dynamic-context-pruning It works great for long-horizon tasks, and feels like it saves a boatload of tokens.", "context": "OpenCode user", "use_case": "saving tokens in OpenCode", "switched_from": "", "story": "Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k"}, {"id": 776921409, "item_id": 48557588, "url": "https://news.ycombinator.com/item?id=48557588", "by": "cyanydeez", "date": "2026-06-16", "version": null, "stance": "recommend", "quote": "I manage it with dynamic context pruning", "excerpt": "I don't really think you're making reasonable decisions at that size; but I suppose if you're not allowed to refactor it, maybe. I think the way these models work excludes sane behaviors the larger the context gets as each token introduces potential ambiguities between \"USER\" and \"SYSTEM\" messages leading to all the catastrophic behaviors. Anyway, with AMD395+ I'm finding ~100k is both speed and context usefulness un", "context": "", "use_case": "Context pruning for opencode", "switched_from": "", "story": "Running local models is good now"}, {"id": 773533553, "item_id": 48345847, "url": "https://news.ycombinator.com/item?id=48345847", "by": "cyanydeez", "date": "2026-05-31", "version": null, "stance": "recommend", "quote": "It allows the model to remove context pollution.", "excerpt": "opencode has a plugin for similar work: https://github.com/Opencode-DCP/opencode-dynamic-context-pruning It allows the model to remove context pollution.", "context": "", "use_case": "Pruning agent context", "switched_from": "", "story": "Cache hit rates of Inference are more meaningful than the headline costs"}, {"id": 762863120, "item_id": 47678945, "url": "https://news.ycombinator.com/item?id=47678945", "by": "cassianoleal", "date": "2026-04-07", "version": null, "stance": "recommend", "quote": "I've done some very long sessions on OpenCode with Dynamic Context Pruning. Highly recommend it.", "excerpt": "I've done some very long sessions on OpenCode with Dynamic Context Pruning. Highly recommend it. https://github.com/Opencode-DCP/opencode-dynamic-context-pruning", "context": "", "use_case": "long OpenCode sessions", "switched_from": "", "story": "GLM-5.1: Towards Long-Horizon Tasks"}, {"id": 755281489, "item_id": 47205093, "url": "https://news.ycombinator.com/item?id=47205093", "by": "WesBrownSQL", "date": "2026-03-01", "version": null, "stance": "compare", "quote": "It seems more aggressive.", "excerpt": "I've been running https://github.com/rtk-ai/rtk for a week seems to be a good balance between culling out of context and not just killing everything. I've been running https://github.com/Opencode-DCP/opencode-dynamic-context-pruning in opencode as well. It seems more aggressive.", "context": "", "use_case": "Context pruning in OpenCode", "switched_from": "", "story": "Stop Burning Your Context Window \u2013 How We Cut MCP Output by 98% in Claude Code"}]}