ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 5omeOtherGuy

slab-deck

面向 Claude Code 的 SLAB 风格控制中心:带上下文和速率限制仪表的真彩色状态栏、提示符上方实时状态带、包含 overview/context/tools/agents/git/tmux/usage 的 `/deck` 面板、弹窗和 tmux 导航。

5omeOtherGuy@5omeOtherGuy

5omeOtherGuy/slab-deck/tree/main/mod/slab-deck

原帖图片1
已翻译

关于这个 mod

slab-deck 是采用 SLAB 设计语言(深色表面,只在字形和结果标记上使用色相,不绘制方框)的 Claude Code 控制中心。它包含两部分:statusline-slab.sh 占用 Claude Code 的状态栏槽位,用真彩色仪表显示模型、仓库/分支、effort、上下文、5h 和 7d 速率限制(70% 起琥珀色、90% 起红色、重置倒计时)、提示缓存命中率、每轮输出迷你折线图、会话时钟和行数;mod/slab-deck 是基于 function-hooks 插件 API(Claude Code 2.1.289 以上)的模组,在提示符上方加入实时状态带(带经过时间、步骤、token、tok/s 和运行中工具的动画 ▪▪▪ working 指示器;空闲时提供 tmux 窗口链接和操作),并通过 /deck [section] 打开包含 overview、context、tools、agents、git、tmux 和 usage 的停靠面板,还为工具调用、回合、tmux 面板和按键列表提供弹窗。动画会在原位置重绘单元格,可使用 P1_REDUCED_MOTION=1 或 SLAB_REDUCED_MOTION=1 冻结。/deck-band full|compact|off 切换状态带;上下文或速率限制超过 80% 时会显示 toast。克隆仓库并运行 claude --plugin-dir slab-deck/mod/slab-deck 安装,或在 ~/.claude/settings.json 中设置 CLAUDE_CODE_PLUGIN_DIRS 和 statusLine。状态栏需要 jq 和 git;在 tmux 中或 git 仓库内会自动启用 tmux 和 git 功能。采用 MIT 许可证。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add 5omeOtherGuy/slab-deck
claude plugin install slab-deck
原文 / README

slab-deck

A control center for Claude Code in the SLAB design language: dark surfaces, hue only on glyphs and outcome markers (› ▸ ✓ ✗ ! · ↳ ▪), no box drawing. Two parts that work together:

  • statusline-slab.sh fills Claude Code's own status line slot with gauges in true colour.
  • mod/slab-deck is a mod on the function-hooks plugin API (Claude Code 2.1.289+): a live band above the prompt, a docked deck pane, popups and tmux navigation.

slab-deck while a turn runs

What it shows

Statusline (Claude Code's status line slot): model, repo and branch, effort | context, 5h and 7d rate-limit gauges (amber from 70 %, red from 90 %, reset countdown once a window passes 70 %), prompt-cache hit rate, output-per-turn sparkline (handed over by the mod), session clock, lines +N −N. Facts drop by priority when the terminal narrows; a window at 70 % or more outlasts the repo name.

Band above the prompt: while a turn runs, the animated ▪▪▪ working indicator with elapsed time, step, tokens, tok/s and the tools running; when idle, your tmux windows as links (1–9) and actions (d deck, n window, s split, h keys).

Deck pane — /deck [section]

| section | contents | | --- | --- | | overview | session facts, context, rate limits and resets, output per turn, recent tool calls | | context | the /context grid, categories, autocompact mark, memory files | | tools | calls by tool, 30-minute timeline, recent calls | | agents | subagents and their status | | git | changed files with diff bars, commits, history graph in a new tmux window | | tmux | all panes of the session: live peek, window minimap, go there, new window, split, zoom | | usage | rate limits, token totals, cache hit, turn durations |

Popups for a tool call, a turn, a tmux pane and the key list (esc closes).

Animations: the ▪▪▪ indicator breathes while a turn runs; the deck's context and rate-limit gauges sweep up when it opens and glide to each new value. Both repaint cells in place ($.ui.blit), no redraw. P1_REDUCED_MOTION=1 or SLAB_REDUCED_MOTION=1 freezes them.

Also /deck-band full|compact|off and toasts when context or a rate limit crosses 80 %. The tmux actions only select, open or split; nothing closes, kills or types into another pane.

slab-deck idle

Install

git clone https://github.com/5omeOtherGuy/slab-deck
claude --plugin-dir slab-deck/mod/slab-deck

For every session, in ~/.claude/settings.json:

"env": { "CLAUDE_CODE_PLUGIN_DIRS": "/path/to/slab-deck/mod/slab-deck" },
"statusLine": { "type": "command", "command": "/path/to/slab-deck/statusline-slab.sh", "padding": 0, "refreshInterval": 2 }

The statusline needs jq and git, and works without the mod (no sparkline then). refreshInterval re-fits it after a resize and keeps its clock and countdowns current; one run takes about 60 ms.

tmux and git features turn on by themselves when Claude Code runs inside tmux or a git repository. P1_REDUCED_MOTION=1 or SLAB_REDUCED_MOTION=1 freezes the working indicator.

Develop

claude plugin validate mod/slab-deck
claude plugin test mod/slab-deck

| file | role | | --- | --- | | hooks/register.tsx | events, timers, commands, every $ call (the engine follows $ only within one file) | | hooks/views.tsx | band, deck sections and popups | | hooks/ink.ts | design tokens and the Raster painters (gauges, charts, minimap, working indicator) | | hooks/data.ts | git and tmux output parsers | | types/index.d.ts | the $.state contract |

License

MIT

更多类似作品