gemini-session-management
Gemini Session Management
MANDATORY: Invoke gemini-cli-docs First
STOP - Before providing ANY response about Gemini sessions:
- INVOKE
gemini-cli-docsskill- QUERY for the specific session topic
- BASE responses EXCLUSIVELY on official documentation loaded
Overview
Meta-skill for managing Gemini CLI sessions. Sessions preserve conversation history and can be resumed, searched, and configured with retention policies.
When to Use This Skill
Keywords: session, resume, /resume, session browser, retention, maxAge, maxCount, --list-sessions, --delete-session
Use this skill when:
- Resuming a previous session
- Configuring session retention
- Browsing past sessions
- Managing session storage
- Understanding session limits
Session Resume
Resume Last Session
gemini --resume
# or
gemini -r
Resume via Browser
In an active session:
/resume
Opens interactive session browser to search and select.
Session Retention
Configure automatic cleanup in settings.json:
{
"general": {
"sessionRetention": {
"maxAge": "7d",
"maxCount": 100,
"minRetention": "1d"
}
}
}
| Setting | Description | Example |
|---|---|---|
maxAge |
Maximum session age | "7d", "24h" |
maxCount |
Maximum sessions to keep | 100, 50 |
minRetention |
Minimum time before deletion | "1d", "12h" |
Session Limits
Configure turn limits:
{
"general": {
"maxSessionTurns": 100
}
}
Session Storage
Sessions are stored in:
~/.gemini/tmp/<project_hash>/
Command Line Options
| Option | Description |
|---|---|
--resume, -r |
Resume last session |
--list-sessions |
List available sessions |
--delete-session <id> |
Delete specific session |
Keyword Registry (Delegates to gemini-cli-docs)
| Topic | Query Keywords |
|---|---|
| Resume | --resume flag, resume session, /resume command |
| Browser | session browser, search sessions, /resume interactive |
| Retention | sessionRetention, maxAge maxCount, session cleanup |
| Limits | maxSessionTurns, session limits, turn limits |
| Storage | session storage, ~/.gemini/tmp, session location |
| Management | --list-sessions, --delete-session, session management |
Quick Decision Tree
What do you want to do?
- Resume last session ->
gemini --resumeorgemini -r - Browse past sessions ->
/resumein active session - Configure retention -> Edit sessionRetention in settings.json
- List all sessions ->
gemini --list-sessions - Delete session ->
gemini --delete-session <id> - Set turn limits -> Configure maxSessionTurns
Best Practices
- Regular cleanup: Configure retention to avoid disk bloat
- Name sessions: Use descriptive prompts for easy browsing
- Resume for context: Continue complex conversations
- Delete sensitive: Remove sessions with sensitive data
Verification Checkpoint
- Did I invoke gemini-cli-docs skill?
- Did official documentation load?
- Is my response based EXCLUSIVELY on official docs?
Test Scenarios
Scenario 1: Resume Session
Query: "How do I resume my last Gemini CLI session?" Expected Behavior:
- Skill activates on "resume" or "session"
- Provides
gemini --resumecommand Success Criteria: User receives resume command and /resume browser option
Scenario 2: Configure Retention
Query: "How do I limit Gemini session storage?" Expected Behavior:
- Skill activates on "retention" or "session storage"
- Delegates to gemini-cli-docs for sessionRetention settings Success Criteria: User receives settings.json configuration with maxAge/maxCount
Scenario 3: Delete Session
Query: "How do I delete old Gemini sessions?" Expected Behavior:
- Skill activates on "delete session" or "session management"
- Provides --delete-session command Success Criteria: User receives deletion workflow and list-sessions option
References
Query gemini-cli-docs for official documentation on:
- "session management"
- "session resume"
- "sessionRetention"
Version History
- v1.1.0 (2025-12-01): Added Test Scenarios section
- v1.0.0 (2025-11-25): Initial release
More from melodic-software/claude-code-plugins
design-thinking
Design Thinking methodology for human-centered innovation. Covers the 5-phase IDEO/Stanford d.school approach (Empathize, Define, Ideate, Prototype, Test) with workshop facilitation and exercise templates.
196plantuml-syntax
Authoritative reference for PlantUML diagram syntax. Provides UML and non-UML diagram types, syntax patterns, examples, and setup guidance for generating accurate PlantUML diagrams.
161system-prompt-engineering
Design effective system prompts for custom agents. Use when creating agent system prompts, defining agent identity and rules, or designing high-impact prompts that shape agent behavior.
141architecture-documentation
Generate architecture documents using templates with diagram integration. Use for creating C4 diagrams, viewpoint documents, and technical overviews.
128data-modeling
Data modeling with Entity-Relationship Diagrams (ERDs), data dictionaries, and conceptual/logical/physical models. Documents data structures, relationships, and attributes.
101resume-optimization
Resume structure, achievement bullet formulas, ATS optimization, and job-targeted tailoring for software engineers. Use when reviewing resumes, crafting achievement bullets, extracting keywords from job descriptions, or tailoring content for specific roles.
94