[PR #11993] perf: reduce tool description token usage by ~69% #14018

Open
opened 2026-02-16 18:18:50 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11993

State: open
Merged: No


Summary

Condense verbose tool descriptions to reduce system prompt token overhead.

Estimated savings: ~3,000–4,000 tokens per message.

Changes

  • packages/opencode/src/tool/bash.txt — 116 → 53 lines
  • packages/opencode/src/tool/todowrite.txt — 168 → 32 lines
  • packages/opencode/src/tool/task.txt — 61 → 22 lines

Rationale

These files are included in the system prompt for every message. Reducing their length significantly cuts per-message token cost without changing tool behavior or removing safety rules.

Testing

  • Built locally (bun run build)
  • Tested TUI functionality
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11993 **State:** open **Merged:** No --- ## Summary Condense verbose tool descriptions to reduce system prompt token overhead. **Estimated savings:** ~3,000–4,000 tokens per message. ## Changes - `packages/opencode/src/tool/bash.txt` — 116 → 53 lines - `packages/opencode/src/tool/todowrite.txt` — 168 → 32 lines - `packages/opencode/src/tool/task.txt` — 61 → 22 lines ## Rationale These files are included in the system prompt for every message. Reducing their length significantly cuts per-message token cost without changing tool behavior or removing safety rules. ## Testing - Built locally (`bun run build`) ✅ - Tested TUI functionality ✅
yindo added the pull-request label 2026-02-16 18:18:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14018