Skip to content

Feature Request: Session History Search #714

@kyle-ingka

Description

@kyle-ingka

Feature Request: Session History Search

Problem

Copilot CLI stores session history in ~/.copilot/session-state/ as JSONL files, but there's no built-in way to search through past sessions. Users often need to:

  1. Find how they solved a similar problem before
  2. Resume a session from days/weeks ago by topic
  3. Review what they worked on (for reports, handovers)
  4. Search for specific commands or discussions

Currently, users must manually browse files or build custom tooling.

Proposed Solution

Add a copilot --search <keyword> or copilot search <keyword> command that:

  1. Searches session content - Both user messages and assistant responses
  2. Interactive selection - Like copilot --resume picker but with search
  3. Resume integration - Select a result and resume that session directly

Example UX

# Search sessions
$ copilot search "docker compose"

# Interactive search (like --resume but with filtering)
$ copilot search --interactive

# Search only user messages
$ copilot search "kubernetes" --user-only

Why This Matters

  • Knowledge reuse - Solutions discovered once shouldn't be lost
  • Context recovery - Resume work after interruptions
  • Productivity - Avoid re-solving the same problems

Current Workaround

I built a shell script using ripgrep + fzf that searches sessions in ~0.08s for 67MB of history. Happy to share if helpful for implementation reference.

Additional Context

  • Session files are JSONL with user.message and assistant.message types
  • ripgrep handles the search extremely fast (no index needed for reasonable history sizes)
  • Integration with existing --resume flow would be ideal

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions