Skip to content

Add /list-sessions and /restore-session commands#4782

Open
chr15m wants to merge 8 commits intoAider-AI:mainfrom
chr15m:restore-session-command
Open

Add /list-sessions and /restore-session commands#4782
chr15m wants to merge 8 commits intoAider-AI:mainfrom
chr15m:restore-session-command

Conversation

@chr15m
Copy link

@chr15m chr15m commented Jan 21, 2026

This PR introduces session management capabilities to aider, allowing users to view and restore previous chat contexts from the chat history file.

Key Features:

  • /list-sessions: Displays a chronological list of previous chat sessions found in the history file, including timestamps and snippets of the first/last user messages for easy identification.
  • /restore-session [N]: Restores the chat context (messages) from a specific previous session.
    • Supports positive indices (from /list-sessions output).
    • Supports negative indices (e.g., -1 for the most recent session).
    • Automatically handles session filtering to exclude tool-only notifications and previous restore commands to keep the history clean.
  • Enhanced History Tracking:
    • /run command outputs are now stored in the chat history file.
    • Metadata for restored sessions is appended to the history to maintain a clear audit trail.
  • Robust Filtering: Improved logic to filter out aider-internal messages and session management commands when parsing the history for restoration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant