create-adapter

create-adapter is a skill for Claude Code from marcus/sidecar. It costs 78 tokens per session (4,088 once invoked), scanned A, original, MIT.

A guide for building adapters that import AI chat histories from different coding tools. An adapter reads a tool’s stored conversations and exposes them through a common interface.

In plain words
What is it for?
Use it to add support for a chat tool, modify how an existing adapter detects sessions or reads messages, or implement caching and incremental refresh.
Why use it?
It helps new integrations avoid slow full-directory scans, repeated file parsing, excessive CPU use, and unsafe file-descriptor handling when conversations change.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code; mentions Codex.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go test ./internal/adapter/<adapter> -run ..

Good fit Use it to add support for a chat tool, modify how an existing adapter detects sessions or reads messages, or implement caching and incremental refresh.

Compare 6 skills from other repositories ↓
About the project

Sidecar is a terminal-based workspace for running AI coding agents alongside file trees, task issues, Git diffs, and Jira or GitHub resources in split panes. Developers use it to monitor agent sessions, inspect files and changes, manage workspaces, and handle tasks without leaving one shell. The catalogue entries extend or guide coding-agent workflows used with Sidecar.

marcus/sidecar · 1,091 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/marcus/sidecar
agentmods
npx agentmods add skills/marcus/sidecar/create-adapter

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for create-adapter

README.md
[![agentmods](https://agentmods.dev/badge/skills/marcus/sidecar/create-adapter/github.svg)](https://agentmods.dev/skills/marcus/sidecar/create-adapter)
Your own site
<a href="https://agentmods.dev/skills/marcus/sidecar/create-adapter"><img src="https://agentmods.dev/badge/skills/marcus/sidecar/create-adapter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for create-adapter

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcus/sidecar/create-adapter"><img src="https://agentmods.dev/badge/skills/marcus/sidecar/create-adapter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,088 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.04088
Opus 5.5 $0.00031 $0.01635
Sonnet 5.5 $0.00016 $0.00818
Haiku 4.5 $0.00008 $0.00409

Measured 1mo ago against content hash 342d0e7bc51f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

create-adapter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/create-adapter/SKILL.md · 416 lines

How it starts

The opening of the file, as written. The whole thing — 416 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

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 for dynamic debounce and huge-session auto-reload protection.

Treat source identity separately from lineage. Use the source's durable thread/session ID for Session.ID; parent, root, fork, or lineage IDs describe relationships and must not collapse distinct sessions. Decode metadata fields defensively when the source has emitted multiple shapes over time (for example, a string in one version and an object in another).

Path and Watch Strategy

Set Session.Path only when Sidecar should use tiered file watching for that adapter:

  • File-based append-only (JSONL/log): set Path to absolute file path — this opts into TieredWatcher with HOT/COLD/FROZEN tiers
  • DB/WAL adapters (Cursor, Warp, Kiro): prefer adapter-specific Watch() with WAL-aware invalidation; do not set Path unless tiered watching covers your write surface

Read the full file on GitHub · 416 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 416 lines · 78 tokens per session scan A 342d0e7bc51f

Subscribe to this mod's changes

create-adapter is a skill published in the GitHub repository marcus/sidecar (1,091 stars, last pushed 11d ago), licensed MIT. It adds 78 tokens to every session and 4,088 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.