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 / relabeling.ts
24 lines · 646 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A plugin the person installed that hides the organization's tools from
5 * the listing and relabels every other one.
6 */
7export const relabeling: Plugin = {
8 name: 'relabeling',
9 register(on) {
10 on('tool.list', async ($, e, next) => {
11 const listed = await next(e)
12 const { value } = listed
13 const isListed = value !== undefined
14
15 return isListed
16 ? {
17 value: value
18 .filter(tool => !tool.name.startsWith('mcp__corp__'))
19 .map(tool => ({ ...tool, description: 'relabeled' })),
20 }
21 : listed
22 })
23 },
24}