Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / lemo-meter

lemo-meter

用量横条:输入框上方显示上下文、5 小时额度、花费和 git 分支;状态栏显示消息编号(已有自己的状态栏时默认关闭);点「检查」才联网查新版本 / Usage meter: context, 5-hour quota, cost and git branch above the prompt; a status line with the message number (off by default if you have your own); checks for upd…

Code you can checkTerminal + desktopPaneBandStatus lineBoxSvg
network, draws

What it does

  • Draws a band above the prompt
  • Hooks lemo.caps, lemo.off, lemo.toggle, session.start and 1 more
  • Keeps its own state between turns
  • Calls the network

Good points

  • Starts no processes
  • 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 lemo-meter by lemomo (pane, band, status), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/lemomo-ai-lemo-meter/
// 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 band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Svg } = $.ui.resolve(e)
    const bandSvg = '…'
    const alt = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="column" width="100%">
          <Svg source={`${bandSvg}`} alt={`${alt}`} height={106} />
        </Box>
        {await next(e)}
      </Box>
    )
  })
}

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/lemo-meter/hooks/register.tsx lines 482–496 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    // 问卷占着横条时让给它;安全页上关了横条就原样交给里层
    if (e.props.hasSurvey || !(await read($, bandOn))) return next(e)
    const below = await next(e)
    const band = await drawBand($, e)
    if (below.type === 'engine') return band
    // 引擎原样不许放进带 width 的 Box(会拒绝整棵树),所以外面这层不给 width
    const { Box } = $.ui.resolve(e)
    return (
      <Box flexDirection="column" gap={1}>
        {band}
        {below}
      </Box>
    )
  })
