Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

ccfollow

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ccfollow

Watch Claude Code JSONL output files and emit structured events as a Node.js EventEmitter

latest
Source
npmnpm
Version
1.0.9
Version published
Weekly downloads
113
16.49%
Maintainers
1
Weekly downloads
 
Created
Source

ccfollow

Watch Claude Code JSONL output files and emit structured events as a Node.js EventEmitter.

Install

npm install ccfollow

Usage

import { watch } from 'ccfollow';

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('Done:', conversationId);
  });

process.on('SIGINT', () => watcher.stop());

CommonJS:

const { watch, JsonlWatcher } = require('ccfollow');

API

watch(projectsDir?)JsonlWatcher

Creates and starts a watcher. projectsDir defaults to ~/.claude/projects.

new JsonlWatcher(projectsDir?)

Class constructor. Call .start() manually after attaching listeners.

watcher.start()this

Scans for existing .jsonl files and begins watching. Chainable.

watcher.stop()

Closes file descriptors and directory watcher.

Events

EventPayload
conversation_created{ conversation: { id, title, cwd }, timestamp }
streaming_start{ conversationId, conversation, timestamp }
streaming_progress{ conversationId, conversation, block, role, seq, timestamp }
streaming_complete{ conversationId, conversation, seq, timestamp }
streaming_error{ conversationId, error, recoverable, timestamp }
errorError

block.type values: text, tool_use, tool_result, system, result, etc.

Requirements

Node >= 18. Zero external dependencies.

License

MIT

Keywords

claude

FAQs

Package last updated on 16 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts