← All notes

Gemini CLI and OpenCode cap tool result size before it fills the context

Answer: Large tool outputs can be truncated.

Gemini CLI

The tools.truncateToolOutputThreshold setting is the maximum characters to show when truncating large tool outputs. The default is 40000. Set to 0 or negative to disable truncation.

OpenCode

Set the maximum number of lines and bytes retained from a tool result. The example config uses tool_output with max_lines 2000 and max_bytes 51200.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: google-gemini/gemini-cli (GitHub), Gemini CLI settings, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE). Copyright (c) Google LLC; anomalyco/opencode (GitHub), Configuration (OpenCode docs), MIT (https://raw.githubusercontent.com/anomalyco/opencode/dev/LICENSE). Copyright (c) 2025 opencode. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: google-gemini/gemini-cli (GitHub), Gemini CLI settings, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE). Copyright (c) Google LLC; anomalyco/opencode (GitHub), Configuration (OpenCode docs), MIT (https://raw.githubusercontent.com/anomalyco/opencode/dev/LICENSE). Copyright (c) 2025 opencode.

Cite this

Permanent ID: iil:note:7x3bzxk3

iinventedlight. 2026. "Gemini CLI and OpenCode cap tool result size before it fills the context." iinventedlight Library, iil:note:7x3bzxk3, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-tool-result-truncation/. License: CC-BY-4.0.

@misc{iil_note_7x3bzxk3,
  author = {{iinventedlight}},
  title = {{Gemini CLI and OpenCode cap tool result size before it fills the context}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/ao-tool-result-truncation/},
  note = {Permanent ID iil:note:7x3bzxk3. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-tool-result-truncation.md.