r/opencodeCLI • u/FallElectronic3774 • 20d ago
what's actually in your opencode.json? (configs that made a real difference)
trying to put together a setup that doesn't fight me, and half the config options i only find out about after someone else mentions them.
so, what's in yours?
specifically curious about: - different models for plan vs build, or one model for everything? - custom agents/commands you actually use every day, not the ones you set up once and forgot - permission rules that stopped a bad command before it ran - anything that helps on bigger repos where context gets eaten fast
post yours even if it's boring. the boring ones are usually the ones that work.
1
u/Any_Flounder8768 20d ago
Disclosure: I wrote the tool below. For the "context gets eaten fast" part, what made the biggest difference for me on long sessions with a local model was a proxy between opencode and the engine (mnemonic-proxy): old tool outputs leave the prompt as one-line receipts, the originals stay verbatim on disk, and the model can pull them back with a recall tool. On the opencode side it's just a provider, plus turning opencode's own compaction off so two context managers don't fight. Trimmed from the config I tested:
Two gotchas on opencode 1.19.5: the schema marks `provider` + `npm` as deprecated, but the newer `providers` + `package` form made the model disappear from `opencode models` for me, so I stayed on the old one; and `limit.context` should be the engine's real window. Measured on one 1 h 32 min opencode session on Strata: 554 requests, no compaction. It's built mainly for local engines; in front of a hosted OpenAI-compatible API it still masks and recalls, but without saved engine state.
https://github.com/lastreload/mnemonic-proxy
1
u/SirRobinBlibs 20d ago
The ones that changed behaviour for me more than model tweaks: an explicit permission.bash deny for anything that can leave the box (curl/wget/npm install without a pin),
tool_outputlimits so the agent reads the truncated file instead of re-running the build, and a short AGENTS.md rule that says "if output was truncated, open the saved file, don't re-run." Everything else I add only after it stops a real mistake twice.1
u/tedivm 20d ago
I keep mine on GitHub. Honestly the AGENTS.md, global skills, and commands have a much bigger impact than the json file.
1
u/squirrelscrush 20d ago
I have a detailed one. I keep my model configs, permissions, MCP auth, plugins, etc in it.
Here's my setup: https://pastebin.com/zaRRYxcY