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

fables

Claude Fables:把代理程式正在做的事即時變成提示列上方的小動畫漫畫,由 Sonnet 或 Haiku 即時編寫。

已翻譯

關於這個 mod

<p align="center"> <img src="assets/styles.gif" alt="Claude,這隻橘色小生物在十一種風格中演出程式設計片段:Pixel Art、the Original、Cave Painting、Blueprint、Mosaic、Frutiger Aero、Copperplate Engraving、Millefleur Tapestry、Golden Age Comic、Ukiyo-e 和 Kamon" width="960"> </p> <h1 align="center">Claude Fables</h1> <p align="center"> <b>Claude 撰寫程式時,把你的工作說成一部漫畫。</b><br> 一個適用於桌面應用程式的 Claude Code 外掛,會在提示列上方播放一小段動畫故事。 </p> <p align="center"> <img alt="Claude Code mod" src="https://img.shields.io/badge/Claude_Code-mod-d97757"> <img alt="桌面應用程式" src="https://img.shields.io/badge/runs_in-the_desktop_app-3b3a36"> <img alt="11 種風格" src="https://img.shields.io/badge/styles-11-6a5acd"> <img alt="20 個動作" src="https://img.shields.io/badge/actions-20-2e8b57"> <img alt="7 個場景" src="https://img.shields.io/badge/scenes-7-c46a2a"> </p> <p align="center"> <a href="#quick-start">快速開始</a> · <a href="#how-it-works">運作方式</a> · <a href="#use">使用</a> · <a href="#the-scenes">場景</a> · <a href="#captions">字幕</a> · <a href="#styles">風格</a> · <a href="#develop">開發</a> </p>

[!NOTE] Claude Fables 完全在 Claude Code 雲端環境中開發,也在桌面應用程式中進行本機測試。不過,它仍可能有錯誤和粗糙之處。非常歡迎提出 Issues 和拉取請求。

Claude 工作時,Fables 會觀察它發出的每次工具呼叫和說出的每一行文字。每隔幾秒,它會請 Sonnet(或你偏好的 Haiku)把最新片刻重述成一個場景。尋找錯誤會變成自然紀錄片,糟糕的正規表示式會被火車警察攔下。Claude 會作為一隻橘色小生物,在故事裡走路、潛行或飛行。工作階段結束時會出現收尾場景,並持續顯示 30 秒。

  • 每隔幾秒一個場景: Claude 的每次工具呼叫和每行話語,都會成為故事中的一個片刻。
  • 20 個動作: Claude 會依照工作內容行走、潛行、挖掘、絆倒、聳肩、睡覺和慶祝。
  • 7 個手工布光的場景: 森林、太空、城市、沙漠、火山、實驗室和夜間村莊。
  • 11 種風格: 從像素藝術到浮世繪,每個元素都會用對應媒材重新繪製。
  • 字幕像終端機一樣: 檔案、函式、數字、失敗和成功都會各自分開顯示。
  • 安全設計: 模型只寫入資料,從不寫入程式碼;不合格的回覆會直接略過。

快速開始

<p align="center"><img src="assets/install.gif" alt="Claude 抱著箱子穿過沙漠:正在移入 ~/code/Claude-Fables..." width="960"></p>
  1. 把這個儲存庫複製到永久位置,例如 ~/code/Claude-Fables。

  2. 將它加入 ~/.claude/settings.json 的 env 區塊:

    {
      "env": {
        "CLAUDE_CODE_PLUGIN_DIRS": "/Users/you/code/Claude-Fables"
      }
    }
    

    如果要用熱重載開發這個外掛,也加入 "CLAUDE_CODE_PLUGIN_DIR_WATCH": "1"。

  3. 重新啟動桌面應用程式,在 Code 分頁給 Claude 一個工作。幾秒後,漫畫會出現在提示列上方。

如果只想在一個工作階段中從終端機試用,改為執行 claude --plugin-dir ~/code/Claude-Fables。注意,在終端機中這個外掛只會觀察,不會繪製任何內容。

運作方式

<p align="center"><img src="assets/how-it-works.gif" alt="Claude 在深夜的實驗室裡檢查活動記錄" width="960"></p>
tool calls, Claude's own words ──► activity log (last 14 lines)
                                         │  as each scene is read, ≥5s apart
                                         ▼
        Sonnet or Haiku ($.model.complete) ──► JSON scene ──► parseScene (validate + clamp)
                                                                  │
                                                                  ▼
                                    sceneToSvg ──► one self-animating SVG (SMIL)
                                                                  │
                                                                  ▼
                                        <Svg isInteractive/> in the AbovePrompt band
  • 模型寫入的是資料,不是程式碼。 每個場景都是一個小型宣告式 JSON 物件:背景、Claude 的動作、粒子、字幕和語氣。hooks/scene.ts 會嚴格驗證它:未知欄位會被捨棄,數字會限制範圍,字串會壓平並截斷,顏色必須是 3 位或 6 位十六進位。錯誤的回覆不會破壞任何東西,只是不顯示。
  • 動畫在 SVG 內執行。 hooks/svg.ts 會把場景編譯成一份由 SMIL 自行播放動畫的 SVG 文件:行走循環、上下擺動、滾動的火車、閃爍的星星,以及會自行逐字顯示的對話泡泡。場景繪製完成後,桌面應用程式不需要再重繪。
  • 每一行都會讀完。 場景從佇列中逐一播放。每個場景會一直顯示,直到泡泡打完字,並在畫面上停留足夠長的時間讓人讀完;字幕越長,需要的時間越久。不會有任何內容插進來:失敗不會,工作階段結束不會,下一個提示也不會。旁白會按照模型回覆的速度,在目前場景快讀完前一點請求下一個場景,讓它準時準備好。提早回傳的場景會留在佇列中等待。消息事件(失敗或工作階段結束)會立即請求,然後排在目前場景後面。旁白會知道主角剛剛說了什麼,因此消息會在故事中插入(「等等——」「喔!」),而不是突然出現在畫面上。新提示進來時,目前顯示的場景仍會播放完,還在路上的收尾場景也會先播放,然後才開始新的故事。工作階段結束後,最後一個場景會繼續顯示 30 秒,接著提示列清空。
<details> <summary><b>內部機制:</b>排隊、平順變化、字幕適配、限制、尺寸</summary>
  • 變化很平順。 新環境中的場景會從上一個場景淡入;同一環境中的場景則直接延續。每個場景只繪製一次並保留下來,因此桌面應用程式可以完整播放它。桌面應用程式會在屬性變更時再次繪製提示列,而工作階段結束一定會變更屬性。因此,正在顯示的場景每次重繪(工作階段結束、調整大小、新風格)都會對齊場景自己的時鐘:字幕打到哪裡就停在哪裡,Claude 也會走到相同的位置。
  • 字幕會適配泡泡。 旁白最多會被要求寫 70 個字元。硬上限是 80 個字元,這是泡泡在四行內完整顯示的最大長度。字幕更長時,會在最後一個完整句子後截斷;如果沒有完整句子,就在完整單字後加上刪節號截斷,絕不會截斷單字。泡泡一定會顯示收到的每個單字。
  • 它有明確限制。 同一時間只會執行一個模型請求,場景之間至少間隔 5 秒,出錯後會指數退避,最多退避 60 秒。提示一直有長度上限(最近 14 行活動記錄和最近 4 個場景),因此長時間工作階段不會撐爆上下文視窗。
  • 它能配合視窗。 提示列一定會得到一個與自身同寬、192 px 高的漫畫。視窗更寬時,只會顯示更多場景,不會把漫畫放大,因此圖像和文字大小維持不變。調整視窗大小會重新繪製它。
  • 僅限桌面應用程式。 在終端機中,提示列會完全保留引擎繪製的樣子。
</details> <details> <summary><b>檔案</b></summary>

