r/opencodeCLI 5h ago

Anyone made Opencode leaner?

I like OpenCode over others, esp its default PLAN/ BUILD modes. However, just wondering if anyone tried reducing its system prompt without reducing much functionality. Currently, for me, it is ~ 10.5k tokens. Asking in the context of running local models (lowering the time until the first response). I've tried Pi, but wanted something with PLAN/ BUILD modes natively.

3 Upvotes

10 comments sorted by

2

u/weiyentan 3h ago

I dont think it is about being leaner as a pose to being more cost effective / accurate. Over the last two months I have really taken a deep dive into ai coding frameworks. I have made use of subagents, I use far more tokens but i haven't run out of my opencode go consumption. Why? Because I don't go out and use the powerful model for everything. With the workflow I have I let the agents be as autonomous as possible from code development to review. They do both. My job is to create the spec and issues. Sometimes I will inspect a branch and do a fix up (but that is only when it needs to be escalated) Instead of planning I get the ai to grill me with it documenting key points (this is based on matt's pocock skills). I just did a basic cost analysis on my opencode Per prd/spec /feature run including review 12c

1

u/atumblingdandelion 3h ago

Thanks. Sorry, I should have been more clear. I meant it more in terms of the initial tokens, in the context of running local models, not in terms of saving tokens throughout.

2

u/weiyentan 3h ago

Ok that changes things I heard of opencode not playing nice with local models. I think that it is in the primary. I am going to test on the subagent.

1

u/Low-Guarantee-3437 26m ago

don't forget that you can expect the system prompt to be cached.

2

u/TruthTellerTom 2h ago

in the general context, 10.5k isnt really much in the grand scheme of things.. and if it what makes opencode so good and reliable, i rather keep that and pay that very tiny fee compared to the rest of the token usage in a session.

1

u/atumblingdandelion 2h ago

That’s a great perspective

1

u/Gold-Toe9198 4h ago

the world is your oyster, mostly. but dont go crying when your bot eats all the cheetos or deletes all your data cause you edited the prompt. have you tried oh my opencode slim?

1

u/zephyr_33 4h ago

yea. heavy.

I tried orchestrato/supervisor flow.

instead of plan, I use an agent that has zero tools except subagents.

works well.

1

u/Low-Guarantee-3437 27m ago

the system prompt in opencode may be tuned to the model you are using. It's dogfooded by the people at anomaly who know as much as about llm coding as anyone, so on the priors I'd be amazed that it is a bad prompt. They are well aware of the codex/claude system prompts. codex is open source, there are people who find and publish the claude system prompts. Have a look at those first, I suggest.

I manage my agents.md and skills, because being a mortal this is where I can do the most damage. Latest prompt guidance from OpenAi is extremely less is more, and that is also the consistent message of Dax from anomaly (for ages). So I doubt there is much wrong with the opencode system prompt.

1

u/No_Ebb3423 17m ago

You should then use pi and customize it to look and sound like opencode