← All notes

Gemini CLI compaction: /compress and compressionThreshold

Answer: The model.compressionThreshold setting is the fraction of context usage at which compression triggers. The /compress command replaces the entire chat context with a summary.

Automatic trigger

model.compressionThreshold is the fraction of context usage at which to trigger context compression (for example 0.2 or 0.3). The default is 0.5, and a change requires a restart.

Manual trigger

/compress replaces the entire chat context with a summary. This saves tokens for future tasks while retaining a high level summary of what has happened.

Related knob

model.summarizeToolOutput enables summarization of tool output with per-tool token budgets; currently only the run_shell_command tool supports summarization.

Artifacts

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: GitHub repository docs under Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0) or MIT License (https://opensource.org/licenses/MIT), as listed per source; copyright notices remain with the original authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Google Gemini CLI docs (GitHub), Gemini CLI configuration, Apache-2.0 (google-gemini/gemini-cli LICENSE); Google Gemini CLI docs (GitHub), CLI commands, Apache-2.0 (google-gemini/gemini-cli LICENSE).

Cite this

Permanent ID: iil:note:gjhhjyb0

iinventedlight. 2026. "Gemini CLI compaction: /compress and compressionThreshold." iinventedlight Library, iil:note:gjhhjyb0, version of 2026-11-09. https://iinventedlight.com/library/notes/ao-compaction-gemini-cli-compress/. License: CC-BY-4.0.

@misc{iil_note_gjhhjyb0,
  author = {{iinventedlight}},
  title = {{Gemini CLI compaction: /compress and compressionThreshold}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-09},
  url = {https://iinventedlight.com/library/notes/ao-compaction-gemini-cli-compress/},
  note = {Permanent ID iil:note:gjhhjyb0. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-compaction-gemini-cli-compress.md.