Make Gemini CLI usage last longer

Gemini CLI has built-in commands to see token use and shrink context. Token caching only applies when you use an API key or Vertex AI. Each tip below cites the official doc it comes from (read 2026-10-21). We don't estimate how much each one saves; vendors don't publish that.

  1. See token counts and quota

    /stats model shows model-specific usage, including token counts and quota information.

    /stats model

    github.com checked 2026-10-21

  2. Compress long sessions

    /compress replaces the whole chat context with a summary, which the docs say saves tokens for future tasks.

    /compress

    github.com checked 2026-10-21

  3. Clear between tasks

    /clear clears the conversation context and starts a new session. Ctrl+L only clears the screen and keeps the context.

    /clear

    github.com checked 2026-10-21

  4. Reference directories, not every file

    @ with a directory passes the path so the model can inspect it with tools, without eagerly reading every nested file. Git-ignored files are excluded by default.

    @src/my_project/ Summarize the code in this directory.

    github.com checked 2026-10-21

  5. Use an API key to get token caching

    Token caching reuses system instructions and context on API key (Gemini API or Vertex AI) auth. It is not available for OAuth (Google account) users. /stats shows cached-token savings.

    export GEMINI_API_KEY=...
    /stats

    github.com checked 2026-10-21

Your plan's limits: Gemini CLI / Code Assist plans. Hit a limit? What to do. Is it down rather than limited? Status board. Other playbooks: Claude Code · Codex · Cursor · GitHub Copilot · Windsurf (Devin Desktop)
Get an email when a plan or limit changes: pick your tools and sign up on the Alerts page → or subscribe on beehiiv