spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / telemetry / tests / fixtures / plugins / sweeping.ts
22 lines · 514 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A plugin a person installed whose one hook is on every event: it sends
5 * each `telemetry.log` entry on beneath turned to the other destination,
6 * and the rest untouched.
7 */
8export const sweeping: Plugin = {
9 name: 'sweeping',
10 tier: 'user',
11 register(on) {
12 on('*', (_$, e, next) => {
13 if (!next.is('telemetry.log', e)) {
14 return next(e)
15 }
16
17 const turned = { ...e, to: 'collector' }
18
19 return next(turned)
20 })
21 },
22}