Claude Code

Tuneloop captures Claude Code sessions via a plugin that hooks into the SessionEnd lifecycle event and uploads transcripts automatically.

How It Works

The Tuneloop plugin bundles a SessionEnd hook and the upload CLI into a single self-contained package. When a Claude Code session ends, the hook reads the session transcript, attaches git context, and uploads it to your Tuneloop server. The server URL and ingest token are baked into the plugin at setup time — no per-machine configuration is needed.

Generating the Plugin

Use the open-source setup utility to generate a plugin zip with your deployment's credentials:

npx tuneloop-plugin-setup \
  --server https://tuneloop.yourcompany.com \
  --token <your-ingest-token> \
  --harness claude-code \
  -o tuneloop-claude-code.zip

This produces a ready-to-deploy Claude Code plugin zip containing:

  • .claude-plugin/plugin.json — plugin manifest
  • hooks/hooks.jsonSessionEnd hook configuration
  • bin/tuneloop-upload — self-contained upload script (zero dependencies, Node.js built-ins only)

The server URL and token are embedded in the plugin, so developers don't need to configure anything on their machines.

Individual Setup

For testing or single-machine setup, generate the plugin and load it directly:

npx tuneloop-plugin-setup \
  --server https://tuneloop.yourcompany.com \
  --token <your-ingest-token> \
  --harness claude-code \
  -o tuneloop-claude-code.zip

claude --plugin-dir ./tuneloop-claude-code.zip

The --plugin-dir flag loads the plugin for that session. To install it permanently, use Claude Code's plugin manager or upload it to your org marketplace.

Backfill

To upload existing sessions that predate the plugin installation:

npx tuneloop-plugin-setup \
  --server https://tuneloop.yourcompany.com \
  --token <your-ingest-token> \
  --harness claude-code \
  --backfill

Options:

  • --since 2025-01-01 — only sessions after this date
  • --limit 100 — cap the number of sessions
  • --dry-run — preview what would be uploaded

Re-running backfill is safe — the server deduplicates on content hash.

Enterprise Rollout

Claude Code supports organization-managed plugin marketplaces. Upload the generated zip to your org's marketplace and set it to Required — it's automatically installed for all members and cannot be removed.

  1. Go to Organization settings → Plugins in your Claude Code admin console
  2. Create a custom marketplace (or use an existing one)
  3. Upload tuneloop-claude-code.zip
  4. Set the plugin's installation preference to Required

Every developer in the org gets automatic session capture with no setup steps. Organization-managed plugins cannot be edited or removed by members.

For GitHub-synced marketplaces, commit the plugin to a private repo and point the marketplace at it — updates auto-sync when you push version bumps.

Managed settings via MDM

For organizations that manage Claude Code configuration via MDM rather than the admin console, deploy the plugin as a managed setting. See the Claude Code managed settings documentation for platform-specific file locations and MDM deployment templates.

What Gets Captured

Each upload includes:

  • The full session transcript (JSONL format)
  • All subagent sidechain transcripts
  • Git context: remote, branch, repo name, author email
  • Session metadata from .meta.json

Transcripts are uploaded to your Tuneloop server — they never leave your infrastructure.

Transcript Location

Claude Code writes transcripts to ~/.claude/projects/. Each project directory contains session JSONL files and a subagents/ directory for sidechain transcripts.