plugins/lemo-meter/hooks/register.tsx lines 273–398 · Band
async function drawBand($: EngineInterface, e: RenderInput<'AbovePrompt'>): Promise<RenderElement> {
  const lk = await look($)
  const S = STR[lk.lang]
  const u = await read($, usage)
  const n = await seqOf($)
  const br = await read($, branch)
  const now = await $.clock.now()
  const list = liveBadges((await $.state.get(BadgesRef)).value, now)
  const shown = (await $.state.get(NoticeRef)).value ?? null
  // 读了 frame 就每秒重画一次。有倒计时的胶囊时要读,剩余时间跟着走;
  // 终端有像素小画时也读,小画一直冒泡。
  // 桌面没有倒计时就不读,免得 SVG 跟着一直重画、闪(平时让 SVG 自己的气泡动画跑)
  const ticking = list.some(b => typeof b.endsAt === 'number' && b.endsAt > now)
  const animate = e.surface === 'terminal' && lk.st.sprite !== null && lk.st.sprite.frames.length > 1
  const tick = ticking || animate ? ((await $.state.get(FrameRef)).value ?? 0) : 0
  const pills: Pill[] = list.map(b => ({ text: badgeLabel(b, now, lk.lang), tone: b.tone }))
  const brandName = word(lk, 'lemo-core.title', 'lemo-mod')

  if (e.surface === 'desktop') {
    const { Box, Svg } = $.ui.resolve(e)
    const data = {
      ctx: u.ctx,
      quota: u.quota,
      usd: u.usd,
      label: fill(word(lk, 'lemo-meter.trial', S.trial), { no: exp(n) }),
      pills: br === null ? pills : [...pills, { text: `⎇ ${br}`, tone: 'grey' as const }],
      notice: shown === null ? null : { text: shown.text, tone: shown.tone },
      brand: brandName,
      brandSub: word(lk, 'lemo-meter.brandSub', S.brandSub),
      words: { ctx: S.band.ctx, quota: S.band.quota, cost: S.band.cost, pending: word(lk, 'lemo-meter.pending', S.band.pending) },
    }
    const alt = `${brandName}: ${S.band.ctx} ${pct(u.ctx)}, ${S.band.quota} ${pct(u.quota)}`
    const guess = Math.round(e.props.bodyColumns * CELL_PX)
    // 不给 width,外面包一层竖排 Box,竖排容器会把它横向拉满(桌面上单独放只有 280 像素)。
    // 不加 isInteractive:那样 SVG 装在一个沙盒框里,每重画一次整个框重新加载、闪一下;画成图片,内容没变就不闪
    return (
      <Box flexDirection="column" width="100%">
        <Svg source={bandSvg(data, { width: '100%', guess }, lk.c, lk.st.motif, lk.st.sprite)} alt={alt} height={BAND_H} />
      </Box>
    )
  }

  // 终端(以及别的界面):两行刻度尺 + 一行底行;提示出现时顶替底行
  const { Box, Text } = $.ui.resolve(e)
  const ink = bareInk(lk, e.surface)
  const ctxLabel = word(lk, 'lemo-meter.tbandCtx', S.tband.ctx)
  const quotaLabel = word(lk, 'lemo-meter.tbandQuota', S.tband.quota)
  const cols = Math.max(width(ctxLabel), width(quotaLabel))
  const scale = (key: string, label: string, v: number | null) => {
    const r = ruler(v)
    return (
      <Box key={key} flexDirection="row">
        <Text color={lk.c.pencil}>{padTo(label, cols) + ' '}</Text>
        <Text color={lk.c.grid}>{r.before}</Text>
        <Text color={lk.c.ink}>●</Text>
        <Text color={lk.c.grid}>{r.after}</Text>
        <Text {...ink}>{' ' + (v === null ? word(lk, 'lemo-meter.pending', S.band.pending) : pct(v))}</Text>
      </Box>
    )
  }
  const sample = word(lk, 'lemo-meter.tbandSample', S.tband.sample)
  // 底行放不下时截掉,不折行:折出来的行会把刻度尺往上挤,分支名也会断成「⎇」和「main」两行
  let foot: RenderChildren
  if (shown !== null) {
    foot = <Text {...termTone(lk, shown.tone)} bold wrap="truncate">{` ● ${shown.text} `}</Text>
  } else {
    foot = (
      <Text color={lk.c.pencil} wrap="truncate">
        {`${sample} ${exp(n)}${u.usd === null ? '' : ` · ${money(u.usd)}`}`}
        {pills.map((p, i) => (
          <Text key={`badge-${i}`} color={lk.c.pencil}>
            {' · '}
            <Text {...termTone(lk, p.tone)}>{p.tone === 'accent' ? ` ${p.text} ` : p.text}</Text>
          </Text>
        ))}
        {br === null ? '' : ` · ⎇ ${br}`}
      </Text>
    )
  }
  // 地方不够时一级一级往下减:先不画小画,刻度尺也放不下(面板停在旁边、对话区很窄,或者面板在输入框上方、
  // 只给一两行)时改成一行文字。不然刻度尺会被挤成竖排,引擎再把多出来的行收成「↓ 3 more」。
  // 引擎在横条第一行的右端画收起按钮「[-]」(3 格):第一行右边留出 FOLD 格,数值不被它盖住
  const room = e.props.bodyColumns
  const rows = e.props.maxRows
  const pending = word(lk, 'lemo-meter.pending', S.band.pending)
  const rowW = cols + 1 + width(ruler(0).before) + 1 + width(ruler(0).after) + 1 + Math.max(width(pending), 4)
  if (room < rowW + FOLD || rows < 3) {
    const val = (v: number | null) => (v === null ? pending : pct(v))
    const brief = (
      <Box key="meter-brief" paddingRight={FOLD}>
        <Text {...ink} wrap="truncate">{`${ctxLabel} ${val(u.ctx)} · ${quotaLabel} ${val(u.quota)}`}</Text>
      </Box>
    )
    // 只给一行时:有提示就只写提示,没有就只写用量
    if (rows < 2) return shown !== null ? <Box paddingRight={FOLD}>{foot}</Box> : brief
    return (
      <Box flexDirection="column">
        {brief}
        {foot}
      </Box>
    )
  }
  const meter = (
    <Box flexDirection="column">
      {scale('meter-ctx', ctxLabel, u.ctx)}
      {scale('meter-quota', quotaLabel, u.quota)}
      {foot}
    </Box>
  )
  const sprite = lk.st.sprite
  if (e.surface === 'terminal' && sprite !== null && sprite.frames.length > 0) {
    // 风格的像素小画:每秒换一帧。放不下(宽度或行数不够)就不画
    const frame = sprite.frames[tick % sprite.frames.length] ?? sprite.frames[0] ?? []
    const cells = spriteCells(sprite.palette, frame)
    if (room >= cells.columns + 2 + rowW + FOLD && rows >= cells.rows) {
      const { Raster } = $.ui.resolve(e)
      return (
        <Box flexDirection="row" gap={2} alignItems="center">
          <Raster key="meter-sprite" {...cells} />
          {meter}
        </Box>
      )
    }
  }
  return meter
}
Licence text (MIT)
MIT License

Copyright (c) 2026 lemomo

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.

This code is an example in the code reference: Band above the prompt, Keep state with $.store

How to build this: Pane (panel), Keep state with $.store

What its code calls

networkreads filesremembers

What its code shows

Read from the source at commit 59f002927f18 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/lemo-meter/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.4 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.https://registry.npmjs.org
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).reads files and reaches the network
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.asks nothing of the model
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.also: session.start, turn.complete, ui.render (AbovePrompt, Pane), lemo.caps (+2) · timers: clock.every, 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.files: …/.git, …/HEAD
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 lemomo-ai/lemo-mod
/plugin install lemo-meter@lemo-mod
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (59f002927f18). 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/lemomo-ai/lemo-mod
git -C lemo-mod checkout 59f002927f1834ce48ebb1c4a66f85686daf8157
claude plugin validate lemo-mod/plugins/lemo-meter
claude --plugin-dir lemo-mod/plugins/lemo-meter

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 "lemomo-ai-lemo-meter" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

More from this repository

See all 15 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/lemomo-ai-lemo-meter.svg)](https://modscode.com/claude-mods/mods/lemomo-ai-lemo-meter/)