| 檔案 | 作用 | | --- | --- | | hooks/register.tsx | 外掛:觀察工具呼叫、回覆和工作階段;繪製提示列;處理 /fables | | hooks/narrator.ts | 旁白的系統提示、提示建構、回覆解析、退避 | | hooks/director.ts | 旁白迴圈:記住什麼、何時請求、如何處理回覆。外掛和檢視器使用同一套邏輯 | | hooks/activity.ts | 把每次工具呼叫壓縮成一行易讀文字 | | hooks/scene.ts | 場景格式及其驗證器 | | hooks/sprites.ts | 像素藝術庫:兩個行走影格的 Claude,以及 30+ 個道具 | | hooks/svg.ts | 場景 → 動畫 SVG:背景、粒子、道具、主角、字幕 | | hooks/looks.ts | 外觀:Pixel Art、the Original 和風格註冊表 | | hooks/styles/*.ts | 九種畫廊風格,每種都是一套藝術規範:墨線、各類元素的繪製方式、Claude、字幕、標籤、邊框 | | hooks/art/roles.ts、hooks/art/painter.ts、hooks/art/ink.ts | 場景繪製元素所使用的角色,以及風格重繪元素時使用的繪製器 | | hooks/grade.ts | 網格風格用來鋪設繪製舞台的媒材:鑲嵌片或織紋 | | hooks/clawd3d.ts | 3D Claude:盒狀模型、動作和投影(從畫廊移植而來) | | hooks/hero3d.ts | 把擺好姿勢的 3D 模型烘焙成由 SMIL 依序播放的 SVG 影格 | | hooks/scenery.ts | 七個製作完成的場景:光照圖、材質、反射 | | types/index.d.ts | 場景型別及外掛的 $.state 契約 |

</details>

使用

<p align="center"><img src="assets/use.gif" alt="Claude 在森林中揮手:/fables on,還有你好!" width="960"></p>
  • /fables:開啟或關閉外掛。/fables on 和 /fables off 也可以使用。設定會在工作階段之間保留。
  • /fables style <name>:用下方的其中一種風格繪製每個場景,例如 /fables style ukiyo-e 或 /fables style golden age。/fables style 會列出風格,/fables style off 則回到預設的 Pixel Art。設定會在工作階段之間保留。
  • /fables pixel off 和 /fables pixel on 仍然有效:它們會在平滑繪製的原始外觀和像素藝術之間切換。
  • /fables model haiku 和 /fables model sonnet:選擇編寫故事的人。Sonnet 是預設選項,會寫出更機智的場景;Haiku 大約一秒就會回覆且成本較低,但字幕更樸素,也更容易偶爾失誤(錯誤回覆會直接略過)。/fables model 會顯示目前啟用的選項。選擇會在工作階段之間保留;設定選單中的 Scene model(pluginConfigs.fables.model)會設定預設值。

每個場景都是一次小型模型請求,因此 Claude 工作時每分鐘會產生幾次請求。

場景

<p align="center"><img src="assets/scenes.gif" alt="七個場景導覽:森林、太空、城市、沙漠、火山、實驗室和夜間村莊" width="960"></p>

Claude 被繪製成畫廊的 3D 模型:相同的盒狀身體、手臂、腿和膠囊形眼睛,經過布光並按深度排序。提示列的框架不執行腳本,因此模型無法即時繪製。hooks/clawd3d.ts 會在每個動作中擺出 6 到 12 個姿勢,hooks/hero3d.ts 會把每個姿勢烘焙成平面 SVG 多邊形,場景再用 SMIL 逐格播放。模型無法跟隨游標或被拖曳;這些功能需要即時引擎。

旁白會為每個場景從 20 個動作中選一個,每個動作都對應一種工作:

| 播放方式 | 動作 | | --- | --- | | 穿過舞台,從 from 到 to | walk、run、fly、carry(移動檔案)、sneak(尋找錯誤)、jump、tumble(障礙、重試) | | 原地循環 | dig(搜尋)、inspect(閱讀和編輯程式碼)、think、point(找到了)、peek、spin(重構)、wave(你好)、sleep(長時間等待)、panic(錯誤)、dance、celebrate(里程碑) | | 原地一次 | trip(測試失敗)、shrug(沒有找到) |

場景可以用 then 接上第二個動作,在第一個動作結束的位置原地播放:先 sneak 再 peek,先 trip 再 shrug,先 jump 再 celebration。沒有第二個動作時,Claude 會在穿過舞台或完成一次性動作後待機;待機中的 Claude 會四處看看、眨眼、轉移重心並伸展。過程中,它的眼睛會因驚訝而睜大,專注時變窄,頭暈時交叉,並在眉下露出擔心。

hooks/scenery.ts 中的七個背景都是製作完成的場景,各自有一段簡介、一個光源和一小組配色:

| 背景 | 場景 | | --- | --- | | forest | 老森林中的黎明:低垂的太陽位於兩排棕色樹幹的冷杉後方,霧氣在樹間飄蕩,光線以束狀落下並聚在空地,兩根巨大的樹幹框住邊緣 | | space | Earthri

安裝

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

claude plugin marketplace add henrik-thevibe/Claude-Fables
claude plugin install fables
原文 / README
<p align="center"> <img src="assets/styles.gif" alt="Claude, the little orange critter, playing out coding moments in all eleven styles: Pixel Art, the Original, Cave Painting, Blueprint, Mosaic, Frutiger Aero, Copperplate Engraving, Millefleur Tapestry, Golden Age Comic, Ukiyo-e and Kamon" width="960"> </p> <h1 align="center">Claude Fables</h1> <p align="center"> <b>Your work, told as a cartoon while Claude codes.</b><br> A Claude Code mod for the desktop app that plays a small animated story in the band above the prompt. </p> <p align="center"> <img alt="Claude Code mod" src="https://img.shields.io/badge/Claude_Code-mod-d97757"> <img alt="Desktop app" src="https://img.shields.io/badge/runs_in-the_desktop_app-3b3a36"> <img alt="11 styles" src="https://img.shields.io/badge/styles-11-6a5acd"> <img alt="20 actions" src="https://img.shields.io/badge/actions-20-2e8b57"> <img alt="7 scenes" src="https://img.shields.io/badge/scenes-7-c46a2a"> </p> <p align="center"> <a href="#quick-start">Quick start</a> · <a href="#how-it-works">How it works</a> · <a href="#use">Use</a> · <a href="#the-scenes">The scenes</a> · <a href="#captions">Captions</a> · <a href="#styles">Styles</a> · <a href="#develop">Develop</a> </p>

[!NOTE] Claude Fables was developed entirely in Claude Code cloud environments and tested locally in the desktop app as well. Still, there may be bugs and rough edges. Issues and pull requests are very welcome.

While Claude works, Fables watches each tool call it makes and each line it says. Every few seconds it asks Sonnet (or Haiku, if you prefer) to retell the latest moment as a scene. Bug hunts turn into nature documentaries and bad regexes get pulled over by the train police. Claude appears as a small orange critter walking, sneaking or flying through the story. When the turn ends there is a closing scene, and it stays up for 30 seconds.

  • A scene every few seconds: each tool call and line Claude says becomes a moment in a story.
  • 20 actions: Claude walks, sneaks, digs, trips, shrugs, sleeps and celebrates, matched to the work.
  • 7 hand-lit scenes: forest, space, city, desert, volcano, lab and night village.
  • 11 styles: from pixel art to ukiyo-e, every element redrawn in the medium.
  • Captions that read like a terminal: files, functions, numbers, failures and successes each set apart.
  • Safe by design: the model writes data, never code, and a bad reply is simply skipped.

Quick start

<p align="center"><img src="assets/install.gif" alt="Claude carrying a box across the desert: Moving into ~/code/Claude-Fables..." width="960"></p>
  1. Clone this repo somewhere permanent, for example ~/code/Claude-Fables.

  2. Add it to the env block in ~/.claude/settings.json:

    {
      "env": {
        "CLAUDE_CODE_PLUGIN_DIRS": "/Users/you/code/Claude-Fables"
      }
    }
    

    To work on the mod with hot reload, also add "CLAUDE_CODE_PLUGIN_DIR_WATCH": "1".

  3. Restart the desktop app and give Claude a task in the Code tab. The cartoon appears above the prompt after the first few seconds.

To try it from the terminal for one session instead, run claude --plugin-dir ~/code/Claude-Fables. Note that in the terminal the mod only watches and draws nothing.

How it works

<p align="center"><img src="assets/how-it-works.gif" alt="Claude inspecting the activity log in a late-night lab" width="960"></p>
tool calls, Claude's own words ──► activity log (last 14 lines)
                                         │  as each scene is read, ≥5s apart
                                         ▼
        Sonnet or Haiku ($.model.complete) ──► JSON scene ──► parseScene (validate + clamp)
                                                                  │
                                                                  ▼
                                    sceneToSvg ──► one self-animating SVG (SMIL)
                                                                  │
                                                                  ▼
                                        <Svg isInteractive/> in the AbovePrompt band
  • The model writes data, not code. Each scene is a small declarative JSON object: a backdrop, Claude's action, particles, a caption and its tone. hooks/scene.ts validates it strictly: unknown fields are dropped, numbers clamped, strings flattened and cut, and colors must be 3- or 6-digit hex. A bad reply can't break anything; it just doesn't show.
  • The animation runs inside the SVG. hooks/svg.ts compiles a scene into one SVG document that animates itself with SMIL: walk cycles, bobbing, scrolling trains, twinkling stars, and a speech bubble that types itself out. Once the scene is drawn, the desktop needs no redraws for it.
  • Every line gets read. Scenes play from a queue, one at a time. Each one stays up until its bubble has typed out and been on screen long enough to read, which takes longer for a longer caption. Nothing cuts in: not a failure, not the end of the turn, not the next prompt. The narrator asks for the next scene a little before the current one is read, timed to how quickly the model has been answering, so it is ready on time. A scene that comes back early waits in the queue. News (a failure, the turn ending) is asked for straight away and joins the queue behind the current scene. The narrator is told what the hero has just said, so the news breaks in within the story ("Wait-", "Oh!") rather than on screen. When a new prompt comes in, the scene that is up is still read through, and a closing scene still on its way plays before the new story starts. Once a turn is over, its last scene stays up for 30 seconds, then the band clears.
<details> <summary><b>Under the hood:</b> queueing, smooth changes, caption fit, limits, sizing</summary>
  • Changes are smooth. A scene in a new setting fades in from the last one; one in the same setting carries straight on. Each scene is drawn once and kept, so the desktop plays it through. The desktop draws the band again whenever its props change, and the end of a turn always changes them. So every redraw of a scene that is up (the turn ending, a resize, a new style) is set to the scene's own clock: the caption is exactly as far typed as it was, and Claude is exactly as far along.
  • Captions fit the bubble. The narrator is asked for at most 70 characters. The hard limit is 80, the most the bubble shows whole in four lines. A longer caption is cut after its last full sentence, or else after a whole word with an ellipsis, never mid-word. The bubble always shows every word it is given.
  • It has limits. Only one model request runs at a time, scenes come at least 5 seconds apart, and after errors it backs off exponentially, up to 60 seconds. The prompt is always bounded (the last 14 activity lines and the last 4 scenes), so a long session can't outgrow the context window.
  • It fits the window. The band always gets a cartoon as wide as it is and 192 px tall. A wider window shows more of the scene, not a bigger one, so the art and the text stay the same size. Resizing the window redraws it.
  • Desktop only. In the terminal the band is left exactly as the engine draws it.
</details> <details> <summary><b>The files</b></summary>

| File | What it does || --- | --- | | hooks/register.tsx | The hooks: watches tool calls, replies and turns; draws the band; handles /fables | | hooks/narrator.ts | The narrator's system prompt, prompt building, reply parsing, backoff | | hooks/director.ts | The narrator's loop: what it remembers, when it asks, what it does with a reply. The plugin and the viewer run the same one | | hooks/activity.ts | Boils each tool call down to one readable line | | hooks/scene.ts | The scene format and its validator | | hooks/sprites.ts | The pixel-art library: Claude in two walk frames, plus 30+ props | | hooks/svg.ts | Scene → animated SVG: backdrops, particles, props, hero, caption | | hooks/looks.ts | The looks: Pixel Art, the Original, and the registry of styles | | hooks/styles/*.ts | The nine gallery styles, each an art bible: inks, how each kind of element is drawn, Claude, caption, tag, frame | | hooks/art/roles.ts, hooks/art/painter.ts, hooks/art/ink.ts | The roles scenes paint their elements under, and the painter a style redraws them with | | hooks/grade.ts | The medium a grid style sets the drawn stage into: tesserae or a weave | | hooks/clawd3d.ts | The 3D Claude: the box model, its motions and its projection (ported from the gallery) | | hooks/hero3d.ts | Bakes the posed 3D model into SVG frames that SMIL plays in turn | | hooks/scenery.ts | The seven authored scenes: light maps, materials, reflections | | types/index.d.ts | The scene types and the mod's $.state contract |

</details>

Use

<p align="center"><img src="assets/use.gif" alt="Claude waving in the forest: /fables on, and hello!" width="960"></p>
  • /fables: toggle the mod on or off. /fables on and /fables off also work. The setting is remembered across sessions.
  • /fables style <name>: draw every scene in one of the styles below, for example /fables style ukiyo-e or /fables style golden age. /fables style lists them, and /fables style off goes back to the default, Pixel Art. It is remembered across sessions.
  • /fables pixel off and /fables pixel on still work: they switch between the original look drawn smooth and its pixel art.
  • /fables model haiku and /fables model sonnet: pick who writes the story. Sonnet is the default and writes wittier scenes; Haiku answers in about a second and costs less, but writes plainer captions and slips a little more often (a bad reply is simply skipped). /fables model shows which one is on. The choice is remembered across sessions; the config menu's Scene model (pluginConfigs.fables.model) sets the default.

Every scene is one small model request, so this costs a few requests per minute while Claude is working.

The scenes

<p align="center"><img src="assets/scenes.gif" alt="A tour of the seven scenes: forest, space, city, desert, volcano, lab and night village" width="960"></p>

Claude is drawn as the gallery's 3D model: the same box body, arms, legs and pill eyes, lit and depth-sorted. The band's frame runs no script, so the model can't be drawn live. hooks/clawd3d.ts poses it 6 to 12 times per motion, hooks/hero3d.ts bakes each pose into flat SVG polygons, and the scene flips through them with SMIL. The model can't follow the cursor or be dragged; those need the live engine.

The narrator picks one of 20 actions for each scene, each tied to a kind of work:

| plays | actions | |---|---| | crossing the stage, from from to to | walk, run, fly, carry (moving files), sneak (bug hunts), jump, tumble (obstacles, retries) | | in place, looping | dig (searching), inspect (reading and editing code), think, point (found it), peek, spin (refactors), wave (hello), sleep (long waits), panic (errors), dance, celebrate (milestones) | | in place, once | trip (a test fails), shrug (nothing found) |

A scene can chain a second action with then, played in place where the first one ends: a sneak then a peek, a trip then a shrug, a jump then a celebration. Without one, Claude stands idle after crossing or after a one-off, and an idle Claude looks about, blinks, shifts its weight and stretches. Along the way its eyes go wide, narrow in focus, cross when it's dizzy and worry under a brow.

Each of the seven backdrops in hooks/scenery.ts is an authored scene with one brief, one light source and a small palette:

| Backdrop | The scene | | --- | --- | | forest | Dawn in an old forest: a low sun behind two rows of firs on brown trunks, mist between them, light falling through in shafts and pooling in a clearing, two great trunks framing the edges | | space | Earthrise over a lunar outpost: a low sun rakes the regolith, so every swell has a lit crest, every crater a black bowl and a bright far wall, every rock a long shadow | | city | Blue hour after rain: towers with lit west edges and dark east faces, offices lit a floor at a time, a spire, an elevated train, and the whole skyline mirrored in the wet street | | desert | Mesa sunset: the sun sets in a notch the ranges leave clear, so they face us in violet shade with their sunward sides burning, and their shadows fan toward us across the sand | | volcano | A night eruption: the crater lights its own ash column from beneath, lava runs down a gullied cone, and a stream crosses a black crust crazed with glowing cracks | | lab | Working late: an architect's lamp warms the board-formed concrete and the bench, dust turns in its cone, rain beads on the window over a city opened into bokeh, and the polished floor mirrors the room | | night | A sleeping village: hills under a high moon, cottages with one lit window and a thread of smoke, a great oak framing the view, fireflies |

<details> <summary><b>How they are lit</b></summary>

Every surface is painted twice. First as light: a warm key where the light source reaches, cool shade facing away, deep tones where surfaces meet. Then that light map is multiplied by a material, built in an SVG filter from seeded noise cut into a small palette of related colors: needles, bark, grass, basalt, sandstone, sand, regolith, concrete, wood, asphalt. Light that has to brighten a dark material (shafts, lava glow, lamp pools) is added on top with a screen blend instead. Glows bloom, far layers sit slightly out of focus, rims of light appear only where the light can actually reach, and a lens pass adds fine grain and a vignette over the whole frame, Claude included.

Wet and polished floors reflect: the city's skyline and the lab's room are drawn once, then placed again upside down, blurred and broken by ripples, strongest in the puddles.

Depth comes from atmospheric perspective: further layers are lighter and nearer the sky's color. Focal points sit off the middle, so the middle of the stage, where Claude and the caption are, stays calm. Silhouettes come from smooth noise rather than repeated tiles, so there is no seam at any width. Everything is clipped to the stage, and motion is slow and belongs to the story.

The band's frame takes at most 131,072 characters, so repeated things are drawn once and placed many times: the firs, the grass clumps and the furthest tree line are templates. A scene that would still run over is redrawn leaner, then without particles, and as a last resort on the flat stage.

</details>

Captions

<p align="center"><img src="assets/captions.gif" alt="Claude pointing at a caption that reads: npm test on dates.ts: 42/42 passed, 0 failed" width="960"></p>

The story is told in words. Props aren't drawn on the scene, so nothing competes with Claude and the caption.

The caption is one standard bubble of cartoon paper with a tail pointing at Claude, set in Monocraft by Idrees Hassan (SIL Open Font License, fonts/Monocraft-OFL.txt), embedded as a 5 KB subset so it reads the same everywhere. It stays with Claude and never covers it: it takes a spot just beside, above or (for a flying Claude) below, checked against Claude's whole path, jumps and sways included. While Claude walks, the bubble walks along at the same distance, so its tail always points at Claude. Above Claude, it can sit anywhere along Claude's head, and a narrower wrap is tried, to find a spot the stage's edges never hold back. When a walk is too long for any spot, the bubble waits unseen until Claude is far enough in, then appears beside Claude and walks on with it. That wait is added to the scene's reading time. Inside it, kinds of words are set apart, so a caption reads like a terminal:

| Kind | Example | Looks like | | --- | --- | --- | | code and commands (in backticks, or a known command) | npm test | teal | | files and paths | dates.ts, src/auth | blue | | functions | daysInMonth() | purple | | numbers and timings | 312, 2.41s, 42/42 | orange, bold | | failures | failed, TypeError, N+1 | red, bold | | successes | passed, clean, green | green, bold | | ASCII faces and symbols | ^^ >< \o/ -> [OK] | warm accent |

The narrator also picks a tone for the moment. Trouble leads the caption with a red ✗ and a milestone with a green ✓; a celebration is a milestone unless it says otherwise. The narrator is asked to write like a developer, with backticks around code and the odd ASCII face.

<details> <summary><b>The pixel-art pass</b></summary>

In the Pixel Art look (the default), the whole stage, scenery and Claude together, goes through a pixelizer: one SVG filter that samples the drawing at the middle of every two-unit square and spreads each sample over its square, so everything reads as pixel art without any of it being redrawn, and no blur washes the colors out. The grid starts at the stage's corner, so the pixels line up. Claude gets a sprite filter of its own on the same grid: its body sampled crisp, its eyes (finer than a pixel) found by their darkness and thickened just enough to land on whole pixels, and a one-pixel dark outline round it, as a pixel-art character would have. The caption sits above it all, already in pixel type, so it stays sharp. In the Original look, scenes are drawn smooth and the scenery takes a slight blur instead, so Claude and the caption read first.

</details>

Styles

<p align="center"><img src="assets/styles-grid.png" alt="One still of each of the eleven styles, each labelled with its /fables style command" width="960"></p>

Two looks draw the authored scenes as they are: Pixel Art (pixel, the default) and the Original (original), the same scenes drawn smooth.

Nine more styles, from the Claude Mascot Style Gallery, are artworks of their own. Each one redraws every element of every scene, Claude, the caption bubble, the chapter tag and the frame in its own medium, translated from the gallery's original plate. They are cosmetic only: the story, the scenery's composition and Claude's path stay as they are, and nothing is added to a scene.

| Style | /fables style … | The artwork | | --- | --- | --- | | Cave Painting | cave | Ochre, soot and pale earth rubbed thin on torch-lit limestone; no sky, only the wall; broken soot outlines; Claude in red ochre | | Blueprint | blueprint | White line work on a cyanotype sheet; shade section-hatched, air and light as phantom lines; Claude as a patent drawing with hidden edges dashed | | Mosaic | mosaic | Laid in the floor's stones and set as tesserae in grout, outlined in rows of dark stones; a meander border | | Frutiger Aero | aero | Glossy gradients with a white rim on every surface, after the Vista and 7 wallpapers: an azure sky with a sun flare, Bliss-green grass, aqua glass towers, pearl rooms; Frutiger Aurora at night with teal meadows, moonlit clouds and bokeh stars; Claude as tangerine jelly | | Copperplate Engraving | engraving | One sepia ink on laid paper, every tone cut as hatching along the grain of what it is; a plate mark | | Millefleur Tapestry | tapestry | Woven in madder, woad, weld and walnut wool on the loom's grid; grass becomes the field of a thousand flowers | | Golden Age Comic | golden | Flat newsprint inks, shade in Ben-Day dots, heavy keylines; a lettered balloon | | Ukiyo-e | ukiyoe | Flat woodblock inks over a key line, bokashi skies, kasumi mist, a vermilion sun; a cartouche and seal | | Kamon | kamon | Cream planes on black silk parted by cuts of one width; Claude as a crest; the vermilion hanko |

<details> <summary><b>How a style redraws a scene</b></summary>

Every element of a scene is handed to a painter under a role that says what it is and how deep it stands (hooks/art/roles.ts): a fir, a mist bank, a mesa, the lamp's cone, the wet street. The original looks keep the lit, photographic painting. A style's painter (hooks/art/painter.ts, hooks/styles/*.ts) reads that painting for its shapes and tones and draws it again:

  • the lit look's blooms, materials and lens are left out;
  • each lit color becomes one of the style's inks, wools, stones or threads, chosen by the element's family and depth;
  • shapes take the style's line;
  • what has no edge in the art form (sun and moon, mist, light, water) is redrawn by the style's own conventions.

Claude is drawn by each style's hero painter, from the 3D model's faces, its parts' outline hulls and its edges, which are classed as outline, crease or hidden as in the gallery's engine. A style made on a grid (Mosaic, Tapestry) names that grid as its medium: the drawn stage is set into tesserae or a weave, and its grout or the weave's ribs are laid over it. The narrator hears each style's voice, so a caption can sound like a 1938 comic or a woodblock print while still being about the real work.

The styles draw as fast as the original look or faster, since they leave out the lit look's material filters, and every one fits the band's size limit at every width.

</details>

Develop

<p align="center"><img src="assets/develop.gif" alt="Claude digging by an erupting volcano: Digging through scripts/rehearse.ts" width="960"></p>
claude plugin validate .              # manifest, hooks and state contract
claude plugin test .                  # unit tests plus engine tests (stubbed Sonnet)
bun scripts/preview.ts > gallery.html # render sample scenes to a page in the browser
bun scripts/preview.ts --look all > styles.html # every look

scripts/scenarios.ts holds seven whole sessions: the prompt, each tool call and its result, Claude's words, and what Sonnet and what Haiku write back each time the narrator asks, as raw text, quirks included (code fences, a word of chatter, a missing caption, an empty answer). scripts/rehearse.ts plays a session through the narrator's own loop on a clock of its own, so the asks land when the plugin would make them, see exactly the prompt it would send, and bad replies are skipped and backed off from the same way. The viewer's Sessions tab shows it side by side: Claude Code's activity, the narrator's asks (with each prompt) and the model's replies (with each raw reply and the validator's verdict), the band, and a box to paste a reply of your own and see what the plugin would make of it. A test rehearses every session with both models. bun scripts/preview.ts my-scenes.json renders your own scenes, which is handy for tuning sprites or trying out what Sonnet sent back.

The mod API is early access and may change between Claude Code releases. This mod was built against Claude Code 2.1.287. If something stops drawing, run claude --debug: the log line will name what the engine refused.

The images in this README are drawn by the mod itself: bun scripts/readme-gifs.ts renders them to assets/. The launch video is made the same way; see video/.

Built in the cloud

<p align="center"><img src="assets/cloud.gif" alt="Claude flying over the moon: Built entirely in the cloud. Bugs may lurk." width="960"></p>

Claude Fables was developed entirely in Claude Code cloud environments: the mod, its tests, the scenes and styles, this README's images and the launch video. It was also tested locally in the desktop app, but there may still be bugs, and some may only show up on your setup. If something looks off, run claude --debug and open an issue with what the log says.

Credits

  • Claude's 3D model and its projection are ported from the gallery's engine by ChetasLua, under the MIT License.
  • The nine gallery styles come from the Claude Mascot Style Gallery.
  • Captions are set in Monocraft by Idrees Hassan, under the SIL Open Font License (fonts/Monocraft-OFL.txt).

更多類似作品