Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / decision-lens

decision-lens

See the decisions Claude made in each turn, why it made them, and steer future turns with keep and avoid rules.

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonText
drives Claude, draws

What it does

  • Draws a pane, the status line, toasts
  • Adds /why
  • Watches tool calls and can refuse them
  • Hooks prompt.compose, session.start, turn.complete, turn.start and 1 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Handles errors

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 decision-lens by Atchyut (pane, status, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/theonly1me-decision-lens/
// 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: "Decision Lens" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const position = '…'
    const ruleCount = '…'
    const hint = '…'
    const prompt = '…'
    const message = '…'
    const number = '…'
    const title = '…'
    const confidenceGlyph = '…'
    const label = '…'
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    const alternative = '…'
    const unquoted = '…'
    const explanation = '…'
    const confidenceGlyph2 = '…'
    const text4 = '…'
    const text5 = '…'
    const text6 = '…'
    const explanation2 = '…'
    const confidenceGlyph3 = '…'
    const text7 = '…'
    const text8 = '…'
    const text9 = '…'
    const explanation3 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="column" marginBottom={1}>
          <Text>
            <Text bold color="#a78bfa">
              Decision Lens
            </Text>
            <Text dimColor>
              {position}
            </Text>
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
            <Button plain hotkey="p" label="◀ Earlier turn" />
            <Button plain hotkey="n" label="Later turn ▶" />
            <Button plain hotkey="d" label="Decisions" />
            <Button plain hotkey="r" label={`Rules (${ruleCount})`} />
            <Button plain hotkey="x" role="dismiss" label="Close" />
          </Box>
          <Text color="#8b93a1">
            {hint}
          </Text>
        </Box>
        <Text italic dimColor>
          {`“${prompt}”`}
        </Text>
        <Text dimColor>
          {message}
        </Text>
        <Box flexDirection="column" borderStyle="round" borderColor="#a78bfa" paddingX={1}>
          <Box flexDirection="row" justifyContent="space-between" columnGap={1}>
            <Button plain hotkey={`${number}`} label={`◆ ${title}`} />
            <Text color="#8b93a1">
              {confidenceGlyph}
            </Text>
          </Box>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text}
          </Text>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text2}
          </Text>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text3}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text italic dimColor>
            {`“${unquoted}”`}
          </Text>
          <Text color="#a78bfa">
            Asking Claude…
          </Text>
          <Text>
            {explanation}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
            <Text color="#34d399">
              ✓ keep rule saved
            </Text>
            <Text color="#fb7185">
              ✓ avoid rule saved
            </Text>
            <Button plain label="? Ask why" />
          </Box>
        </Box>
        <Box flexDirection="column" borderStyle="round" borderColor="#a78bfa" paddingX={1}>
          <Box flexDirection="row" justifyContent="space-between" columnGap={1}>
            <Button plain hotkey={`${number}`} label={`◆ ${title}`} />
            <Text color="#8b93a1">
              {confidenceGlyph2}
            </Text>
          </Box>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text4}
          </Text>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text5}
          </Text>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text6}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text italic dimColor>
            {`“${unquoted}”`}
          </Text>
          <Text color="#a78bfa">
            Asking Claude…
          </Text>
          <Text>
            {explanation2}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
            <Text color="#34d399">
              ✓ keep rule saved
            </Text>
            <Text color="#fb7185">
              ✓ avoid rule saved
            </Text>
            <Button plain label="? Ask why" />
          </Box>
        </Box>
        <Box flexDirection="column" borderStyle="round" borderColor="#a78bfa" paddingX={1}>
          <Box flexDirection="row" justifyContent="space-between" columnGap={1}>
            <Button plain hotkey={`${number}`} label={`◆ ${title}`} />
            <Text color="#8b93a1">
              {confidenceGlyph3}
            </Text>
          </Box>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text7}
          </Text>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text8}
          </Text>
          <Text>
            <Text bold>
              {`${label}  `}
            </Text>
            {text9}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text dimColor>
            {`◇ ${alternative}`}
          </Text>
          <Text italic dimColor>
            {`“${unquoted}”`}
          </Text>
          <Text color="#a78bfa">
            Asking Claude…
          </Text>
          <Text>
            {explanation3}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
            <Text color="#34d399">
              ✓ keep rule saved
            </Text>
            <Text color="#fb7185">
              ✓ avoid rule saved
            </Text>
            <Button plain label="? Ask why" />
          </Box>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.status(`◆ reading the decisions in this turn`)
    await $.ui.toast(`Keep rule saved. Claude reads it from the next request.`)
    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.

