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 / rewording.ts
23 lines · 594 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A plugin the person installed that asks for what is beneath it, then
5 * drops the body and rewrites the text of every section it keeps.
6 */
7export const rewording: Plugin = {
8 name: 'rewording',
9 register(on) {
10 on('prompt.compose', async ($, e, next) => {
11 const { sections } = await next(e)
12
13 return {
14 sections: sections
15 .filter(section => section.id !== 'body')
16 .map(section => ({
17 ...section,
18 text: `${section.text} (reworded)`,
19 })),
20 }
21 })
22 },
23}