title: Claude Code description: Capture Claude Code sessions with dkod. Setup, adapter details, and example output.

Claude Code

dkod captures Claude Code sessions via a plugin that streams the SDK's NDJSON transcript over a UNIX socket.

Setup

dkod init

The dkod init command installs the Claude Code hook automatically if Claude Code is detected.

Capture a session

dkod capture claude-code

This wraps the Claude Code session. When the session ends, dkod stores the transcript and diff as a git ref.

Example output

$ dkod capture claude-code
 Wrapping claude-code session...
 Session started capturing transcript
  ... (Claude Code session runs normally) ...
 34 messages captured, 6 files touched
 Session s-c1d2e3 refs/dkod/sessions/s-c1d2e3

$ dkod show s-c1d2e3
Session:  s-c1d2e3
Agent:    claude-code
Author:   you@example.com
Prompt:   "add error handling to the payment flow"
Files:    src/payments.ts, src/errors.ts, tests/payments.test.ts
Commits:  a1b2c3d
Duration: 6m 45s

How it works

The adapter connects to Claude Code via a UNIX socket and streams the NDJSON transcript in real time. When the session ends, the CLI:

  1. Runs redaction on the transcript
  2. Captures the git diff since session start
  3. Writes both as a compressed JSON blob under refs/dkod/sessions/<id>
  4. Links any commits produced during the session via refs/dkod/commits/<sha>