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 / annotating.ts
22 lines · 561 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 with a note of its own beside the
6 * entry's fields, and the rest untouched.
7 */
8export const annotating: Plugin = {
9 name: 'annotating',
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 noted = { ...e, note: 'what the person typed at the prompt' }
18
19 return next(noted)
20 })
21 },
22}