Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / csr-lens

csr-lens

Painel ao lado da conversa com visão geral, agentes (quem chamou quem, recados e rodadas), turnos, diffs como no VS Code, árvore de arquivos ao vivo, contexto e custo e inventário de plugins, e uma linha de resumo acima do prompt. Só obser…

Code you can checkTerminal + desktopPaneBandToastBoxButtonSvgText
writes files, runs programs, draws

What it does

  • Draws a pane, a band above the prompt, toasts
  • Adds /lens, /inventario
  • Watches tool calls and can refuse them
  • Hooks agent.spawn, session.end, session.measure, session.send and 7 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • Has a desktop-specific branch
  • 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 csr-lens by Cesar Schutz (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/cesarschutz-csr-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: "Lens" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const texto = '…'
    const resumo = '…'
    const comTecla = '…'
    const texto2 = '…'
    const texto3 = '…'
    return (
      <Box flexDirection="column" paddingRight={0}>
        <Box flexDirection="column">
          <Box flexDirection="row" columnGap={2} marginBottom={1}>
            <Box flexShrink={0}>
              <Text>
                {` ${texto} `}
              </Text>
            </Box>
            <Box flexGrow={1} flexShrink={1} minWidth={0}>
              <Text dimColor wrap="truncate-end">
                {resumo}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
            <Box flexShrink={0}>
              <Text>
                {` ${texto} `}
              </Text>
            </Box>
            <Box flexShrink={0}>
              <Text>
                {` ${texto} `}
              </Text>
            </Box>
            <Box flexShrink={0}>
              <Text>
                {` ${texto} `}
              </Text>
            </Box>
            <Box flexShrink={0}>
              <Text>
                {` ${texto} `}
              </Text>
            </Box>
            <Button label="Fechar" role="dismiss" plain dimColor />
          </Box>
          <Text color="#f0883e">
            ────────
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1} marginTop={0}>
            <Box flexShrink={0} marginRight={1}>
              <Button label={`${comTecla}`} hotkey="v" />
            </Box>
            <Box flexDirection="row" columnGap={1} flexShrink={0}>
              <Text color="#f0883e">
                ›
              </Text>
              <Box flexShrink={0}>
                <Text bold color="#f0883e">
                  {texto}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" columnGap={1} flexShrink={0}>
              <Text color="#f0883e">
                ›
              </Text>
              <Box flexShrink={0}>
                <Text bold color="#f0883e">
                  {texto2}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" columnGap={1} flexShrink={0}>
              <Text color="#f0883e">
                ›
              </Text>
              <Box flexShrink={0}>
                <Text bold color="#f0883e">
                  {texto3}
                </Text>
              </Box>
            </Box>
          </Box>
        </Box>
      </Box>
    )
  })

  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text } = $.ui.resolve(e)
    const texto = '…'
    const rotulo = '…'
    const valor = '…'
    const complemento = '…'
    const extra = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
          <Box flexShrink={0}>
            <Text>
              {` ${texto} `}
            </Text>
          </Box>
          <Text>
            <Text backgroundColor="#30363d" color="#e6edf3">
              {` ${rotulo} `}
            </Text>
            <Text bold>
              {` ${valor}`}
            </Text>
            <Text>
              {" ━━━━━━━━"}
            </Text>
            <Text dimColor>
              ━━━━━━━━
            </Text>
            <Text>
              {` ${complemento}`}
            </Text>
            <Text>
              {` (${extra})`}
            </Text>
            <Text>
              {" "}
            </Text>
          </Text>
          <Text>
            <Text backgroundColor="#30363d" color="#e6edf3">
              {` ${rotulo} `}
            </Text>
            <Text bold>
              {` ${valor}`}
            </Text>
            <Text>
              {" ━━━━━━━━"}
            </Text>
            <Text dimColor>
              ━━━━━━━━
            </Text>
            <Text>
              {` ${complemento}`}
            </Text>
            <Text>
              {` (${extra})`}
            </Text>
            <Text>
              {" "}
            </Text>
          </Text>
          <Text>
            <Text backgroundColor="#30363d" color="#e6edf3">
              {` ${rotulo} `}
            </Text>
            <Text bold>
              {` ${valor}`}
            </Text>
            <Text>
              {" ━━━━━━━━"}
            </Text>
            <Text dimColor>
              ━━━━━━━━
            </Text>
            <Text>
              {` ${complemento}`}
            </Text>
            <Text>
              {` (${extra})`}
            </Text>
            <Text>
              {" "}
            </Text>
          </Text>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const tipo = '…'
    await $.ui.toast(`Pedi para ${tipo} parar.`)
    await $.ui.toast(`csr-lens: a sessão não devolveu o detalhamento do contexto`)
    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/csr-lens/hooks/register.tsx lines 2896–2967 · Pane
  on('ui.render', { component: 'Pane', requestId: PAINEL }, async ($, e) => {
    if (diagnostico !== undefined) {
      await anotar($, 'diagnóstico', () => registrar($, `desenho do painel (foco: ${e.props.isFocused ? 'sim' : 'não'})`))
    }

    const tabela = $.ui.resolve(e)
    const el: Elementos = {
      Box: tabela.Box,
      Text: tabela.Text,
      Button: tabela.Button,
      Input: 'Input' in tabela ? tabela.Input : null,
      Markdown: tabela.Markdown,
      Code: tabela.Code,
      // O terminal também tem um Svg na tabela (desenha só o alt): para as
      // telas, desenho em SVG é coisa do app; no terminal, nenhum.
      Svg: 'Svg' in tabela && e.surface !== 'terminal' ? tabela.Svg : null,
    }
    // A versão é o único valor que o painel lê: ele é redesenhado quando o
    // instantâneo muda (veja refrescarPainel e vigiarPainel), e não a cada
    // valor gravado.
    await read($, versao)
    // Desenhado, o painel está aberto (o vigia passa a acompanhá-lo).
    isPainelAberto = true

    // Um erro ao desenhar não deixa o painel em branco: ele aparece no painel
    // e vai para ~/.claude/csr-lens-erros.log, para ser corrigido.
    try {
      const partida = performance.now()
      // Sem instantâneo (o mod acabou de recarregar), lê direto desta vez.
      const visto = instantaneo ?? { dados: await lerDados($), agora: await $.clock.now() }
      const dados = visto.dados
      const quadro: Quadro = {
        largura: e.props.bodyColumns,
        linhas: e.props.scroll.bodyRows,
        agora: visto.agora,
        cotacao,
        raiz,
        // Sentado acima do prompt, e não ao lado: a versão compacta.
        isCompacto: e.props.placement === 'inline',
        isTerminal: e.surface === 'terminal',
        isFaixa: false,
        fechadas: dados.ui.secoesFechadas ?? [],
      }
      const arvore = desenhar(el, dados, quadro, acoes($))
      const gasto = Math.round(performance.now() - partida)

      // Um desenho lento passa do orçamento do hook e o painel fica sem
      // desenho: fica registrado, com a aba, para ser corrigido.
      if (gasto > DESENHO_LENTO_MS) {
        await anotar($, 'registro do desenho lento', () =>
          registrarErro($, `desenho lento: aba ${dados.ui.aba}, ${gasto} ms (${e.surface}, ${quadro.largura} colunas)`),
        )
      }

      return arvore
    } catch (erro) {
      const texto = erro instanceof Error ? `${erro.message}\n${erro.stack ?? ''}` : String(erro)
      await anotar($, 'registro do erro', () => registrarErro($, texto))
      const { Box, Text, Button } = el

      return (
        <Box flexDirection="column" rowGap={1}>
          <Text bold color={COR.vermelho}>O Lens falhou ao desenhar esta aba.</Text>
          <Text dimColor wrap="wrap">{texto.split('\n').slice(0, 8).join('\n')}</Text>
          <Text dimColor wrap="wrap">O erro foi gravado em ~/.claude/csr-lens-erros.log.</Text>
          <Box flexDirection="row">
            <Button key="erro-voltar" label="Ir para Agentes" onPress={() => acoes($).aba(1)} />
          </Box>
        </Box>
      )
    }
  })
