显示 HN:ccrider - 搜索和恢复你的 Claude 代码会话 – TUI / MCP / CLI
Show HN: ccrider - Search and Resume Your Claude Code Sessions – TUI / MCP / CLI

原始链接: https://github.com/neilberkman/ccrider

## ccrider:轻松管理你的 Claude 代码会话 ccrider 是一款工具,旨在帮助你快速查找、浏览和恢复你的 Claude 代码会话,克服了管理存储为嵌套 JSON 文件中的会话的困难。它提供了一个终端用户界面 (TUI) 浏览器、一个用于搜索的命令行界面 (CLI) 以及一个 MCP 服务器,允许 Claude 本身搜索你的历史记录。 **主要特性:** * **快速搜索:** 由 SQLite FTS5 提供支持,ccrider 提供跨会话内容的即时全文搜索,并可按项目和日期进行过滤。 * **无缝恢复:** 快速从 TUI 或 CLI 恢复会话,并使用正确的上下文启动 Claude。 * **Claude 集成:** 内置的 MCP 服务器允许你要求 Claude 查找相关的过往对话(“展示我的 Elixir 会话”、“搜索 postgres 迁移问题”)。 * **易于设置:** 通过 Homebrew 或从源代码安装。 * **增量同步:** 自动检测并导入正在进行的会话中的新消息。 ccrider 通过提供完整的模式支持、单个二进制分发以及可靠的会话恢复,解决了其他工具的局限性。它专注于性能、关注点分离和精致的用户体验。 [https://github.com/neilberkman/ccrider](https://github.com/neilberkman/ccrider)

## ccrider:一个管理Claude代码会话的工具 开发者nberkman创建了“ccrider”,旨在轻松搜索和恢复Claude代码中的过往会话。它是一个Go语言编写的独立二进制文件,将您的完整会话历史记录本地存储在SQLite中,提供TUI(文本用户界面)、CLI(命令行界面)和MCP(多代码协议)服务器。 TUI允许浏览和全文搜索会话,并可以选择恢复或导出为Markdown格式。MCP服务器使Claude能够访问先前的会话以获取上下文。 虽然Claude提供了`/rename`和`/resume`功能,但ccrider提供了更强大的搜索功能,可以搜索*所有*过往会话,即使是没有记住名称的会话。开发者在用户反馈后迅速解决了Homebrew安装中的一个小问题。 该项目在GitHub上可用:[https://github.com/neilberkman/ccrider](https://github.com/neilberkman/ccrider)。
相关文章

原文

Search, browse, and resume your Claude Code sessions. Fast.

You've got months of Claude Code sessions sitting in ~/.claude/projects/. Finding that conversation where you fixed the authentication bug? Good luck grepping through nested JSON files.

ccrider solves this with a TUI browser, CLI search, and an MCP server so Claude can search your past sessions too.

# Import your sessions once
ccrider sync

# Launch the TUI - browse, search, resume
ccrider tui

# Or search from command line
ccrider search "authentication bug"

Stay in your terminal. Find any conversation. Resume where you left off.

Installation:

# Homebrew (recommended)
brew install neilberkman/tap/ccrider

# Or from source
git clone https://github.com/neilberkman/ccrider.git
cd ccrider
go build -o ccrider cmd/ccrider/main.go
sudo mv ccrider /usr/local/bin/

# Install MCP server for all your projects (optional)
claude mcp add --scope user ccrider $(which ccrider) serve-mcp

"Vibe code like a king The King!"

ccrider.mp4

1. Interactive TUI Browser

Browse your sessions with a polished terminal UI:

  • Arrow keys to navigate
  • Enter to view full conversation
  • o to open session in new terminal tab (auto-detects Ghostty, iTerm, Terminal.app)
  • / to search across all messages
  • p to toggle project filter (show only current directory)
  • ? for help

Sessions matching your current directory are highlighted in light green - instantly see which sessions are relevant to your current work.

ccrider search "postgres migration"
ccrider search "error handling" --project ~/code/myapp
ccrider search "authentication" --after 2024-01-01

Powered by SQLite FTS5 - search message content, filter by project or date, get results instantly.

Press r in the TUI or use the CLI:

ccrider resume <session-id>

Launches claude --resume in the right directory with the right session. Just works.

ccrider sync       # Import all new sessions
ccrider sync --full  # Re-import everything

Detects ongoing sessions and imports new messages without re-processing everything.


ccrider includes a built-in MCP (Model Context Protocol) server that gives Claude access to your session history.

Ask Claude to search your past conversations while working on new problems:

  • "Find sessions where I worked on authentication"
  • "Show me my most recent Elixir sessions"
  • "What was I working on last week in the billing project?"
  • "Search my sessions for postgres migration issues"

Claude Code:

# Install for all your projects (recommended)
claude mcp add --scope user ccrider $(which ccrider) serve-mcp

# Or for current project only
claude mcp add ccrider $(which ccrider) serve-mcp

Claude Desktop:

Add to your config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "ccrider": {
      "command": "ccrider",
      "args": ["serve-mcp"]
    }
  }
}
  • search_sessions - Full-text search across all session content with date/project filters
  • list_recent_sessions - Get recent sessions, optionally filtered by project
  • get_session_detail - Retrieve session info with first/last messages and optional search
  • get_session_messages - Get messages from a session (supports tail mode, context around search matches)

The MCP server provides read-only access to your session database. Your conversations stay local.


ccrider looks for config in ~/.config/ccrider/:

# config.toml - pass additional flags to claude --resume
claude_flags = ["--dangerously-skip-permissions"]
# terminal_command.txt - custom command for 'o' key
# Available placeholders: {cwd}, {command}
wezterm cli spawn --cwd {cwd} -- {command}
# resume_prompt.txt - customize the prompt sent when resuming sessions

See CONFIGURATION.md for full details.


Built with strict core/interface separation following Saša Jurić's principles:

  • Core (pkg/, internal/core/): Pure business logic - parsing, database, search
  • Interface (internal/interface/, cmd/): Thin wrappers - CLI, TUI, MCP server

Uses proven technologies:

  • Go for performance and single-binary distribution
  • SQLite with FTS5 for fast full-text search
  • Bubbletea for polished terminal UI
  • MCP for Claude integration

Other Claude Code session tools are broken:

  • Incomplete schema support (can't parse all message types)
  • Broken builds and abandoned dependencies
  • No real search (just grep)
  • Can't actually resume sessions

ccrider fixes this with:

  • ✅ 100% schema coverage - parses all message types correctly
  • ✅ SQLite FTS5 search - fast, powerful full-text search
  • ✅ Single binary - no npm, no pip, no dependencies
  • ✅ Native resume - one keystroke to resume sessions
  • ✅ Incremental sync - detects new messages in ongoing sessions

See CONTRIBUTING.md for development setup and guidelines.

cmd/ccrider/          # CLI entry point + MCP server
internal/
  core/               # Business logic (no UI concerns)
    db/               # Database operations
    importer/         # Session import/sync
    search/           # Full-text search
    session/          # Session launch logic
  interface/          # Thin UI wrappers
    cli/              # Command handlers
    tui/              # Terminal UI (bubbletea)
pkg/ccsessions/       # Session file parser (public API)
go build -o ccrider cmd/ccrider/main.go
./ccrider sync
./ccrider tui

MIT

联系我们 contact @ memedata.com