SLOPSHOPPER

merk-dir-das

Ein zweiter Blick: hebt Wichtiges aus langen Antworten hervor

newbandpromptmodel
A shopper browsing a rack in a slop shop
README

merk-dir-das

Ein Claude-Code-Mod, der nach jeder längeren Antwort einen kleinen Zweit-Agenten (Haiku) drüberlesen lässt. Steht darin etwas, das du nicht überlesen solltest, etwa Kosten, Risiken, Fristen oder etwas, das du selbst tun musst, erscheint es als Hinweis über dem Prompt. Achtung: Der Zweit-Agent verbraucht zusätzliche Tokens.

Installieren

Im Terminal in Claude Code eintippen:

/plugin install merk-dir-das --marketplace boonpflug/claude-mods-deutsch

Danach y zum Hinzufügen des Marketplace und mit Enter den Bereich „user“ wählen. Der Mod läuft sofort.

Aus der Shell geht es auch: claude plugin install merk-dir-das --marketplace boonpflug/claude-mods-deutsch

Source 2 files
hooks/register.tsx 52 lines
1import { atom, read, update } from 'claude-code'
2import type { EngineInterface, Register } from 'claude-code'
3
4const hint = atom({ plugin: 'merk-dir-das', key: 'hint' } as const, null)
5
6const SYSTEM =
7  'Du liest die Antwort eines Coding-Agenten mit. Gibt es darin etwas, das der Nutzer auf keinen Fall überlesen darf ' +
8  '(Kosten, Risiken, Fristen, Sicherheitsthemen, etwas, das er selbst tun muss)? Wenn ja: genau ein kurzer deutscher Satz, ' +
9  'konkret mit Zahl, falls vorhanden. Wenn nein: antworte exakt NICHTS.'
10
11async function review($: EngineInterface) {
12  const messages = await $.session.messages()
13  const last = [...messages].reverse().find(m => m.role === 'assistant' && m.text.trim().length > 0)
14  if (!last || last.text.length < 400) return
15
16  const reply = await $.model.complete({ model: 'haiku', maxTokens: 120, system: SYSTEM, prompt: last.text.slice(-12_000) })
17  if (!reply.isAnswered) return
18  const text = reply.text.trim()
19  if (text === '' || /^NICHTS\b/i.test(text)) return
20
21  await update($, hint, () => text)
22}
23
24export const register: Register = on => {
25  on('prompt.submit', async ($, e, next) => {
26    await update($, hint, () => null)
27    return next(e)
28  })
29
30  on('turn.complete', async ($, e, next) => {
31    const done = await next(e)
32    if (e.reason === 'answer') void review($)
33    return done
34  })
35
36  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
37    const text = await read($, hint)
38    if (text === null || e.props.hasSurvey) return next(e)
39
40    const { Box, Button, Text } = $.ui.resolve(e)
41    return (
42      <Box flexDirection="column">
43        <Box flexDirection="row" gap={1}>
44          <Text backgroundColor="yellow" color="black" bold wrap="truncate"> 💡 GUT ZU WISSEN </Text>
45          <Button key="ok" label="1 OK" hotkey="1" onPress={() => update($, hint, () => null)} />
46        </Box>
47        <Text color="yellow">{text}</Text>
48      </Box>
49    )
50  })
51}
52
types/index.d.ts 8 lines
1export type Hint = string | null
2
3declare module 'claude-code' {
4  interface PluginState {
5    'merk-dir-das': { hint: Hint }
6  }
7}
8