Skip to content

docs(cli): clarify that /clear resets the conversation context#27583

Open
Pluviobyte wants to merge 1 commit into
google-gemini:mainfrom
Pluviobyte:docs/clarify-clear-resets-context
Open

docs(cli): clarify that /clear resets the conversation context#27583
Pluviobyte wants to merge 1 commit into
google-gemini:mainfrom
Pluviobyte:docs/clarify-clear-resets-context

Conversation

@Pluviobyte
Copy link
Copy Markdown

@Pluviobyte Pluviobyte commented May 30, 2026

Summary

The /clear command reference only documented clearing the terminal screen. It did not mention that /clear (and its /new alias) also resets the agent's conversation context and starts a new session, so users were left unsure how to start a fresh thread without context pollution.

Details

clearCommand (packages/cli/src/ui/commands/clearCommand.ts) calls geminiClient.resetChat() and config.resetNewSessionState(...). These reset the conversation context the model sees and start a new session — not just the visible output.

In contrast, the Ctrl+L shortcut maps to CLEAR_SCREEN (handleClearScreen), which only clears the visible items (historyManager.clearItems()) and does not reset the conversation. The previous wording implied Ctrl+L was equivalent to /clear.

This PR updates docs/reference/commands.md:

  • Clarifies that /clear clears the screen and resets the conversation context (fresh thread).
  • Documents the /new alias.
  • Notes that Ctrl+L only clears the visible screen and keeps the conversation context intact.

Documentation only; no code behavior changes.

Related Issues

Fixes #19239

How to Validate

  • npx prettier --check docs/reference/commands.md → passes.
  • Open docs/reference/commands.md at the ### /clear section and confirm it now describes the context reset, the /new alias, and the Ctrl+L distinction.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed) — N/A, documentation-only change
  • Noted breaking changes (if any) — none
  • Validated on required platforms/methods:
    • MacOS
      • npm run (prettier --check on the changed file)

@Pluviobyte Pluviobyte requested review from a team as code owners May 30, 2026 16:57
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the CLI documentation to prevent user confusion regarding session management. By clearly distinguishing between the /clear command, which resets the conversation context, and the Ctrl+L shortcut, which only clears the visual display, users can better manage their interaction threads.

Highlights

  • Documentation Clarification: Updated the /clear command documentation to explicitly state that it resets the conversation context and starts a new session.
  • Alias Documentation: Added the /new alias to the /clear command documentation.
  • Keyboard Shortcut Distinction: Clarified that the Ctrl+L shortcut only clears the visible terminal output and does not reset the conversation context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 30, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for the /clear command in docs/reference/commands.md to clarify that it resets the conversation context and starts a new session, introduces the /new alias, and explains that the Ctrl+L shortcut only clears the visible screen while keeping the context intact. There are no review comments, and I have no feedback to provide.

Note: Security Review has been skipped due to the limited scope of the PR.

@gemini-cli gemini-cli Bot added priority/p3 Backlog - a good idea but not currently a priority. area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels May 30, 2026
The `/clear` command reference only described clearing the terminal
screen. It did not mention that `/clear` (and its `/new` alias) also
calls `resetChat()`, which resets the agent's conversation context and
starts a new session. This left users unsure how to start a fresh
thread without context pollution.

Clarify the description, document the `/new` alias, and note that the
Ctrl+L shortcut only clears the visible screen while keeping the current
conversation context intact (unlike `/clear`).

Fixes google-gemini#19239
@Pluviobyte Pluviobyte force-pushed the docs/clarify-clear-resets-context branch from daca1a5 to bc99e22 Compare May 30, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p3 Backlog - a good idea but not currently a priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/clear docs dont mention that it clears context

1 participant