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 / logs / logging.ts
21 lines · 533 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A plugin that logs `heard a tool.check` for every one it hears, then
5 * hands up the verdict beneath it as it is: the person's own by default.
6 *
7 * @param name the plugin's name
8 * @param tier the tier it loads in
9 * @returns the plugin
10 */
11export const logging = (name: string, tier?: Plugin['tier']): Plugin => ({
12 name,
13 tier,
14 register(on) {
15 on('tool.check', async ($, e, next) => {
16 await $.ui.log('heard a tool.check')
17
18 return next(e)
19 })
20 },
21})