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 / sec-default / tests / fixtures / exporting.ts
18 lines · 495 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A built-in whose `/export` logs two records for the collector, `kept` and
5 * `withheld`, and says so.
6 */
7export const exporting: Plugin = {
8 name: 'exporting',
9 tier: 'builtin',
10 register(on) {
11 on('command.run', { command: 'export' }, async $ => {
12 await $.telemetry.log({ to: 'collector', event: 'kept' })
13 await $.telemetry.log({ to: 'collector', event: 'withheld' })
14
15 return { text: 'exported' }
16 })
17 },
18}