Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / secret-guard

secret-guard

Keeps secrets out of Claude's context: gitleaks scans every tool output, prompt and attachment before the model reads it, and you decide what the model sees.

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonText
runs programs, draws

What it does

  • Draws a pane, the status line
  • Adds /secrets
  • Watches tool calls and can refuse them
  • Hooks prompt.attachment, prompt.compose, prompt.context, prompt.mention and 3 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors
  • Writes no files

Code to start from

A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like secret-guard by Legostin Vyacheslav (pane, status, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/legostin-secret-guard/
// Written by ModsCode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the pane: open it with $.ui.open({ id: 'my-pane', title: "secret-guard" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const scanner = '…'
    const installButton = '…'
    const intro = '…'
    const pendingTitle = '…'
    const source = '…'
    const rule = '…'
    const mask = '…'
    const place = '…'
    const pendingLegend = '…'
    const numberOf = '…'
    const tidy = '…'
    const numberOf2 = '…'
    const tidy2 = '…'
    const numberOf3 = '…'
    const tidy3 = '…'
    const valueLabel = '…'
    const value = '…'
    const valueWarning = '…'
    const valueGone = '…'
    const rule2 = '…'
    const mask2 = '…'
    const place2 = '…'
    const pendingLegend2 = '…'
    const numberOf4 = '…'
    const tidy4 = '…'
    const numberOf5 = '…'
    const tidy5 = '…'
    const numberOf6 = '…'
    const tidy6 = '…'
    const valueLabel2 = '…'
    const value2 = '…'
    const valueWarning2 = '…'
    const valueGone2 = '…'
    const rule3 = '…'
    const mask3 = '…'
    const place3 = '…'
    const pendingLegend3 = '…'
    const numberOf7 = '…'
    const tidy7 = '…'
    const numberOf8 = '…'
    const tidy8 = '…'
    const numberOf9 = '…'
    const tidy9 = '…'
    const valueLabel3 = '…'
    const value3 = '…'
    const valueWarning3 = '…'
    const valueGone3 = '…'
    const tabSession = '…'
    const tabHistory = '…'
    const clearHistory = '…'
    const historyHint = '…'
    const historyNone = '…'
    const sessionHeader = '…'
    const dropSession = '…'
    const title = '…'
    const decisions = '…'
    const place4 = '…'
    const sourceLabel = '…'
    const fileLabel = '…'
    const filePath = '…'
    const noPlace = '…'
    const legend = '…'
    const numberOf10 = '…'
    const tidy10 = '…'
    const inText = '…'
    const tidy11 = '…'
    const numberOf11 = '…'
    const tidy12 = '…'
    const inText2 = '…'
    const tidy13 = '…'
    const numberOf12 = '…'
    const tidy14 = '…'
    const inText3 = '…'
    const tidy15 = '…'
    const valueLabel4 = '…'
    const value4 = '…'
    const valueWarning4 = '…'
    const valueGone4 = '…'
    const allowButton = '…'
    const decisions2 = '…'
    const place5 = '…'
    const fileLabel2 = '…'
    const filePath2 = '…'
    const noPlace2 = '…'
    const legend2 = '…'
    const numberOf13 = '…'
    const tidy16 = '…'
    const inText4 = '…'
    const tidy17 = '…'
    const numberOf14 = '…'
    const tidy18 = '…'
    const inText5 = '…'
    const tidy19 = '…'
    const numberOf15 = '…'
    const tidy20 = '…'
    const inText6 = '…'
    const tidy21 = '…'
    const valueLabel5 = '…'
    const value5 = '…'
    const valueWarning5 = '…'
    const valueGone5 = '…'
    const decisions3 = '…'
    const place6 = '…'
    const fileLabel3 = '…'
    const filePath3 = '…'
    const noPlace3 = '…'
    const legend3 = '…'
    const numberOf16 = '…'
    const tidy22 = '…'
    const inText7 = '…'
    const tidy23 = '…'
    const numberOf17 = '…'
    const tidy24 = '…'
    const inText8 = '…'
    const tidy25 = '…'
    const numberOf18 = '…'
    const tidy26 = '…'
    const inText9 = '…'
    const tidy27 = '…'
    const valueLabel6 = '…'
    const value6 = '…'
    const valueWarning6 = '…'
    const valueGone6 = '…'
    const sessionHeader2 = '…'
    const decisions4 = '…'
    const place7 = '…'
    const fileLabel4 = '…'
    const filePath4 = '…'
    const noPlace4 = '…'
    const legend4 = '…'
    const numberOf19 = '…'
    const tidy28 = '…'
    const inText10 = '…'
    const tidy29 = '…'
    const numberOf20 = '…'
    const tidy30 = '…'
    const inText11 = '…'
    const tidy31 = '…'
    const numberOf21 = '…'
    const tidy32 = '…'
    const inText12 = '…'
    const tidy33 = '…'
    const valueLabel7 = '…'
    const value7 = '…'
    const valueWarning7 = '…'
    const valueGone7 = '…'
    const decisions5 = '…'
    const place8 = '…'
    const fileLabel5 = '…'
    const filePath5 = '…'
    const noPlace5 = '…'
    const legend5 = '…'
    const numberOf22 = '…'
    const tidy34 = '…'
    const inText13 = '…'
    const tidy35 = '…'
    const numberOf23 = '…'
    const tidy36 = '…'
    const inText14 = '…'
    const tidy37 = '…'
    const numberOf24 = '…'
    const tidy38 = '…'
    const inText15 = '…'
    const tidy39 = '…'
    const valueLabel8 = '…'
    const value8 = '…'
    const valueWarning8 = '…'
    const valueGone8 = '…'
    const decisions6 = '…'
    const place9 = '…'
    const fileLabel6 = '…'
    const filePath6 = '…'
    const noPlace6 = '…'
    const legend6 = '…'
    const numberOf25 = '…'
    const tidy40 = '…'
    const inText16 = '…'
    const tidy41 = '…'
    const numberOf26 = '…'
    const tidy42 = '…'
    const inText17 = '…'
    const tidy43 = '…'
    const numberOf27 = '…'
    const tidy44 = '…'
    const inText18 = '…'
    const tidy45 = '…'
    const valueLabel9 = '…'
    const value9 = '…'
    const valueWarning9 = '…'
    const valueGone9 = '…'
    const sessionHeader3 = '…'
    const decisions7 = '…'
    const place10 = '…'
    const fileLabel7 = '…'
    const filePath7 = '…'
    const noPlace7 = '…'
    const legend7 = '…'
    const numberOf28 = '…'
    const tidy46 = '…'
    const inText19 = '…'
    const tidy47 = '…'
    const numberOf29 = '…'
    const tidy48 = '…'
    const inText20 = '…'
    const tidy49 = '…'
    const numberOf30 = '…'
    const tidy50 = '…'
    const inText21 = '…'
    const tidy51 = '…'
    const valueLabel10 = '…'
    const value10 = '…'
    const valueWarning10 = '…'
    const valueGone10 = '…'
    const decisions8 = '…'
    const place11 = '…'
    const fileLabel8 = '…'
    const filePath8 = '…'
    const noPlace8 = '…'
    const legend8 = '…'
    const numberOf31 = '…'
    const tidy52 = '…'
    const inText22 = '…'
    const tidy53 = '…'
    const numberOf32 = '…'
    const tidy54 = '…'
    const inText23 = '…'
    const tidy55 = '…'
    const numberOf33 = '…'
    const tidy56 = '…'
    const inText24 = '…'
    const tidy57 = '…'
    const valueLabel11 = '…'
    const value11 = '…'
    const valueWarning11 = '…'
    const valueGone11 = '…'
    const decisions9 = '…'
    const place12 = '…'
    const fileLabel9 = '…'
    const filePath9 = '…'
    const noPlace9 = '…'
    const legend9 = '…'
    const numberOf34 = '…'
    const tidy58 = '…'
    const inText25 = '…'
    const tidy59 = '…'
    const numberOf35 = '…'
    const tidy60 = '…'
    const inText26 = '…'
    const tidy61 = '…'
    const numberOf36 = '…'
    const tidy62 = '…'
    const inText27 = '…'
    const tidy63 = '…'
    const valueLabel12 = '…'
    const value12 = '…'
    const valueWarning12 = '…'
    const valueGone12 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="column">
          <Box flexDirection="row" gap={1}>
            <Text wrap="wrap" color="success">
              {scanner}
            </Text>
            <Button label={`${installButton}`} />
          </Box>
          <Text wrap="wrap" dimColor>
            {intro}
          </Text>
          <Box flexDirection="column" borderStyle="round" borderColor="warning" paddingX={1} marginTop={1}>
            <Text wrap="wrap" bold color="warning">
              {pendingTitle}
            </Text>
            <Text wrap="wrap" dimColor>
              {source}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" bold>
                {rule}
                {" "}
                {mask}
              </Text>
              <Text wrap="wrap">
                {place}
              </Text>
              <Text wrap="wrap" dimColor>
                {pendingLegend}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf}
                {tidy}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf2}
                {tidy2}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf3}
                {tidy3}
              </Text>
              <Box flexDirection="column" marginTop={1}>
                <Text wrap="wrap" color="warning" bold>
                  {valueLabel}
                  {" "}
                  {value}
                </Text>
                <Text wrap="wrap" dimColor>
                  {valueWarning}
                </Text>
              </Box>
              <Box flexDirection="row" marginTop={1}>
                <Text dimColor>
                  {valueGone}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" bold>
                {rule2}
                {" "}
                {mask2}
              </Text>
              <Text wrap="wrap">
                {place2}
              </Text>
              <Text wrap="wrap" dimColor>
                {pendingLegend2}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf4}
                {tidy4}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf5}
                {tidy5}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf6}
                {tidy6}
              </Text>
              <Box flexDirection="column" marginTop={1}>
                <Text wrap="wrap" color="warning" bold>
                  {valueLabel2}
                  {" "}
                  {value2}
                </Text>
                <Text wrap="wrap" dimColor>
                  {valueWarning2}
                </Text>
              </Box>
              <Box flexDirection="row" marginTop={1}>
                <Text dimColor>
                  {valueGone2}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" bold>
                {rule3}
                {" "}
                {mask3}
              </Text>
              <Text wrap="wrap">
                {place3}
              </Text>
              <Text wrap="wrap" dimColor>
                {pendingLegend3}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf7}
                {tidy7}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf8}
                {tidy8}
              </Text>
              <Text wrap="wrap">
                {"› "}
                {numberOf9}
                {tidy9}
              </Text>
              <Box flexDirection="column" marginTop={1}>
                <Text wrap="wrap" color="warning" bold>
                  {valueLabel3}
                  {" "}
                  {value3}
                </Text>
                <Text wrap="wrap" dimColor>
                  {valueWarning3}
                </Text>
              </Box>
              <Box flexDirection="row" marginTop={1}>
                <Text dimColor>
                  {valueGone3}
                </Text>
              </Box>
            </Box>
          </Box>
          <Box flexDirection="row" gap={1} marginTop={1}>
            <Button label={`${tabSession}`} />
            <Button label={`${tabHistory}`} />
          </Box>
        </Box>
        <Box flexDirection="row" marginTop={1} justifyContent="space-between">
          <Text bold>
            {tabHistory}
          </Text>
          <Button label={`${clearHistory}`} />
        </Box>
        <Text wrap="wrap" dimColor>
          {historyHint}
        </Text>
        <Text dimColor>
          {historyNone}
        </Text>
        <Box flexDirection="column" marginTop={2}>
          <Box flexDirection="row" justifyContent="space-between">
            <Text wrap="wrap" bold color="accent">
              {sessionHeader}
            </Text>
            <Button label={`${dropSession}`} />
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions}
            </Text>
            <Text wrap="wrap">
              {place4}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel}
              {" "}
              {filePath}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf10}
                  {tidy10}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText}
                  {" "}
                  {tidy11}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf11}
                  {tidy12}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText2}
                  {" "}
                  {tidy13}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf12}
                  {tidy14}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText3}
                  {" "}
                  {tidy15}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel4}
                {" "}
                {value4}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning4}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone4}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions2}
            </Text>
            <Text wrap="wrap">
              {place5}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel2}
              {" "}
              {filePath2}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace2}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend2}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf13}
                  {tidy16}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText4}
                  {" "}
                  {tidy17}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf14}
                  {tidy18}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText5}
                  {" "}
                  {tidy19}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf15}
                  {tidy20}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText6}
                  {" "}
                  {tidy21}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel5}
                {" "}
                {value5}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning5}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone5}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions3}
            </Text>
            <Text wrap="wrap">
              {place6}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel3}
              {" "}
              {filePath3}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace3}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend3}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf16}
                  {tidy22}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText7}
                  {" "}
                  {tidy23}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf17}
                  {tidy24}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText8}
                  {" "}
                  {tidy25}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf18}
                  {tidy26}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText9}
                  {" "}
                  {tidy27}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel6}
                {" "}
                {value6}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning6}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone6}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={2}>
          <Box flexDirection="row" justifyContent="space-between">
            <Text wrap="wrap" bold color="accent">
              {sessionHeader2}
            </Text>
            <Button label={`${dropSession}`} />
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions4}
            </Text>
            <Text wrap="wrap">
              {place7}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel4}
              {" "}
              {filePath4}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace4}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend4}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf19}
                  {tidy28}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText10}
                  {" "}
                  {tidy29}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf20}
                  {tidy30}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText11}
                  {" "}
                  {tidy31}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf21}
                  {tidy32}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText12}
                  {" "}
                  {tidy33}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel7}
                {" "}
                {value7}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning7}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone7}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions5}
            </Text>
            <Text wrap="wrap">
              {place8}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel5}
              {" "}
              {filePath5}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace5}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend5}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf22}
                  {tidy34}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText13}
                  {" "}
                  {tidy35}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf23}
                  {tidy36}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText14}
                  {" "}
                  {tidy37}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf24}
                  {tidy38}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText15}
                  {" "}
                  {tidy39}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel8}
                {" "}
                {value8}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning8}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone8}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions6}
            </Text>
            <Text wrap="wrap">
              {place9}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel6}
              {" "}
              {filePath6}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace6}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend6}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf25}
                  {tidy40}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText16}
                  {" "}
                  {tidy41}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf26}
                  {tidy42}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText17}
                  {" "}
                  {tidy43}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf27}
                  {tidy44}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText18}
                  {" "}
                  {tidy45}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel9}
                {" "}
                {value9}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning9}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone9}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={2}>
          <Box flexDirection="row" justifyContent="space-between">
            <Text wrap="wrap" bold color="accent">
              {sessionHeader3}
            </Text>
            <Button label={`${dropSession}`} />
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions7}
            </Text>
            <Text wrap="wrap">
              {place10}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel7}
              {" "}
              {filePath7}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace7}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend7}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf28}
                  {tidy46}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText19}
                  {" "}
                  {tidy47}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf29}
                  {tidy48}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText20}
                  {" "}
                  {tidy49}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf30}
                  {tidy50}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText21}
                  {" "}
                  {tidy51}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel10}
                {" "}
                {value10}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning10}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone10}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions8}
            </Text>
            <Text wrap="wrap">
              {place11}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel8}
              {" "}
              {filePath8}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace8}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend8}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf31}
                  {tidy52}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText22}
                  {" "}
                  {tidy53}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf32}
                  {tidy54}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText23}
                  {" "}
                  {tidy55}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf33}
                  {tidy56}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText24}
                  {" "}
                  {tidy57}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel11}
                {" "}
                {value11}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning11}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone11}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Button plain label={`${title}`} />
            <Text wrap="wrap" color="success">
              {decisions9}
            </Text>
            <Text wrap="wrap">
              {place12}
            </Text>
            <Text wrap="wrap" dimColor>
              {`${sourceLabel} ${source}`}
            </Text>
            <Text wrap="wrap" dimColor>
              {fileLabel9}
              {" "}
              {filePath9}
            </Text>
            <Text wrap="wrap" dimColor>
              {noPlace9}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" dimColor>
                {legend9}
              </Text>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf34}
                  {tidy58}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText25}
                  {" "}
                  {tidy59}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf35}
                  {tidy60}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText26}
                  {" "}
                  {tidy61}
                </Text>
              </Box>
              <Box flexDirection="column">
                <Text wrap="wrap">
                  {"› "}
                  {numberOf36}
                  {tidy62}
                </Text>
                <Text wrap="wrap" color="warning">
                  {"  "}
                  {inText27}
                  {" "}
                  {tidy63}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Text wrap="wrap" color="warning" bold>
                {valueLabel12}
                {" "}
                {value12}
              </Text>
              <Text wrap="wrap" dimColor>
                {valueWarning12}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Text dimColor>
                {valueGone12}
              </Text>
              <Button label={`${allowButton}`} />
            </Box>
          </Box>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const detail = '…'
    await $.ui.status(`secret-guard: ${detail}`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

hooks/register.tsx lines 143–143 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, ($, e) => drawPane($, e))
hooks/register.tsx lines 980–1139 · Pane
async function drawPane($: EngineInterface, e: EventOf['ui.render']) {
  const { Box, Text, Button } = $.ui.resolve(e)
  const journal = await read($, entries)
  const allowList = await read($, allowed)
  const registry = Object.values(await read($, known)).sort((a, b) => b.lastAt - a.lastAt)
  const state = await read($, scanner)
  const opened = new Set(await read($, expanded))
  const openedPast = new Set(await read($, openedHistory))
  const shownValues = new Set(await read($, revealed))
  const activeTab = await read($, tab)
  const asking = await read($, pending)
  await read($, historyVersion)
  const allowedBy = new Map(allowList.map(one => [one.hash, one.reason]))
  const width = Math.max(24, 'bodyColumns' in e.props && typeof e.props.bodyColumns === 'number' ? e.props.bodyColumns : 60)
  const shown = journal.slice(-50).reverse()

  const toggle = (seq: number) =>
    update($, expanded, list => (list.includes(seq) ? list.filter(one => one !== seq) : [...list, seq]))
  const hideValue = (hash: string) => update($, revealed, list => list.filter(one => one !== hash))
  const showValue = async (hash: string) => {
    await update($, revealed, list => (list.includes(hash) ? list : [...list, hash]))
    $.clock.after(REVEAL_MS, () => hideValue(hash))
  }
  const allowHash = async (hash: string, rule: string, shownMask: string) => {
    await update($, allowed, list =>
      list.some(one => one.hash === hash) ? list : [...list, { hash, rule, mask: shownMask, reason: 'allowlisted' as const }],
    )
    await refreshStatus($)
  }
  const cutAgain = async (hash: string) => {
    await update($, allowed, list => list.filter(one => one.hash !== hash))
    await refreshStatus($)
  }
  const forget = async (hash: string) => {
    await update($, known, current => {
      const next = { ...current }
      delete next[hash]

      return next
    })
    await update($, allowed, list => list.filter(one => one.hash !== hash))
    await update($, revealed, list => list.filter(one => one !== hash))
    values.delete(hash)
    await refreshStatus($)
  }
  const forgetAll = async () => {
    await update($, known, () => ({}))
    await update($, allowed, () => [])
    await update($, revealed, () => [])
    values.clear()
    await refreshStatus($)
  }
  const clearLog = async () => {
    await update($, entries, () => [])
    await update($, expanded, () => [])
    await refreshStatus($)
  }

  const drawValue = (hash: string) => {
    const value = values.get(hash)
    if (value === undefined || !shownValues.has(hash)) return undefined

    return (
      <Box flexDirection="column" marginTop={1}>
        <Text wrap="wrap" color="warning" bold>
          {t.pane.valueLabel} {value}
        </Text>
        <Text wrap="wrap" dimColor>
          {t.pane.valueWarning}
        </Text>
      </Box>
    )
  }
  const revealButton = (hash: string, key: string) =>
    values.get(hash) === undefined ? (
      <Text dimColor>{t.pane.valueGone}</Text>
    ) : (
      <Button
        key={key}
        label={shownValues.has(hash) ? t.pane.hideValue : t.pane.showValue}
        onPress={() => (shownValues.has(hash) ? hideValue(hash) : showValue(hash))}
      />
    )

  const drawSecret = (one: Known) => {
    const passing = allowedBy.get(one.hash)
    const status = passing === undefined ? (one.number > 0 ? t.pane.statusCut : t.pane.statusNew) : passing === 'passed' ? t.pane.statusPassed : t.pane.statusAllowed

    return (
      <Box key={`secret-${one.hash}`} flexDirection="column" marginTop={1}>
        <Text wrap="wrap" bold>
          {one.rule}
          {one.number > 0 ? ` #${one.number}` : ''} {one.mask}
        </Text>
        <Text wrap="wrap" color={passing === undefined ? 'success' : 'warning'}>
          {status}
        </Text>
        <Text wrap="truncate-end" dimColor>
          {t.pane.seen(one.seen)} · {t.pane.last(clock(one.lastAt), one.lastSource)}
        </Text>
        {drawValue(one.hash)}
        <Box flexDirection="row" gap={1}>
          {revealButton(one.hash, `reveal-secret-${one.hash}`)}
          {passing === undefined ? (
            <Button key={`allow-secret-${one.hash}`} label={t.pane.allowButton} onPress={() => allowHash(one.hash, one.rule, one.mask)} />
          ) : (
            <Button key={`cut-secret-${one.hash}`} label={t.pane.cutButton} onPress={() => cutAgain(one.hash)} />
          )}
          <Button key={`forget-${one.hash}`} label={t.pane.forgetButton} onPress={() => forget(one.hash)} />
        </Box>
      </Box>
    )
  }

  const drawEntry = (entry: EntryView, key: string, isOpen: boolean, onToggle: () => unknown) => {
    const lines = entry.lines ?? []
    const hits = lines.filter(line => line.isHit)
    const firstHit = hits[0]?.n ?? 0
    const lastHit = hits.at(-1)?.n ?? 0
    const reach = isOpen ? Infinity : AROUND_CLOSED
    const window = lines.filter(line => line.n >= firstHit - reach && line.n <= lastHit + reach)
    const place =
      entry.line === undefined
        ? undefined
        : entry.file !== undefined && entry.isFileLine === true
          ? t.pane.at(entry.file, entry.line)
          : `${entry.file === undefined ? '' : `${entry.file} · `}${t.pane.textLine(entry.line)}`
    const title = `${isOpen ? '▾' : '▸'} ${clock(entry.at)}  ${entry.rule}${entry.label > 0 ? ` #${entry.label}` : ''}  ${entry.mask}`
    const legend = NOTHING.has(entry.decision) ? t.pane.legendNothing : SAW.has(entry.decision) ? t.pane.legendSaw : t.pane.legendRead
    const numberOf = (n: number) => (entry.isNumbered === true ? '' : `${String(n).padStart(4)}  `)
    const isUnread = NOTHING.has(entry.decision)
    const hash = entry.hash === undefined || entry.hash === '' ? undefined : entry.hash

    return (
      <Box key={`entry-${key}`} flexDirection="column" marginTop={1}>
        <Button key={`open-${key}`} plain label={title} onPress={onToggle} />
        <Text wrap="wrap" color={CUT.has(entry.decision) ? 'success' : 'warning'}>
          {t.decisions[entry.decision]}
        </Text>
        {place !== undefined && <Text wrap={isOpen ? 'wrap' : 'truncate-middle'}>{place}</Text>}
        <Text wrap={isOpen ? 'wrap' : 'truncate-end'} dimColor>
          {isOpen ? `${t.pane.sourceLabel} ${entry.source}` : entry.source}
        </Text>
        {isOpen && entry.filePath !== undefined && (
          <Text wrap="wrap" dimColor>
            {t.pane.fileLabel} {entry.filePath}
          </Text>
        )}
        {entry.lines === undefined && entry.rule !== t.unavailable && (
          <Text wrap="wrap" dimColor>
            {t.pane.noPlace}
          </Text>
        )}
        {window.length > 0 && (
          <Box flexDirection="column" marginTop={1}>
            <Text wrap="wrap" dimColor>
              {legend}
            </Text>
            {window.map(line => (
              <Box key={`line-${key}-${line.n}`} flexDirection="column">
Licence text (MIT)
MIT License

Copyright (c) 2026 Legostin Vyacheslav

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

How to build this: Pane (panel), Deny a tool call

What its code calls

runs programsreads filesenv varstool callsremembers

What its code shows

Read from the source at commit abd15621a611 on 2026-10-11. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.5 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.hooks/register.tsx:373 a program named at run time; hooks/register.tsx:424 a program named at run time; hooks/register.tsx:446 a program named at run time; hooks/register.tsx:549 a program named at run time
Reads and sendsWhether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads environment variables, files, but reaches nothing outside
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets ModsCode show its code; otherwise the code is linked.MIT
Settings hooksHooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone
Servers it shipsMCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/
Skills, commands, agentsWhat its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows
Tools and MCPWhether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command
Asks of the modelCompletions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command secrets
Events it hooksBy what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: command.run (secrets), tool.call, session.append, prompt.submit, prompt.mention · shapes: prompt.compose, prompt.context · reads: prompt.attachment · also: session.start, ui.render (Pane) · timers: clock.after
Reads, by nameThe environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: HOME, GITLEAKS_CONFIG; files: a path computed at run time, …/.gitleaks.toml
Writes, by nameThe files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.the prompt box

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and ModsCode does not vouch for what this code does. Read its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

From its marketplace

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add legostin/claude-code-secret-guard
/plugin install secret-guard@secret-guard
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (abd15621a611). Compare them before you install. /reload-plugins loads it into a session that is already open.

Try the commit ModsCode read

No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:

git clone https://github.com/legostin/claude-code-secret-guard
git -C claude-code-secret-guard checkout abd15621a611263d593ac00182a2ccf6d49f5f0a
claude plugin validate claude-code-secret-guard
claude --plugin-dir claude-code-secret-guard

The validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.

Ask Claude about it

With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:

Read the ModsCode mod "legostin-secret-guard" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

Badge for your README

If this is your mod, paste this into your README. It links to this page.

README.md
[![ModsCode](https://modscode.com/badge/legostin-secret-guard.svg)](https://modscode.com/claude-mods/mods/legostin-secret-guard/)