plugins/decision-lens/hooks/pane.tsx lines 116–156 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE_ID }, async ($, e) => {
    const elements = $.ui.resolve(e)
    const { Box, Text } = elements
    const view = lensView()
    const turn = selectedTurn()
    const act = (action: PaneAction) => {
      perform($, { action }).catch(noop)
    }
    const hasCards = view.tab === 'decisions' && turn?.status === 'ready' && turn.decisions.length > 0
    const position = view.tab === 'decisions' && turn ? `  turn ${view.turns.indexOf(turn) + 1} of ${view.turns.length}` : ''
    const message = view.tab === 'decisions' ? turnMessage({ turn, isAnalysisOn: view.isAnalysisOn }) : undefined
    const header = headerTree({
      elements,
      act,
      tab: view.tab,
      position,
      ruleCount: view.rules.length,
      hint: hintText({ isFocused: e.props.isFocused, tab: view.tab }),
    })
    if (view.tab === 'rules') {
      return (
        <Box flexDirection="column">
          {header}
          <Text dimColor>Claude reads these rules in every session: project rules here, global rules everywhere.</Text>
          {view.rules.length === 0 && <Text dimColor>No rules yet. Press k or a on a decision card, or type /why keep 1.</Text>}
          {view.rules.map((rule, index) => ruleTree({ elements, act, rule, number: index + 1 }))}
        </Box>
      )
    }
    return (
      <Box flexDirection="column">
        {header}
        {turn && <Text italic dimColor>{`“${turn.prompt}”`}</Text>}
        {message !== undefined && <Text dimColor>{message}</Text>}
        {hasCards &&
          turn.decisions.map((decision, index) =>
            cardTree({ elements, act, turn, decision, number: index + 1, isSelected: index + 1 === view.selectedNumber, rules: view.rules }),
          )}
      </Box>
    )
  })
