ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 leepokai

cutroom

Cutroom:Claude Code 中供 HyperFrames 專案使用的剪輯室窗格,支援畫面預覽、時間軸、裁切/分割/移動/刪除/復原、Studio 選取橋接,以及傳給 Claude 的指向式提問編輯。

已翻譯

關於這個 mod

claude-mod-cutroom

Cutroom 是位於 Claude Code 內的 HyperFrames 影片剪輯室。一個命令會在瀏覽器中開啟 HyperFrames Studio(真正的預覽與時間軸),把即時畫面縮圖和剪輯按鈕放進 Claude Code 窗格,並讓 Claude 知道你在 Studio 中選取了什麼,所以 "make this bigger" 不必再指出位置。

它刻意不做另一套 NLE。Studio 才是畫布。窗格執行的每次剪輯都是一次 HyperFrames CLI 呼叫(timeline、snapshot、check、render),而按鈕無法表達的內容則會送給 Claude,成為已經帶有專案、Studio 選取、播放頭、畫面快照與時間軸的提示。

my-launch · 45s · Studio ●  [open Studio ↗]  localhost:3061/#project/my-launch
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄   ← the frame under the
█████████████████▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀████     playhead, as half-block
████████████████  Message your coding agents  ████████████████     cells in any terminal,
████████████████  like teammates.             ████████████████     real pixels on kitty /
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀     Ghostty and the desktop app
▶  |◀  -1s  -.1  12.5s  +.1  +1s  ▶|  ⟳   t=____ seek
Studio: 03 Demo · compositions/frames/03-demo.html
[ Trim in→┃ ] [ ┃←Trim out ] [ Split @┃ ] [ Move→┃ ] [ Duplicate ] [ Delete ] [ Undo (0) ]
[ Check ] [ Render draft ] [ Reload ]  prompt context: on
Ask Claude › change what? (or just type in the main prompt)
graphics
▸ el-03-demo     ····████┃·······················  9–16
  el-04-feature  ········█████····················  15.5–22.1

安裝

claude plugin marketplace add leepokai/claude-mod-cutroom
claude plugin install cutroom@claude-mod-cutroom

不安裝也能只在一個工作階段使用:claude --plugin-dir /path/to/claude-mod-cutroom。把這個資料夾的符號連結放到 ~/.claude/skills/cutroom 下,也會在每個工作階段自動載入。

需求:Node 22、PATH 上可用的 ffmpeg 與 curl,以及 HyperFrames Claude Code 外掛(claude plugin install hyperframes@hyperframes,Cutroom 使用其中快取的 CLI 啟動器),或可存取網路以執行 npx hyperframes。畫面預覽會在支援 kitty 圖形協定的終端機(kitty、Ghostty)和 Claude 桌面應用程式中繪製真實像素,在其他終端機則使用半格字元。

使用方式

  1. 在 HyperFrames 專案(或其父目錄,例如包含 videos/* 的儲存庫)中執行 cd,然後輸入 /cut。Studio 會在背景啟動並在瀏覽器中開啟;窗格會顯示在 transcript 旁邊(全螢幕版面從 110 欄起停駐,否則位於提示列上方)。如果目前目錄有 hyperframes.json,窗格會在工作階段開始時自行開啟(不會啟動瀏覽器)。/cut <dir> 會開啟特定專案;有多個候選專案時,窗格會將它們列成按鈕。
  2. **查看。**窗格顯示播放頭下的畫面:Studio 的縮圖 API 約用半秒呈現它。▶(p)會以幻燈片方式播放,每 0.5 s 的時間軸顯示一幀,速度取決於畫面到達的速度。|◀ -1s -.1 +.1 +1s ▶| 用來拖曳(窗格取得焦點時可使用快速鍵 a j h l k f:按 ctrl+x tab,或點擊它);t= 跳到指定時間;⟳(r)重新擷取。
  3. **指向。**在 Studio 的畫布或時間軸上點擊任何內容。窗格每 1.5 s 輪詢一次 Studio 的選取,顯示選取內容,將它對應到承載它的片段,並把播放頭移到 Studio 的時間。窗格中的列(或 1–9)可以不使用 Studio 選取頂層片段。
  4. 使用 CLI 自己的編輯進行剪輯(每次都是一次可用 Undo 復原的 hyperframes timeline … 呼叫):Trim in→┃(i)讓片段從播放頭開始;┃←Trim out(o)讓它在該處結束;Split @┃(s)建立 <id>-2;Move→┃(m)保持長度;Duplicate(d)建立 <id>-copy;Delete(x);Undo(u)還原窗格上一次編輯(收據位於 <project>/.hyperframes/cutroom/)。Studio 會為在那裡進行的拖曳保留自己的復原記錄。
  5. **說出來。**只要在 Claude Code 的提示列輸入:專案開啟且 prompt context 已開啟時(t 切換它),你輸入的每則提示都會帶上 Studio 選取、承載片段、播放頭、快照路徑與精簡時間軸,因此 "把這個標題放大" 或 "cut this scene 1s shorter" 就夠了。Ask Claude › 方塊在窗格內也會做同樣的事。回合結束時窗格會重新載入時間軸和畫面;Studio 也會自行重新載入。
  6. Check(c)執行 hyperframes check --json;Render draft(v)寫入 renders/draft.mp4;Reload(z)重新讀取時間軸。

試用

  1. 如果還沒有專案,先建立一個:npx hyperframes init demo。
  2. 在 Claude Code 中輸入 /cut demo。Studio 會在瀏覽器中開啟;窗格顯示第一幀。按下 ▶,再點擊 Studio 時間軸中的片段,看窗格跟隨它。
  3. 在提示列輸入:"make the title 20% larger"。Claude 會編輯合成內容,Studio 和窗格會重新載入。

版面

Claude Code 外掛由三個檔案和一個型別契約組成(參閱 Claude Code 中的 plugin-authoring 技能)。這個儲存庫就是這樣的外掛,同時也充當自己的外掛市集。

.claude-plugin/plugin.json        manifest
.claude-plugin/marketplace.json   lets `claude plugin marketplace add` point here
hooks/hooks.json                  names the hooks module
hooks/register.tsx                the whole mod: CLI runner, state atoms, edit
                                  verbs, Studio bridge, prompt composer, Pane render
types/index.d.ts                  the $.state contract the pane draws from
tests/editor.test.tsx             claude plugin test .
  • claude plugin validate . 會列出引擎將看到的每個 hook 與 $ 呼叫。
  • claude plugin test . 會使用真正的引擎執行測試;外掛下的世界(fs、process、http、store、env、clock)由測試提供回應:片段列表、隱藏巢狀列、選取、跳轉、讓 Split 以精確 argv 抵達 CLI、在任何操作執行前拒絕片段外的分割;在模擬 Studio 時,也會驗證選取輪詢落入窗格,並在下一則輸入提示中作為內容傳遞。
  • 從你擁有的資料夾載入後,引擎會將 API 宣告放在 .claude-plugin/types/ 下,而 tsc -p . 會對外掛進行型別檢查。

授權條款

MIT,參閱 LICENSE。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add leepokai/claude-mod-cutroom
claude plugin install cutroom
原文 / README

claude-mod-cutroom

Cutroom is a cutting room for HyperFrames videos that lives inside Claude Code. One command opens HyperFrames Studio in your browser (the real preview and timeline), puts a live frame thumbnail and the cut buttons in a Claude Code pane, and makes Claude aware of what you have selected in Studio, so "make this bigger" needs no further pointing.

It is deliberately not another NLE. Studio is the canvas. Every cut the pane makes is one HyperFrames CLI call (timeline, snapshot, check, render), and everything a button cannot say goes to Claude as a prompt that already carries the project, the Studio selection, the playhead, the frame snapshot and the timeline.

my-launch · 45s · Studio ●  [open Studio ↗]  localhost:3061/#project/my-launch
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄   ← the frame under the
█████████████████▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀████     playhead, as half-block
████████████████  Message your coding agents  ████████████████     cells in any terminal,
████████████████  like teammates.             ████████████████     real pixels on kitty /
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀     Ghostty and the desktop app
▶  |◀  -1s  -.1  12.5s  +.1  +1s  ▶|  ⟳   t=____ seek
Studio: 03 Demo · compositions/frames/03-demo.html
[ Trim in→┃ ] [ ┃←Trim out ] [ Split @┃ ] [ Move→┃ ] [ Duplicate ] [ Delete ] [ Undo (0) ]
[ Check ] [ Render draft ] [ Reload ]  prompt context: on
Ask Claude › change what? (or just type in the main prompt)
graphics
▸ el-03-demo     ····████┃·······················  9–16
  el-04-feature  ········█████····················  15.5–22.1

Install

claude plugin marketplace add leepokai/claude-mod-cutroom
claude plugin install cutroom@claude-mod-cutroom

For one session without installing: claude --plugin-dir /path/to/claude-mod-cutroom. A symlink to this folder under ~/.claude/skills/cutroom also auto-loads it in every session.

Requirements: Node 22, ffmpeg and curl on PATH, and either the hyperframes Claude Code plugin (claude plugin install hyperframes@hyperframes, whose cached CLI launcher Cutroom uses) or network access for npx hyperframes. The frame preview draws real pixels in terminals that speak the kitty graphics protocol (kitty, Ghostty) and in the Claude desktop app, and half-block cells in every other terminal.

Use

  1. cd into a HyperFrames project (or its parent, e.g. a repo with videos/*) and type /cut. Studio starts in the background and opens in your browser; the pane opens beside the transcript (docked in the fullscreen layout from 110 columns, else above the prompt). With hyperframes.json in the cwd the pane opens by itself at session start (without launching a browser). /cut <dir> opens a specific project; with several candidates the pane lists them as buttons.
  2. Look. The pane shows the frame under the playhead: Studio's thumbnail API renders it in about half a second. ▶ (p) plays it as a slideshow, one frame every 0.5 s of timeline, as fast as frames arrive. |◀ -1s -.1 +.1 +1s ▶| scrub (hotkeys a j h l k f while the pane has focus: ctrl+x tab, or click it); t= seeks to a time; ⟳ (r) re-captures.
  3. Point. Click anything in Studio, on the canvas or in its timeline. The pane polls Studio's selection every 1.5 s, shows it, maps it to the clip that hosts it, and moves the playhead to Studio's time. Rows in the pane (or 1–9) select a top-level clip without Studio.
  4. Cut with the CLI's own edits (each one hyperframes timeline … call, undoable with Undo): Trim in→┃ (i) starts the clip at the playhead; ┃←Trim out (o) ends it there; Split @┃ (s) makes <id>-2; Move→┃ (m) keeps the length; Duplicate (d) makes <id>-copy; Delete (x); Undo (u) restores the previous pane edit (receipts in <project>/.hyperframes/cutroom/). Studio keeps its own undo for drags made there.
  5. Say it. Just type in Claude Code's prompt: while a project is open and prompt context is on (t toggles it), every prompt you type carries the Studio selection, the hosting clip, the playhead, the snapshot path and a compact timeline, so "把這個標題放大" or "cut this scene 1s shorter" is enough. The Ask Claude › box does the same from inside the pane. When the turn ends the pane reloads the timeline and the frame; Studio reloads itself.
  6. Check (c) runs hyperframes check --json; Render draft (v) writes renders/draft.mp4; Reload (z) re-reads the timeline.

Try it

  1. Make a project if you have none: npx hyperframes init demo.
  2. In Claude Code: /cut demo. Studio opens in the browser; the pane shows the first frame. Press ▶, then click a clip in Studio's timeline and watch the pane follow.
  3. Type in the prompt: "make the title 20% larger". Claude edits the composition; Studio and the pane reload.

Layout

A Claude Code mod is three files plus a type contract (see the plugin-authoring skill inside Claude Code). This repo is one such mod and doubles as its own plugin marketplace.

.claude-plugin/plugin.json        manifest
.claude-plugin/marketplace.json   lets `claude plugin marketplace add` point here
hooks/hooks.json                  names the hooks module
hooks/register.tsx                the whole mod: CLI runner, state atoms, edit
                                  verbs, Studio bridge, prompt composer, Pane render
types/index.d.ts                  the $.state contract the pane draws from
tests/editor.test.tsx             claude plugin test .
  • claude plugin validate . lists every hook and $ call the engine will see.
  • claude plugin test . runs the tests against the real engine, with the world beneath the plugin (fs, process, http, store, env, clock) answered by the tests: clips list, nested rows hidden, select, seek, Split reaching the CLI with the exact argv, a split outside the clip refused before anything runs; and with Studio mocked, the selection poll landing in the pane and riding the next typed prompt as context.
  • Once loaded from a folder you own, the engine lays its API declarations under .claude-plugin/types/, and tsc -p . type-checks the mod.

License

MIT, see LICENSE.

更多類似作品