Skip to content

Feature: Session persistence with --continue flag #52

@evansenter

Description

@evansenter

Summary

Add ability to resume the previous conversation session with a --continue flag.

Usage

# Start fresh (current behavior)
clemini

# Resume last session
clemini --continue
clemini -c

Implementation

1. Session State Storage

Save session state to ~/.clemini/session.json (or similar):

{
  "interaction_id": "abc123...",
  "model": "gemini-3-flash-preview",
  "cwd": "/path/to/project",
  "updated_at": "2026-01-17T18:00:00Z"
}

2. CLI Flag

Add --continue / -c flag to clap args.

3. Restoration Logic

On startup with --continue:

  • Load session state from file
  • Pass interaction_id to first run_interaction() call
  • Gemini's interaction history handles the rest

4. Session Updates

After each interaction, update the stored session state.

Considerations

  • Multiple projects: Should sessions be per-cwd? Store in .clemini/session.json in project root?
  • Expiration: Gemini interactions may expire. Handle gracefully if --continue fails.
  • Clear on /clear: The /clear command should also clear the persisted session.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions