ModsCode / Claude Code Mods / Ranking / weektoken
weektoken
Rate-limit pace for Claude Code's 5-hour and weekly windows: usage against elapsed time, plain-language forecast, per-model quotas and burn-up history. A band above the prompt and a full /weektoken pane, in English or Chinese.
What it does
- Draws a band above the prompt, a pane
- Adds /weektoken
- Hooks config.set, session.measure, session.start, turn.complete and 3 more
- Keeps its own state between turns
- Calls the network
Good points
- Written in TypeScript
- Has a desktop-specific branch
- 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)
import type { Register } from 'claude-code'
// Drawn like weektoken by mj0111 (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/3dnow-weektoken/
// 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 } = $.ui.resolve(e)
return (
<Box flexDirection="column">
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "WeekToken" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Button, Text, Svg } = $.ui.resolve(e)
const full = '…'
const L = '…'
const burnRate = '…'
const displayLabel = '…'
const displayHeadline = '…'
const second = '…'
const trendText = '…'
const map = '…'
const windowNote = '…'
const __full = '…'
const nl = '…'
const source = '…'
const alt = '…'
return (
<Box flexDirection="column" gap={1} paddingX={1}>
<Box flexDirection="row" alignItems="center">
<Box flexShrink={0}>
<Button label="❮" plain />
</Box>
<Box flexShrink={0} justifyContent="center">
<Text bold wrap="truncate-end">
{full}
</Text>
</Box>
<Box flexShrink={0}>
<Button label="❮" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button label={`${L}`} variant="primary" />
<Button label={`${L}`} variant="primary" />
</Box>
<Box flexDirection="column" gap={1}>
<Box flexDirection="row" gap={1}>
<Text bold>
{`${burnRate}×`}
</Text>
<Text dimColor>
{displayLabel}
</Text>
</Box>
<Text bold>
{displayHeadline}
</Text>
<Text dimColor wrap="wrap">
{second}
</Text>
<Text dimColor>
{trendText}
</Text>
<Text>
{map}
</Text>
<Text dimColor>
?
{windowNote}
</Text>
<Box flexDirection="row" gap={2}>
<Button label={`${__full}`} hotkey="h" />
<Button label={`${full} ›`} hotkey="l" />
</Box>
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Text dimColor wrap="truncate-end">
{nl}
</Text>
<Box flexGrow={1} />
<Button label={`${L}`} />
<Button label={`${L}`} />
</Box>
<Box flexGrow={1} />
<Box flexDirection="row" justifyContent="flex-end">
<Svg source={`${source}`} alt={`${alt}`} />
</Box>
</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.
weektoken/hooks/register.tsx lines 1109–1119 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (disabled || e.props.hasSurvey) return next(e)
if (((await read($, bandA)) ?? 'open') === 'hidden') return next(e)
await useLang($)
const show = (await read($, confirmHideA)) ? 'confirm' : await read($, bandShowA)
if (!show) return next(e)
const ours = show === 'confirm' ? drawConfirmHide($, e) : drawBand($, e, show, !!(await read($, paneOpenA)))
const below = await next(e)
const { Box } = $.ui.resolve(e)
return <Box flexDirection="column">{ours}{isBlank(below) ? null : below}</Box>
})weektoken/hooks/register.tsx lines 1121–1132 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const samples = (await read($, samplesA)) ?? []
const view = (await read($, viewA)) ?? DEFAULT_VIEW
const note = await read($, noteA)
const band = (await read($, bandA)) ?? 'open'
await useLang($)
const now = await $.clock.now()
const activity = (await read($, activityA)) ?? { byModel: {} }
const bandKey = (await read($, bandKeyA)) ?? null
paneVersion = (await read($, versionA)) ?? ''
return drawPane($, e, samples, activity, view, note, band, buildModel(samples, view, now, bandKey), now)
})weektoken/hooks/register.tsx lines 909–983 · Pane
function drawPane($: any, e: any, samples: readonly Sample[], activity: Activity, view: PaneView, note: Note, band: BandMode, m: Model, now: number) {
const { Box, Text, Button } = $.ui.resolve(e)
// At least as tall as the pane body (row count from the host; Box sizes are in rows on every surface); the spacer before the credit pushes it to the bottom
const fill = e.props?.scroll?.bodyRows ? Math.max(1, e.props.scroll.bodyRows) : '100%'
paneActions.clear()
paneSurface = e.surface
paneFocusedAtRender = !!e.props?.isFocused
const term = e.surface === 'terminal'
const sel = m.selected
const row = sel ? m.rows[sel] : undefined
const nl = noteLine(row, samples, activity, now)
const busy = isBusy(note, now)
const footer = (
<Box flexDirection="row" alignItems="center" gap={1}>
{nl ? <Text dimColor wrap="truncate-end">{nl}</Text> : null}
<Box flexGrow={1} />
<Button key="band-toggle" label={band === 'hidden' ? L('⊕ 显示横条', '⊕ Show band') : L('⊖ 隐藏横条', '⊖ Hide band')} onPress={paneAct('band-toggle', () => toggleBandHidden($))} />
<Button key="refresh" label={busy ? L('↻ 刷新中…', '↻ Refreshing…') : L('↻ 刷新', '↻ Refresh')} {...(term ? { hotkey: 'r' } : {})} onPress={paneAct('refresh', () => refreshAll($, true))} />
</Box>
)
if (!row) {
return (
<Box flexDirection="column" gap={term ? 1 : 2} paddingX={1} minHeight={fill}>
{drawEmpty($, e)}
{footer}
<Box flexGrow={1} />
{credit($, e)}
</Box>
)
}
// Desktop: quota-switch arrows flank the title, as on the band; the name cell is sized to the longest quota name so arrows don't move on switch.
// (Arrows used to sit at both ends of the ring row; once readings moved into the image it grew 50% wider and squeezed the arrows against the ring)
// The terminal pace tab has its own named buttons (h / l), so no title arrows
const headArrows = !term && m.keys.length > 1
const headArrow = (offset: -1 | 1) => {
const name = offset < 0 ? 'prev' : 'next'
return (
<Box key={`sw-${name}`} flexShrink={0}>
<Button
key={name}
label={offset < 0 ? '❮' : '❯'}
plain
hover={{ color: identityText(P.neighbor(row.key, m.keys, offset) as string), bold: true }}
onPress={paneAct(name, () => stepKey($, m.keys, row.key, offset))}
/>
</Box>
)
}
const title = <Text color={identityText(row.key)} bold wrap="truncate-end">{row.full}</Text>
const header = headArrows ? (
<Box flexDirection="row" alignItems="center">
{headArrow(-1)}
<Box flexShrink={0} width={Math.max(...m.keys.map(k => cells(m.rows[k].full)))} justifyContent="center">{title}</Box>
{headArrow(1)}
</Box>
) : (
<Box flexDirection="row" alignItems="center" gap={1}>{title}</Box>
)
const tabs = (
<Box flexDirection="row" gap={1}>
<Button key="tab-pace" label={L('配速', 'Pace')} {...(term ? { hotkey: '1' } : {})} variant={view.tab === 'pace' ? 'primary' : 'secondary'} onPress={paneAct('tab-pace', () => setView($, v => ({ ...v, tab: 'pace', explore: false })))} />
<Button key="tab-burnup" label={L('用量轨迹', 'Burn-up')} {...(term ? { hotkey: '2' } : {})} variant={view.tab === 'burnup' ? 'primary' : 'secondary'} onPress={paneAct('tab-burnup', () => setView($, v => ({ ...v, tab: 'burnup', explore: false })))} />
</Box>
)
return (
<Box flexDirection="column" gap={term ? 1 : 2} paddingX={1} minHeight={fill}>
{header}
{tabs}
{view.tab === 'burnup' ? drawBurnUpTab($, e, samples, m, row, view, now) : drawPaceTab($, e, samples, m, row)}
{footer}
<Box flexGrow={1} />
{credit($, e)}
</Box>
)
}weektoken/hooks/register.tsx lines 719–727 · Pane
function drawEmpty($: any, e: any) {
const { Box, Text } = $.ui.resolve(e)
return (
<Box flexDirection="column" alignItems="center" paddingY={1}>
<Text bold>{L('还没有数据', 'No data yet')}</Text>
<Text dimColor wrap="wrap">{L('等这个会话收到第一条回复,或点「刷新」', "Waiting for this session's first reply, or press Refresh")}</Text>
</Box>
)
}weektoken/hooks/register.tsx lines 899–907 · Pane
function credit($: any, e: any) {
const { Box, Text } = $.ui.resolve(e)
const handle = `@${AUTHOR.x}${paneVersion ? ` · v${paneVersion}` : ''}`
return (
<Box flexDirection="row" justifyContent="flex-end">
{e.surface === 'terminal' ? <Text dimColor>{handle}</Text> : pic($, e, creditSvg(handle), handle)}
</Box>
)
}weektoken/hooks/register.tsx lines 517–528 · Pane
function pic($: any, e: any, source: string, alt: string, opts: { isInteractive?: boolean; fluid?: boolean; fillHeight?: number } = {}) {
const { Svg } = $.ui.resolve(e)
if (opts.fluid) return <Svg source={source} alt={alt} />
// Plain image with height only: the SVG declares no width (width="100%") and uses percentage geometry, so width follows the cell up to the image default 300px,
// stretching without distortion. No interactive frame: the host reloads it, flickering, whenever the same plugin redraws elsewhere (the pane) (confirmed on device)
if (opts.fillHeight) return <Svg source={source} alt={alt} height={opts.fillHeight} />
const m = /^<svg[^>]*?\swidth="([\d.]+)"\s+height="([\d.]+)"/.exec(source)
const size = m ? { width: Number(m[1]), height: Number(m[2]) } : {}
return opts.isInteractive
? <Svg source={source} alt={alt} {...size} isInteractive />
: <Svg source={source} alt={alt} {...size} />
}Licence text (MIT)
MIT License Copyright (c) 2026 mj0111 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), Add a slash command
What its code calls
networkruns programsreads filesenv varsremembers
What its code shows
Read from the source at commit 9f0bf8e119a1 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 read | Every module hooks/hooks.json names was read.weektoken/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.6 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No 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 open | Network 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 draws | The 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 line | Whether 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 Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).weektoken/hooks/register.tsx:256 tail (not on Windows); weektoken/hooks/register.tsx:384 defaults (not on Windows) |
| Network | Whether every fetch names its https host in the code.https://api.anthropic.com (with the session's own Anthropic credential) |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.weektoken/hooks/register.tsx:242 perl (a shell or interpreter) |
| Reads and sends | Whether 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 and reaches the network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An 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 hooks | Hooks 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 ships | MCP 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, agents | What 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 MCP | Whether 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 model | Completions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command ? |
| Events it hooks | By 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 (weektoken), config.set · reads: ui.press · also: session.start, turn.complete, session.measure, ui.focus (+2) · timers: clock.after, clock.every |
| Reads, by name | The environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: CLAUDE_MODS_DISABLE, HOME, WEEKTOKEN_HISTORY, PATH, WEEKTOKEN_LANG (+3); files: a path computed at run time, its own folder/.claude-plugin/plugin.js… |
| Writes, by name | The 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 3dnow/claude-mods/plugin install weektoken@mj0111-mods/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (9f0bf8e119a1). 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/3dnow/claude-modsgit -C claude-mods checkout 9f0bf8e119a1444fc267b9553da88c6b444f3683claude plugin validate claude-mods/weektokenclaude --plugin-dir claude-mods/weektokenThe 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 "3dnow-weektoken" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- explain-asSumit Paul★ 20
- uploadsBuild Internet★ 18
- ccprogressamigoer★ 14
- flow-scenesRob Macrae★ 11
- laurelsKOZMOS★ 9
- spending-effort-with-jevYaxin Luo★ 6
Badge for your README
If this is your mod, paste this into your README. It links to this page.
[](https://modscode.com/claude-mods/mods/3dnow-weektoken/)