allen-hsu/claude-code-sketch

Claude에 17개의 그리기 도구를 제공하는 Claude Code 플러그인으로, 구조가 있는 답변이 터미널 트랜스크립트에 인터랙티브 다이어그램, 차트, 로드맵, 와이어프레임 카드로 직접 나타나게 합니다.
allen-hsu/claude-code-sketch

sketch는 단일 hooks 모듈(hooks/register.tsx)로 구축된 Claude Code mod입니다. 세션 시작 시 레이어, 다이어그램, 스키마, 스윔레인, 파이프라인, git 그래프, 시퀀스 다이어그램, 트리, 타임라인, 보드, 사분면, 저니, 와이어프레임, 메트릭, 차트, 카드, 비교를 다루는 17개의 도구를 등록합니다. ui.render 훅은 각 도구 호출의 트랜스크립트 행을 해당 호출 자체의 입력으로 그린 카드로 대체하고, prompt.compose 훅은 Claude에게 어떤 카드를 언제 사용해야 하는지 알려줍니다. 다이어그램은 노드의 연결선에 대한 호버 강조 표시와 애니메이션 펄스가 있는 클릭-투-포커스를 지원하며, 차트, 메트릭, 타임라인, 저니는 호출이 실행되는 동안 스스로 그려집니다. /plugin install sketch --marketplace allen-hsu/claude-code-sketch로 설치합니다. README에는 제한 사항(요청당 대략 5k 토큰의 도구 정의, 최소 약 60열 너비, CJK 너비 처리, 데스크톱/모바일 인터페이스는 테스트되지 않음)이 문서화되어 있으며 MIT 라이선스입니다.
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add allen-hsu/claude-code-sketch claude plugin install sketch@claude-code-sketch
English | 繁體中文
Claude Code answers with pictures instead of paragraphs.
sketch is a Claude Code mod (plugin). It gives Claude 17 drawing tools and one standing instruction: when an answer has a shape, draw the shape. Architecture, flows, roadmaps, user journeys, wireframes and charts appear as cards in the transcript, in your terminal, in your theme's colors.

A dense diagram stays readable because you can ask it about one node at a time:

Hover and click need a terminal that reports the mouse to Claude Code (the fullscreen renderer). The pulse runs for 30 seconds after the last click and then stops, leaving the thick lines; it redraws the focused card a few times a second while it runs.
At the prompt of a Claude Code terminal session:
/plugin install sketch --marketplace allen-hsu/claude-code-sketch
Answer y to add the marketplace, then pick a scope (user scope loads it in every session).
From a shell:
claude plugin install sketch --marketplace allen-hsu/claude-code-sketch
In the desktop app, where /plugin does not run: click + next to the prompt box, then Plugins, Add marketplace with allen-hsu/claude-code-sketch, then Add plugin.
Then just ask as usual: "how is this service put together?", "compare these three options", "plan the next quarter". Claude picks the card.
| Tool | Draws | Good for |
| --- | --- | --- |
| layers | Bands of components, nested zones, side concerns | Tech stacks, platform maps, deployment topologies |
| diagram | Nodes and wires, laid out automatically | Architecture wiring, flowcharts, state machines, boundaries (C4), dependencies |
| schema | Boxes with fields, and their relations | Data models (ER), class and component diagrams |
| swimlane | Steps across lanes of roles or systems | Processes with handovers |
| pipeline | Stages left to right, each a column of jobs | CI/CD, ETL, data flows |
| gitgraph | Branches, commits, merges and tags | Branching strategy, release flow |
| sequence | Actors and the messages between them | Request flows, protocols, handoffs |
| tree | An outline or a mind map | Goal breakdowns, sitemaps, taxonomies |
| timeline | Bars over periods, milestones | Roadmaps, gantt schedules, study plans |
| board | Columns of cards | Kanban, now / next / later |
| quadrant | Points on two axes, or four lists | Prioritisation, positioning, SWOT |
| journey | Stages, a mood line, rows of notes | User journeys, service blueprints |
| wireframe | A low-fidelity screen | Page and app layouts |
| metrics | Number tiles with a trend | KPIs, experiment results |
| chart | Bar, column, stacked, line, scatter, heatmap, histogram, funnel, share | Any numbers you already have |
| cards | Titled cards with tags and quotes | Personas, research findings, principles |
| compare | Options side by side, then a pick dialog | Decisions between two to four options |
The cards below are drawn from the made-up inputs in preview/samples.en.ts. Labels can be in any language; Chinese, Japanese and Korean text is measured correctly (see the 繁體中文 README for the same cards in Chinese).
layers shows what a system is made of. diagram shows how it connects: each node's wires have their own color, an edge that loops back is drawn with an upward arrow, and a node's shape says what it is (decision, store, external system). numbers: true numbers the nodes and marks each arrow with where it comes from.

