create-adapter

Featured

Create conversation adapters for importing AI chat history from different tools (Claude Code, Cursor, Warp, Codex, etc.). Covers the adapter.Adapter interface, caching strategies, incremental parsing, watch/FD management, and performance standards. Use when creating a new adapter, modifying adapter behavior, or debugging adapter performance issues. See references/ for Cursor DB and Warp SQLite schema details.

AI & Automation 1,041 stars 80 forks Updated today MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Create Adapter ## Why Performance Matters Adapters are the largest performance risk in Sidecar. Conversations refresh on watch events in a hot path that runs continuously during active sessions: ``` watch event -> coalescer -> session refresh -> adapter.Sessions() -> metadata parsing ``` If an adapter does full directory scans and full-file reparses on every change, CPU and FD usage spike quickly. ## Reference Adapters Study these before writing a new adapter: - `internal/adapter/claudecode` - Incremental JSONL parsing, targeted refresh - `internal/adapter/codex` - Directory cache, two-pass metadata parsing, global watch scope - `internal/adapter/cursor` - SQLite/WAL-aware cache invalidation, FD-safe DB access - `internal/adapter/pi` - Global scope, JSONL, CWD-based filtering, session classification, message prefix stripping ## Required Interface All adapters implement `adapter.Adapter`: ```go type Adapter interface { ID() string Name() string Icon() string Detect(projectRoot string) (bool, error) Capabilities() CapabilitySet Sessions(projectRoot string) ([]Session, error) Messages(sessionID string) ([]Message, error) Usage(sessionID string) (*UsageStats, error) Watch(projectRoot string) (<-chan Event, io.Closer, error) } ``` ### Required Session Fields Every session from `Sessions()` must set: - `ID`, `Name` - `AdapterID`, `AdapterName`, `AdapterIcon` - `CreatedAt`, `UpdatedAt` - `MessageCount`, `FileSize` `FileSize` is used ...

Details

Author
marcus
Repository
marcus/sidecar
Created
7 months ago
Last Updated
today
Language
Go
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category