plugins/csr-lens/hooks/telas.tsx lines 3307–3342 · Pane
export const desenhar = (
  el: Elementos,
  dados: Dados,
  quadro: Quadro,
  acoes: Acoes,
): RenderElement => {
  const { Box, Text } = el
  const resumo = dados.resumo
  // Os títulos de todas as seções na cor da aba aberta.
  const tomDaAba = ABAS.find(aba => aba.n === dados.ui.aba)?.tom
  const quadroDaAba: Quadro = tomDaAba === undefined ? quadro : { ...quadro, tomDaAba }

  // Uma coluna de margem à direita: a moldura dos cartões não encosta na borda do painel.
  return (
    <Box flexDirection="column" rowGap={respiro(quadro)} paddingRight={quadro.isCompacto ? 0 : 1}>
      <Box flexDirection="column">
        {!quadro.isCompacto && (
          <Box flexDirection="row" columnGap={2} marginBottom={1}>
            {seloDaMarca(el)}
            {/* Na Visão geral, os indicadores logo abaixo já dizem o mesmo. */}
            {!(dados.ui.aba === 0 && dados.ui.foco === undefined) && (
              <Box flexGrow={1} flexShrink={1} minWidth={0}>
                <Text dimColor wrap="truncate-end">{resumo}</Text>
              </Box>
            )}
          </Box>
        )}
        {abas(el, dados, quadroDaAba, acoes)}
        {/* No Desktop o ─ é mais largo que uma coluna e a régua quebrava em duas linhas. */}
        {!quadro.isCompacto && quadro.isTerminal && regua(el, limitar(quadro.largura - 1, 10, 200), corDaAba(dados.ui.aba))}
        {caminho(el, dados, quadroDaAba, acoes)}
      </Box>
      {corpo(el, dados, quadroDaAba, acoes)}
    </Box>
  )
}
plugins/csr-lens/hooks/telas.tsx lines 335–341 · Pane
export const seloDaMarca = (el: Pick<Elementos, 'Box' | 'Text'> & { Svg?: Elementos['Svg'] }, isCurto = false): RenderElement => {
  const { Box } = el

  // Num Box que não encolhe: o selo nunca quebra em duas linhas. No app, uma
  // pílula de pontas redondas, como as abas; no terminal, o texto com fundo.
  return <Box flexShrink={0}>{selo(el, isCurto ? '✦ CSR' : '✦ CSR Lens', 'marca')}</Box>
}
plugins/csr-lens/hooks/pecas.tsx lines 20–41 · Pane
export const selo = (
  el: Pick<Elementos, 'Text'> & ComSvg,
  texto: string,
  tom: Tom | NomeDoTom,
  isNegrito = true,
  altura?: number,
): RenderElement => {
  const { Text } = el
  const cor = typeof tom === 'string' ? TONS[tom] : tom

  if (el.Svg !== undefined && el.Svg !== null) {
    const desenho = pilulasSoltas([{ texto, fundo: cor.fundo, tinta: cor.tinta, isNegrito }], altura === undefined ? {} : { altura, corpo: 13.5 })

    return <el.Svg source={desenho.source} alt={texto} width={desenho.width} height={desenho.height} />
  }

  return (
    <Text backgroundColor={cor.fundo} color={cor.tinta} bold={isNegrito}>
      {` ${texto} `}
    </Text>
  )
}
plugins/csr-lens/hooks/telas.tsx lines 343–374 · Pane
const abas = (el: Elementos, dados: Dados, quadro: Quadro, acoes: Acoes): RenderElement => {
  const { Box, Button } = el
  const isInteiras = quadro.largura >= LARGURA_DAS_ABAS_INTEIRAS

  // No terminal, o botão sem moldura já escreve a tecla antes do rótulo ("2: ± Diffs").
  return (
    <Box flexDirection="row" flexWrap="wrap" columnGap={quadro.isTerminal ? 2 : 1}>
      {quadro.isCompacto && seloDaMarca(el, true)}
      {ABAS.map(aba =>
        aba.n === dados.ui.aba ? (
          <Box key={`guia-${aba.n}`} flexShrink={0}>
            {selo(el, `${aba.icone} ${aba.nome}`, aba.tom, true, quadro.isTerminal ? undefined : 26)}
          </Box>
        ) : (
          <Box key={`guia-${aba.n}`} flexShrink={0}>
            <Button
              key={`aba-${aba.n}`}
              label={isInteiras ? `${aba.icone} ${aba.nome}` : aba.icone}
              hotkey={teclaDaAba(aba.n)}
              {...comMoldura(quadro)}
              hover={{ color: TONS[aba.tom].fundo, bold: true }}
              onPress={() => acoes.aba(aba.n)}
            />
          </Box>
        ),
      )}
      {quadro.isFaixa && (
        <Button key="fechar" label="Fechar" role="dismiss" plain dimColor onPress={acoes.fechar} />
      )}
    </Box>
  )
}
plugins/csr-lens/hooks/pecas.tsx lines 318–322 · Pane
export const regua = (el: Pick<Elementos, 'Text'>, largura: number, cor: string): RenderElement => {
  const { Text } = el

  return <Text color={cor}>{'─'.repeat(Math.max(4, largura))}</Text>
}
Licence text (MIT)
MIT License