| Flowchart | Dependencies |
| --- | --- |
|
|
|
When dependencies are too dense for wires, layout: "matrix" draws who uses whom as a grid, with counts:

With layout: "zones", each group becomes a framed band: subsystems, network boundaries, a C4 container view. The person shape marks a user or a role.

An edge from a node to itself is drawn as a loop inside the node, so a state machine is a diagram too:

Zones in layers can hold zones of their own, which covers deployment topologies (region, availability zone, subnet):

schema draws tables or classes with their fields, and the relations between them:
| Data model (ER) | Classes |
| --- | --- |
|
|
|
swimlane puts each step of a process in the lane of whoever does it, pipeline lays stages out left to right, and gitgraph shows branches over time:




| Outline | Mind map |
| --- | --- |
|
|
|




compare draws the options, then opens a dialog under the cards so you pick with the arrow keys; Claude carries on with your choice.





Charts, metric tiles, timelines and journeys draw themselves in while Claude's call runs:











The whole mod is one hooks module, hooks/register.tsx:
ui.render hook replaces each tool call's row in the transcript with the card, drawn from the call's own input. Hover groups light a node's wires with no code running; node names are buttons, and the one piece of state the mod keeps is which node each diagram card has focused (declared in types/index.d.ts), plus the tick the pulse steps on.prompt.compose hook adds one short section to the system prompt telling Claude when to reach for which card and to keep the text around it brief.ctrl+o to see the raw tool call behind a card.Things to know:
● two cells wide will misalign some cards.Box and Text, which every surface has, but the desktop and mobile surfaces are untested.The images in this README are not window screenshots. They are produced by the scripts in preview/: render.ts runs the mod's real hooks against a stand-in engine with a small flex layout of its own, and paint.py paints the resulting cells with the default dark theme's colors. frames.ts renders the animations frame by frame from the same hooks; in them, the hovered state is drawn as the terminal draws it, without a pointer. Layout in your terminal comes from Claude Code's own engine and your theme, so spacing and colors can differ slightly.
To regenerate them (macOS, needs Bun and Python with Pillow; use samples.zh-TW.ts and docs/images/zh-TW for the Chinese set):
cd preview
bun --jsx-factory=h --jsx-fragment=Fragment --jsx-runtime=classic render.ts ../hooks/register.tsx 110 cards.json ./samples.en.ts
python3 paint.py cards.json ../docs/images/en
bun --jsx-factory=h --jsx-fragment=Fragment --jsx-runtime=classic frames.ts ../hooks/register.tsx 110 ./samples.en.ts anim
SKETCH_GIF_SCALE=0.55 python3 paint.py anim-interaction.frames.json ../docs/images/en/interaction.gif
python3 paint.py anim-entrance.frames.json ../docs/images/en/entrance.gif
claude --plugin-dir . # run a session with the mod loaded from this folder
claude plugin validate . # check the manifest and the hooks module
Edits to hooks/register.tsx hot-reload in a session started with --plugin-dir.
MIT
내 프로젝트인가요? 이 배지를 README나 웹사이트에 넣으면 이 페이지로 연결됩니다.