Skip to content

AlexZeitler/session-md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

session-md

A terminal UI for browsing and managing AI chat sessions from multiple sources - Claude Code, Claude.ai exports, OpenCode, and Memorizer.

Built with Bun, OpenTUI, and TypeScript.

Features

  • Browse sessions from 4 sources in a single TUI
  • Filter sessions by source and text search
  • Full-text content search (g) with SQLite FTS5 index
  • Multi-select sessions and copy as Markdown to target folders
  • Markdown preview with syntax highlighting
  • Configurable targets for organizing exported sessions
  • Incremental search index - only new/changed sessions are re-indexed on startup

Supported Sources

Source Format Location
Claude Code JSONL ~/.claude/projects/**/*.jsonl
Claude.ai Export ZIP / conversations.json Configurable path
OpenCode JSON shards ~/.local/share/opencode/storage/
Memorizer REST API Configurable URL

Install

Global (recommended)

bun install -g @alexzeitler/session-md
session-md

From source

git clone https://github.com/AlexZeitler/session-md.git
cd session-md
bun install
bun src/index.ts

Update

session-md update

Version

session-md --version

Configuration

Config file: ~/.config/session-md/config.toml

A default config is created on first run.

default_target = "~/notes/claude-chats"

[targets]
vault   = "~/notes/claude-chats"
work    = "~/work/claude-sessions"
archive = "~/archive/claude"

[sources]
claude_code    = "~/.claude/projects"
opencode       = "~/.local/share/opencode/storage"
# claude_export = "~/Downloads/conversations.zip"
# memorizer_url = "http://localhost:5001"

Keyboard Shortcuts

Navigation

Key Action
Tab Cycle focus: Sources → Sessions → Detail
Shift+Tab Cycle focus backward
j / k Navigate list / scroll detail
gg Jump to top (list or detail)
G Jump to bottom (list or detail)
Ctrl+d / Ctrl+u Page down / up in detail
Esc Back to sessions from detail

Sessions

Key Action
Space Toggle selection
/ Open text filter
g Full-text content search (grep)
c Copy selected sessions to target
q Quit

Filter (/)

Key Action
Type Filter sessions by title/project
Enter Move to filtered results (filter stays active)
/ Return to filter input
Esc Close filter

Content Search (g)

Key Action
Type Search within session content (FTS5)
Enter Move to results / open selected result
/ Return to search input
Esc Close search

Content search uses a SQLite FTS5 index stored at ~/.config/session-md/search-index.sqlite. The index is built incrementally on startup - only new or changed sessions are indexed.

To rebuild the index from scratch:

session-md reindex

MCP Server

session-md can run as an MCP server, exposing session search and retrieval to AI assistants like Claude Code.

Stdio Transport

For direct integration with Claude Code:

session-md mcp

Add to your Claude Code MCP config:

{
  "mcpServers": {
    "session-md": {
      "command": "session-md",
      "args": ["mcp"]
    }
  }
}

HTTP Transport

Foreground:

session-md mcp --http              # default port 8282
session-md mcp --http --port 9000  # custom port

Daemon (background):

session-md mcp --http --daemon
session-md mcp stop

Daemon logs: ~/.cache/session-md/mcp.log

Health check: GET http://localhost:8282/health

MCP Tools

Tool Description
search_sessions Full-text search across all indexed sessions
list_sessions List sessions, optionally filtered by source
get_session Retrieve full Markdown content of a session by ID
import_sessions Re-scan all configured sources and update the index

Requirements

License

MIT

About

A terminal UI for browsing and managing AI chat sessions from multiple sources

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors