Gemini CLI uses a context window of 1,048,576 tokens (about 1 million) for Gemini models, according to the token limits in Google’s open-source Gemini CLI code; Gemma 4 models are limited to 256,000 tokens.
As of December 4, 2026, Google’s Gemini CLI documentation describes these ways to check and manage context:
- Footer: by default the footer shows the model name and context usage. To also show the percentage of the context window used, set
ui.footer.hideContextPercentagetofalse(the default istrue). - /stats model: shows model-specific usage statistics, including token counts and quota information.
- /compress: replaces the entire chat context with a summary to save tokens.
- Automatic compression:
model.compressionThresholdsets the fraction of context usage that triggers compression. The default is 0.5, and changes require a restart. - /clear: clears the conversation context and starts a new session.
Related: What is the Gemini context window?, How to change the model in Gemini CLI? and How to update Gemini CLI?
Source: Gemini CLI source, tokenLimits.ts (GitHub); Gemini CLI docs, CLI commands; Gemini CLI docs, Configuration reference
Image: Google Gemini logo by Google LLC, public domain (trademarked), via Wikimedia Commons. Placed on a white background and resized. Gemini and Google are trademarks of Google LLC. FreeAnswers is not affiliated with or endorsed by Google.