Copyright (c) 2026 Cesar Schutz

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 programswrites filesenv varsdrives Claudetool callsremembers

What its code shows

Read from the source at commit 8f9aceca2fe3 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/csr-lens/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.24 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, with its own branch for the desktop
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.plugins/csr-lens/hooks/register.tsx:518 a program named at run time; plugins/csr-lens/hooks/register.tsx:561 a program named at run time; plugins/csr-lens/hooks/register.tsx:1030 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, settings.json, the transcript and reaches the network, another session
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 lens, adds command inventario
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 (lens, inventario), tool.call · shapes: turn.step · reads: ui.press · also: session.start, session.end, ui.focus, ui.close (+6) · timers: clock.after, 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.env: HOME, CLAUDE_CONFIG_DIR, CLAUDE_CODE_PLUGIN_DIRS; files: a path computed at run time, …/.claude`}/projects, …/subagents/workflows, …/journal.jsonl, …/workflows/….json (+2); settings.json; the 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.files: …/.claude/csr-lens-erros.log, …/.claude/csr-lens-diagnostico.log; another session

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 cesarschutz/claude-code-kit
/plugin install csr-lens@cesarschutz
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (8f9aceca2fe3). 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/cesarschutz/claude-code-kit
git -C claude-code-kit checkout 8f9aceca2fe3c3071c9b0644c2a49a50c167e882
claude plugin validate claude-code-kit/plugins/csr-lens
claude --plugin-dir claude-code-kit/plugins/csr-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 "cesarschutz-csr-lens" 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/cesarschutz-csr-lens.svg)](https://modscode.com/claude-mods/mods/cesarschutz-csr-lens/)