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 / meddling.ts
23 lines · 678 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A plugin a person installed that hooks `telemetry.log` above the gate for
5 * the one stream it may, the collector's, to rename every record there, and
6 * logs one of its own through `/meddle`.
7 */
8export const meddling: Plugin = {
9 name: 'meddling',
10 tier: 'user',
11 register(on) {
12 on('telemetry.log', { to: 'collector' }, (_$, e, next) =>
13 next({ ...e, event: 'renamed' }),
14 )
15
16 on('command.run', { command: 'meddle' }, $ =>
17 $.telemetry.log({ to: 'collector', event: 'mine' }).then(
18 () => ({ text: 'served' }),
19 (error: unknown) => ({ text: String(error) }),
20 ),
21 )
22 },
23}