Skip to content

jonmagic/copilot-sessions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

copilot-sessions

Browse, search, and resume GitHub Copilot CLI sessions from your terminal. Read my blog post for the full story.

The Copilot CLI maintains a SQLite database at ~/.copilot/session-store.db with session metadata, conversation turns, and a full-text search index. This tool queries that database and pipes the results through fzf for interactive fuzzy search, then resumes the chosen session in your current terminal.

Quick Start

git clone https://github.com/jonmagic/copilot-sessions.git
cd copilot-sessions

# Add to your PATH (or symlink bin/copilot-sessions somewhere on PATH)
export PATH="$PWD/bin:$PATH"

# Browse recent sessions
copilot-sessions

# Search for a session
copilot-sessions "home assistant"

# List without fzf
copilot-sessions -l

Usage

copilot-sessions              Browse recent sessions (fzf)
copilot-sessions <query>      Fuzzy search, then browse matches
copilot-sessions -l [n]       List recent sessions without fzf (default: 20)
copilot-sessions -h           Show help

Keys (in fzf)

Key Action
Enter Resume selected session in this terminal
Ctrl-Y Copy session ID to clipboard
Esc Cancel

Example Output

  TIME     REPO             SESSION
  11m ago  brain            Home Assistant Automation Ideas
  1h ago   brain            Research Copilot CLI Theme
  4h ago   brain            Review And Seed Spotify Playlist
  13h ago  brain            Enable Ghostty SSH Terminal

How It Works

The Copilot CLI stores session data in ~/.copilot/session-store.db, a SQLite database with:

Table Contents
sessions ID, summary, repository, branch, timestamps
turns User messages and assistant responses
checkpoints Titled snapshots with overviews
session_files Files touched during the session
session_refs Linked commits, PRs, and issues
search_index FTS5 full-text search across all content

Search

Search uses fzf's built-in fuzzy matching against session summaries, all user messages, and repository names. This gives you:

  • Typo tolerancemincraft finds your Minecraft session, sptoify finds Spotify
  • Substring matchingcraft finds Minecraft, tower finds "Build Drop Tower"
  • Multi-word fuzzycli theme finds "Research Copilot CLI Theme"

The search content (user messages from all turns) is appended off-screen after the visible display columns. fzf matches against it but --no-hscroll keeps the view clean.

Performance

All formatting — relative timestamps, repository name truncation, display layout — is computed inside a single SQLite query. No bash loops or per-row shell-outs. Startup is ~20ms for hundreds of sessions.

Requirements

  • GitHub Copilot CLI (with at least one session)
  • fzf (brew install fzf)
  • SQLite3 (pre-installed on macOS and most Linux)
  • Bash 4+

Tip

Alias it for quick access:

alias cs=copilot-sessions

License

ISC License

Copyright (c) 2026 Jonathan Hoyt

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

About

Browse, search, and resume GitHub Copilot CLI sessions from your terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages