Zero dependencies · ESM + CJS · Node ≥ 18

Watch Claude Code output
as it happens.

cc-tail tails ~/.claude/projects/ JSONL files and emits structured events — streaming starts, tool calls, results — as a standard Node.js EventEmitter.

npm install @lanmower/cc-tail
ESM / TypeScript
import { watch } from '@lanmower/cc-tail';

const watcher = watch()
  .on('conversation_created', ({ conversation }) => {
    console.log('New session:', conversation.title);
  })
  .on('streaming_progress', ({ block, role }) => {
    if (block.type === 'text')
      process.stdout.write(block.text);
  })
  .on('streaming_complete', ({ conversationId }) => {
    console.log('\nDone:', conversationId);
  });

process.on('SIGINT', () => watcher.stop());
CommonJS
const { watch, JsonlWatcher } = require('@lanmower/cc-tail');

// Use default ~/.claude/projects dir
const watcher = watch();

// Or pass a custom directory
const custom = watch('/path/to/projects');

// Or use the class directly
const w = new JsonlWatcher('/custom/dir');
w.start();
w.on('streaming_start', (e) => console.log(e));

Events

Every event is emitted on the watcher's EventEmitter with a consistent payload shape.

API

Live Event Stream

This is what cc-tail emits when Claude Code runs.