Feature Request: Implement Named Conversation Branching for Advanced Session Management
Title: Feature Request: Implement Named Conversation Branching for Advanced Session Management
Labels: feature-request, enhancement, cli, session-management, workflow, ux
---
Summary
This issue consolidates three separate user requests that all converge on a single, powerful feature: the ability to save, restore, and manage multiple named conversation threads. The current session management (--continue, --resume) is strictly linear, which hinders common developer workflows that involve context-switching, exploring alternative solutions, or managing multiple tasks within a single project.
Is your feature request related to a problem? Please describe.
The current session management system, while useful for simple, continuous tasks, presents significant limitations for complex development workflows:
- Linear History: Conversation history is a single, linear stream. If a developer works on a feature, then switches to a bug fix, the context for the original feature becomes diluted with the bug-fixing conversation, reducing the AI's effectiveness.
- Limited Resumption: The
--continueflag only allows resuming the single most recent conversation, and--resume <id>requires users to look up non-memorable, auto-generated IDs. - Difficulty Exploring Alternatives: There is no easy way to save a conversation at a key decision point, explore one implementation path, and then return to that checkpoint to explore an alternative strategy. This makes exploratory coding and comparing different approaches cumbersome.
Essentially, developers cannot easily manage parallel lines of inquiry or context-switch between tasks (e.g., a new feature and an urgent bug fix) without losing valuable conversational history or resorting to cumbersome workarounds.
Describe the solution you'd like
We propose implementing a new interactive command, likely /chat, inspired by a similar, highly effective feature in Google's Gemini CLI. This would introduce a "git branch"-like experience for conversations, allowing users to save and switch between named checkpoints.
The proposed command would have the following subcommands:
/chat save <tag>: Saves the entire current conversation history to a checkpoint identified by a memorable, user-defined<tag>./chat resume <tag>: Clears the current session and restores the complete conversation history from the specified<tag>./chat list: Displays a list of all saved tags for the current project, allowing the user to see available checkpoints./chat delete <tag>: (Optional but recommended) Deletes a saved checkpoint that is no longer needed.
Benefits & Use Cases
This feature would fundamentally improve developer productivity by aligning the tool's capabilities with real-world, non-linear development practices.
- Use Case 1: Context-Switching
- A developer is working on a new feature and has built up significant context with the AI.
- They save their progress:
/chat save feature-auth-api - An urgent bug report comes in. They can clear the session (
/clear) and work on the bug. - Once the bug is fixed, they can instantly return to their feature work with the full context perfectly restored:
/chat resume feature-auth-api
- Use Case 2: Exploratory Refactoring
- A developer is refactoring a complex module and has the AI's help understanding it.
- They save a checkpoint:
/chat save refactor-start - They ask the AI to refactor the module using
async/awaitand evaluate the result. - They can then run
/chat resume refactor-startto instantly return to the state before the refactoring began. - Now, they can ask the AI to refactor the same module using a different pattern (e.g., functional programming) and directly compare the two approaches without losing the initial shared context.
Describe alternatives you've considered
The current alternatives are inefficient and introduce friction:
- Using
git worktree: This creates separate directories, which is a heavyweight solution that often requires re-running dependency installations and managing different file system states when the only goal is to isolate the AI's context. - Manual Copy/Paste: Manually copying and pasting large chunks of conversation history is tedious, error-prone, and defeats the purpose of an intelligent agent.
- Using
--continueand--resume: These are too limited for the reasons described above (linear history, non-memorable IDs).
Additional Context & Reference
This feature's value is proven by its existence in competing developer-focused tools. The implementation in Google's Gemini CLI serves as an excellent reference model for functionality and user experience.
- Reference Implementation:
google-gemini/gemini-cli/packages/cli/src/ui/commands/chatCommand.ts
By introducing named conversation branching, gemini-cli can become an even more indispensable and fluid part of the modern development environment.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