plugins/decision-lens/hooks/lens/panel.tsx lines 30–56 · Pane
export function headerTree(options: {
  elements: ElementTable
  act: Act
  tab: LensTab
  position: string
  ruleCount: number
  hint: string
}): RenderElement {
  const { Box, Text, Button } = options.elements
  const { act, tab } = options
  return (
    <Box flexDirection="column" marginBottom={1}>
      <Text>
        <Text bold color={COLORS.accent}>Decision Lens</Text>
        <Text dimColor>{options.position}</Text>
      </Text>
      <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
        <Button key="previous" plain hotkey="p" label="◀ Earlier turn" onPress={() => act({ kind: 'turn', step: -1 })} />
        <Button key="next" plain hotkey="n" label="Later turn ▶" onPress={() => act({ kind: 'turn', step: 1 })} />
        <Button key="tab-decisions" plain hotkey="d" label="Decisions" dimColor={tab !== 'decisions'} onPress={() => act({ kind: 'tab', tab: 'decisions' })} />
        <Button key="tab-rules" plain hotkey="r" label={`Rules (${options.ruleCount})`} dimColor={tab !== 'rules'} onPress={() => act({ kind: 'tab', tab: 'rules' })} />
        <Button key="close" plain hotkey="x" role="dismiss" label="Close" onPress={() => act({ kind: 'close' })} />
      </Box>
      <Text color={COLORS.muted}>{options.hint}</Text>
    </Box>
  )
}
plugins/decision-lens/hooks/lens/panel.tsx lines 121–139 · Pane
export function ruleTree(options: { elements: ElementTable; act: Act; rule: Rule; number: number }): RenderElement {
  const { Box, Text, Button } = options.elements
  const { act, rule } = options
  const isKeep = rule.kind === 'keep'
  return (
    <Box key={`rule-${rule.id}`} flexDirection="column" marginBottom={1}>
      <Text>
        <Text color={COLORS.muted}>{`${options.number}. `}</Text>
        <Text color={isKeep ? COLORS.keep : COLORS.avoid}>{isKeep ? '▲ keep  ' : '▼ avoid '}</Text>
        {rule.text}
      </Text>
      <Box flexDirection="row" columnGap={2} paddingLeft={3}>
        <Text dimColor>{rule.scope === 'project' ? 'this project' : 'every project'}</Text>
        <Button key={`scope-${rule.id}`} label={rule.scope === 'project' ? 'Make global' : 'This project only'} onPress={() => act({ kind: 'scope', ruleId: rule.id })} />
        <Button key={`remove-${rule.id}`} label="Remove" onPress={() => act({ kind: 'remove', ruleId: rule.id })} />
      </Box>
    </Box>
  )
}
plugins/decision-lens/hooks/lens/panel.tsx lines 87–119 · Pane
export function cardTree(options: {
  elements: ElementTable
  act: Act
  turn: LensTurn
  decision: Decision
  number: number
  isSelected: boolean
  rules: readonly Rule[]
}): RenderElement {
  const { Box, Text, Button } = options.elements
  const { decision, number, isSelected } = options
  return (
    <Box key={`decision-${decision.id}`} flexDirection="column" borderStyle="round" borderColor={isSelected ? COLORS.accent : COLORS.frame} paddingX={1}>
      <Box flexDirection="row" justifyContent="space-between" columnGap={1}>
        <Button key={`card-${number}`} plain hotkey={String(number)} {...(number === 1 ? ({ autoFocus: true } as const) : {})} label={`◆ ${decision.title}`} onPress={() => options.act({ kind: 'select', number })} />
        <Text color={COLORS.muted}>{confidenceGlyph(decision.confidence)}</Text>
      </Box>
      {decisionBody(decision).map(part => (
        <Text>
          <Text bold>{`${part.label}  `}</Text>
          {part.text}
        </Text>
      ))}
      {decision.alternatives.map(alternative => (
        <Text dimColor>{`◇ ${alternative}`}</Text>
      ))}
      {decision.evidence !== '' && <Text italic dimColor>{`“${unquoted(decision.evidence)}”`}</Text>}
      {decision.isAsking && <Text color={COLORS.accent}>Asking Claude…</Text>}
      {decision.explanation !== '' && <Text>{decision.explanation}</Text>}
      {steerButtons(options)}
    </Box>
  )
}
plugins/decision-lens/hooks/lens/panel.tsx lines 58–85 · Pane
function steerButtons(options: {
  elements: ElementTable
  act: Act
  turn: LensTurn
  decision: Decision
  rules: readonly Rule[]
  isSelected: boolean
}): RenderElement {
  const { Box, Text, Button } = options.elements
  const { act, decision, isSelected } = options
  const ids = { turnId: options.turn.id, decisionId: decision.id }
  const keyed = (key: string) => (isSelected ? { hotkey: key } : {})
  return (
    <Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
      {hasRule({ rules: options.rules, text: decision.keep }) ? (
        <Text color={COLORS.keep}>✓ keep rule saved</Text>
      ) : (
        <Button key={`keep-${decision.id}`} plain {...keyed('k')} dimColor={!isSelected} label="▲ Keep doing this" onPress={() => act({ kind: 'keep', ...ids })} />
      )}
      {hasRule({ rules: options.rules, text: decision.avoid }) ? (
        <Text color={COLORS.avoid}>✓ avoid rule saved</Text>
      ) : (
        <Button key={`avoid-${decision.id}`} plain {...keyed('a')} dimColor={!isSelected} label="▼ Don't do this" onPress={() => act({ kind: 'avoid', ...ids })} />
      )}
      <Button key={`why-${decision.id}`} plain {...keyed('w')} dimColor={!isSelected} label="? Ask why" onPress={() => act({ kind: 'ask', ...ids })} />
    </Box>
  )
}
Licence text (MIT)
MIT License

Copyright (c) 2026 Atchyut

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

drives Claudetool callsremembers

What its code shows

Read from the source at commit 6d69bf8871bb 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.plugins/decision-lens/hooks/register.ts
ParsesEvery file parses as TypeScript or JavaScript.14 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.starts no programs
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).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.model.fork (sends its own transcript), adds command why
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: tool.call, command.run (why) · shapes: turn.step, prompt.compose · also: turn.start, turn.complete, ui.render (Pane), session.start · timers: clock.every
Reads, by nameThe environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.reads no files, environment variables, settings or transcript
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.writes no files, environment variables, settings or conversation rows

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 theonly1me/claude-code-mods
/plugin install decision-lens@claude-code-mods
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (6d69bf8871bb). 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/theonly1me/claude-code-mods
git -C claude-code-mods checkout 6d69bf8871bb088c3bdf5b5526b03dce633cdb88
claude plugin validate claude-code-mods/plugins/decision-lens
claude --plugin-dir claude-code-mods/plugins/decision-lens

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 "theonly1me-decision-lens" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

More from this repository

See all 11 mods in this repository

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/theonly1me-decision-lens.svg)](https://modscode.com/claude-mods/mods/theonly1me-decision-lens/)