anomalyco / anomalyco/opencode
Fresh chat sends ~42,000 input tokens before user types anything
@nexxeln is already working on this.
Since Jul 21, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
A brand new session (no previous conversation, no project history) appears to send approximately 30,000+ input tokens before any meaningful interaction.
The only user message is: hi
Yet the provider reports roughly 30k+ input tokens.
This happens consistently on a fresh session.
Expected behavior
A new session should send only the base system prompt and essential context, which should be much smaller.
Actual behavior
The provider receives approximately 30k+ input tokens on the first request.
This causes providers with lower TPM limits (for example Groq) to immediately reject requests due to rate limits, even though the conversation is empty.
Environment
- OpenCode: 1.18.3
- Provider: Groq
- Fresh session
- No conversation history
Additional information
This seems unrelated to conversation history since it occurs immediately in a new chat.
It would be helpful to expose a breakdown of the generated prompt (system prompt, tool schemas, agent prompt, instructions, etc.) to identify which component contributes most of the tokens.
Plugins
none
OpenCode version
1.18.4
Steps to reproduce
in termux type opencode.
selec model as llama-3.1-8b- instant or get oss.
type hi.
Screenshot and/or share link
Operating System
proot-distro ubuntu Linux 6.17
Terminal
termux on Android
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.