@@ -21,13 +21,15 @@ implementation. It allows you to:
2121 - [ Entering Plan Mode] ( #entering-plan-mode )
2222 - [ Planning Workflow] ( #planning-workflow )
2323 - [ Exiting Plan Mode] ( #exiting-plan-mode )
24+ - [ Commands] ( #commands )
2425- [ Tool Restrictions] ( #tool-restrictions )
2526 - [ Customizing Planning with Skills] ( #customizing-planning-with-skills )
2627 - [ Customizing Policies] ( #customizing-policies )
2728 - [ Example: Allow git commands in Plan Mode] ( #example-allow-git-commands-in-plan-mode )
28- - [ Example: Enable research subagents in Plan Mode] ( #example-enable-research -subagents-in-plan-mode )
29+ - [ Example: Enable custom subagents in Plan Mode] ( #example-enable-custom -subagents-in-plan-mode )
2930 - [ Custom Plan Directory and Policies] ( #custom-plan-directory-and-policies )
3031- [ Automatic Model Routing] ( #automatic-model-routing )
32+ - [ Cleanup] ( #cleanup )
3133
3234## Enabling Plan Mode
3335
@@ -125,6 +127,10 @@ To exit Plan Mode, you can:
125127- ** Tool:** Gemini CLI calls the [ ` exit_plan_mode ` ] tool to present the
126128 finalized plan for your approval.
127129
130+ ### Commands
131+
132+ - ** ` /plan copy ` ** : Copy the currently approved plan to your clipboard.
133+
128134## Tool Restrictions
129135
130136Plan Mode enforces strict safety policies to prevent accidental changes.
@@ -133,6 +139,7 @@ These are the only allowed tools:
133139
134140- ** FileSystem (Read):** [ ` read_file ` ] , [ ` list_directory ` ] , [ ` glob ` ]
135141- ** Search:** [ ` grep_search ` ] , [ ` google_web_search ` ]
142+ - ** Research Subagents:** [ ` codebase_investigator ` ] , [ ` cli_help ` ]
136143- ** Interaction:** [ ` ask_user ` ]
137144- ** MCP Tools (Read):** Read-only [ MCP tools] (e.g., ` github_read_issue ` ,
138145 ` postgres_read_schema ` ) are allowed.
@@ -203,16 +210,17 @@ priority = 100
203210modes = [" plan" ]
204211```
205212
206- #### Example: Enable research subagents in Plan Mode
213+ #### Example: Enable custom subagents in Plan Mode
207214
208- You can enable experimental research [ subagents] like ` codebase_investigator ` to
209- help gather architecture details during the planning phase.
215+ Built-in research [ subagents] like [ ` codebase_investigator ` ] and [ ` cli_help ` ]
216+ are enabled by default in Plan Mode. You can enable additional [ custom
217+ subagents] by adding a rule to your policy.
210218
211219` ~/.gemini/policies/research-subagents.toml `
212220
213221``` toml
214222[[rule ]]
215- toolName = " codebase_investigator "
223+ toolName = " my_custom_subagent "
216224decision = " allow"
217225priority = 100
218226modes = [" plan" ]
@@ -290,6 +298,24 @@ performance. You can disable this automatic switching in your settings:
290298}
291299```
292300
301+ ## Cleanup
302+
303+ By default, Gemini CLI automatically cleans up old session data, including all
304+ associated plan files and task trackers.
305+
306+ - ** Default behavior:** Sessions (and their plans) are retained for ** 30 days** .
307+ - ** Configuration:** You can customize this behavior via the ` /settings ` command
308+ (search for ** Session Retention** ) or in your ` settings.json ` file. See
309+ [ session retention] for more details.
310+
311+ Manual deletion also removes all associated artifacts:
312+
313+ - ** Command Line:** Use ` gemini --delete-session <index|id> ` .
314+ - ** Session Browser:** Press ` /resume ` , navigate to a session, and press ` x ` .
315+
316+ If you use a [ custom plans directory] ( #custom-plan-directory-and-policies ) ,
317+ those files are not automatically deleted and must be managed manually.
318+
293319[ `list_directory` ] : /docs/tools/file-system.md#1-list_directory-readfolder
294320[ `read_file` ] : /docs/tools/file-system.md#2-read_file-readfile
295321[ `grep_search` ] : /docs/tools/file-system.md#5-grep_search-searchtext
@@ -300,7 +326,10 @@ performance. You can disable this automatic switching in your settings:
300326[ MCP tools ] : /docs/tools/mcp-server.md
301327[ `save_memory` ] : /docs/tools/memory.md
302328[ `activate_skill` ] : /docs/cli/skills.md
329+ [ `codebase_investigator` ] : /docs/core/subagents.md#codebase_investigator
330+ [ `cli_help` ] : /docs/core/subagents.md#cli_help
303331[ subagents ] : /docs/core/subagents.md
332+ [ custom subagents ] : /docs/core/subagents.md#creating-custom-subagents
304333[ policy engine ] : /docs/reference/policy-engine.md
305334[ `enter_plan_mode` ] : /docs/tools/planning.md#1-enter_plan_mode-enterplanmode
306335[ `exit_plan_mode` ] : /docs/tools/planning.md#2-exit_plan_mode-exitplanmode
@@ -311,3 +340,4 @@ performance. You can disable this automatic switching in your settings:
311340[ auto model ] : /docs/reference/configuration.md#model-settings
312341[ model routing ] : /docs/cli/telemetry.md#model-routing
313342[ preferred external editor ] : /docs/reference/configuration.md#general
343+ [ session retention ] : /docs/cli/session-management.md#session-retention
0 commit comments