Claude Code を用いた HTML の不合理な効果の活用
Anthropic は、Claude Code が生成するドキュメントや仕様書において、Markdown の代わりに HTML を採用することで、情報の密度、可読性、共有効率、双方向性を劇的に向上させる戦略を提唱している。
キーポイント
情報密度の飛躍的向上
HTML は表形式データ、CSS によるデザイン、SVG イラスト、JavaScript によるインタラクションなど、Markdown では表現困難な多様な情報を高密度に統合して表現できる。
視覚的明瞭性と可読性の確保
複雑な仕様書や計画書でも、HTML の構造化機能によりタブやリンクでナビゲートしやすく、モバイル対応も可能となるため、人間が理解・レビューする負担を大幅に軽減する。
共有と協業の効率化
Markdown ファイルはブラウザでの直接表示が困難だが、HTML ファイルはリンクとして共有すれば誰でも即座に閲覧でき、組織内での仕様書やレポートの閲覧率を高める。
双方向インタラクションの実現
HTML を活用することで、静的なドキュメントを超えた双方向的なユーザー体験やワークフローの可視化が可能となり、AI と人間の対話形式がさらに洗練される。
影響分析・編集コメントを表示
影響分析
このアプローチは、LLM が生成するテキスト出力の形式を単なる「記述」から「実行可能なドキュメント」へと進化させる重要な転換点を示しています。特にエンジニアリング現場やプロダクト管理において、AI 生成物の可読性と実用性を担保するための標準的なベストプラクティスとして定着する可能性が高く、開発効率の向上に直結します。
編集コメント
AI が生成するドキュメントの形式を「人間が読みやすいもの」に最適化する発想は、実務現場での AI 活用率を高める上で極めて重要です。Markdown の限界を超え、HTML を活用することで、AI と人間の対話における情報伝達の質が一段階向上するでしょう。
なぜ HTML を使うのか?
Claude Code で現在行っているような作業、特に必要とされる、あるいは伴うタスクにおいて、Markdown よりも HTML の方が適している理由がいくつかあります。
情報密度

HTML は Markdown に比べて、はるかに豊かな情報を伝えることができます。もちろん、見出しや書式設定といった単純なドキュメント構造も表現できますが、それ以外にも以下のようなあらゆる種類の情報を表すことが可能です。
- テーブルを使用した表形式データ
- CSS を用いたデザインデータ
- SVG によるイラストレーション
- script タグを用いたコードスニペット
- JavaScript と CSS を組み合わせた HTML 要素によるインタラクション
- SVG と HTML を組み合わせたワークフロー
- 絶対位置指定とキャンバスを使用した空間データ
- image タグを使用した画像
私の意見では、Claude が読み取れる情報のセットで、HTML で効率的に表現できないものはほとんどありません。これにより、モデルが詳細な情報をあなたに伝え、あなたがそれをレビューするための非常に効率的な手段となります。
私は、これができない場合、モデルは Markdown においてより非効率なことを行うことがあると発見しました。例えば ASCII アート図や、私が最も好きな Unicode 文字を用いた色の推定などです。

視覚的な明瞭さと読みやすさ

Claude がより複雑な作業に取り組めるようになったことで、より大規模な仕様書や計画書を作成できるようになりました。私が実感しているのは、100 行を超える Markdown ファイルを自分で読むことさえ稀で、組織内の他のメンバーに読んでもらうことはさらに難しいということです。
一方、HTML ドキュメントは視覚的に構造を整え、タブ、図解、リンクを用いて理想的なナビゲーション体験を提供できるため、はるかに読みやすいです。また、モバイル対応も可能なので、デバイスの種類に応じて異なる表示形式で閲覧することもできます。
共有の容易さ
Markdown ファイルは、ほとんどのブラウザがネイティブに適切にレンダリングしないため、共有が比較的困難です。メールやメッセージへの添付ファイルとして追加する必要があるケースが多々あります。
HTML ファイルをアップロードすれば、リンクを簡単に共有できます。同僚は好きな場所で開き、容易に参照することができます。
仕様書、レポート、PR(プルリクエスト)の記述が HTML 形式である場合、実際にそれを読まれる確率は格段に高まります。
双方向インタラクション

HTML を用いれば、ドキュメント自体と対話することも可能です。例えば、デザインの調整のためにスライダーやノブを追加したり、アルゴリズムの異なるオプションを微調整して結果を確認したりするよう指示できます。また、これらの変更をプロンプトにコピーして、Claude Code へ貼り戻すことも可能です。
有用な場合、これにより、取り組んでいる特定の課題に対して個別の編集環境を作成することが可能になります。
データ取り込み
Claude Code を使用して HTML ファイルを作成する最大の理由の一つは、Claude Code が取り込めるコンテキストの多さです。例えば、この記事を書く際、私は Claude Code にコードフォルダを読み込ませて私が生成したすべての HTML ファイルを見つけさせ、それらをグループ化・分類させた上で、各タイプを表す図を含む HTML ファイルを作成させました。この記事で見られる図は、まさにその結果の直接的なものです。
ファイルシステムに加えて、Claude Code は MCPs(Slack や Linear など)、Web ブラウザ(Chrome 内の Claude を使用)、および git の履歴を通じて追加のコンテキストも取得できます。
始め方
注意すべき点があります。このような HTML を生成させるために、特別な準備を多く行う必要はありません。単に「*HTML ファイルを作成して*」や「*HTML アーティファクトを作成して*」とプロンプトするだけで十分です。重要なのは、そのアーティファクトが何をするべきか、そしてどのように活用できるかを理解することです。時間とともに、反復されるパターンに特化したスキルを構築することも意味を持つようになるかもしれませんが、まずはゼロからプロンプトを入力することで、異なるユースケースにおける動作感を掴むのが良い方法です。
使用例
このアプローチをより具体的にするために、以下に Markdown よりも HTML ファイルを使用する方が適切だと考えるいくつかの使用例を示します。また、これらの使用例については GitHub のギャラリー こちら でも追跡可能です。
仕様策定、計画立案、および探索
HTML は Claude が問題に没頭するための豊かなキャンバスです。単純な Markdown による計画ではなく、問題に取り掛かる際には HTML ファイルのウェブを作成することを期待しています。例えば、Claude Code に異なるオプションのブレインストーミングやいくつかの探索的試行を依頼することから始めます。その後、そのうちの1つについてさらに詳細に拡張し、おそらくインターフェースタイプのモックアップや例を作成するよう求めます。最後に、自分が満足したと感じた時点で、実装計画の作成を依頼します。計画に満足したら、新しいセッションを開始し、これらすべてのファイルを渡して実装させます。
検証を行う際にも、検証エージェントに対してこれらのファイルを読み込ませるよう依頼し、必要なものが何であるかについてより広範な文脈を持たせることになります。

例となるプロンプト:
- オンボーディング画面の方向性をどうするか確信が持てません。レイアウト、トーン、密度をそれぞれ変えた 6 つの全く異なるアプローチを生成し、1 つの HTML ファイルにグリッド形式で並べて、横並びで比較できるようにしてください。各案にはそのトレードオフ(取舍)を明記してください。
- 包括的な実装計画を HTML ファイルとして作成してください。モックアップ(見本図)を作成し、データフローを示し、確認したい重要なコードスニペットを含めてください。読みやすく、消化しやすいものにしてください。
以下に使用します:
- コード内で何かを実装する他の方法を探索する
- 複数の視覚的デザインを同時に実験する
コードレビューと理解
Markdown ファイルではコードを読みづらく感じることもありますが、HTML を使えば差分(diff)、注釈、フローチャート、モジュールなどをレンダリングできます。エージェントが書いたコードを理解したり、コードレビューを行ったり、PR(プルリクエスト)をコードレビューする人に説明したりするために HTML を活用してください。

プロンプトの例:
*この PR を説明する HTML アーティファクトを作成してレビューを支援してください。ストリーミングやバックプレッシャー(背圧)ロジックにはあまり詳しくないため、その点に焦点を当ててください。実際の差分をレンダリングし、行間の注釈を付与し、発見された問題の重大度に応じて色分けを行い、概念を効果的に伝えるために必要な他の要素もすべて含めてください。
以下に使用します:
- PR の作成
- PR のレビュー
- コード内のトピックの理解*
デザインとプロトタイプ
Claude Design は HTML に基づいています。なぜなら、HTML はデザインにおいて非常に表現力に富んでいるからです。最終的な出力が HTML でなくても構いません。Claude は HTML でデザインのスケッチを描き、その後、React や Swift などお好みの言語で記述することができます。
また、アニメーションやアクションなどのインタラクションのプロトタイプ作成も可能です。スライダーやノブなどを Claude に作成させ、探しているものを正確に調整できるようにしましょう。

プロンプトの例:
新しいチェックアウトボタンをプロトタイプ化したいです。クリックすると再生アニメーションが走り、すぐに紫色に変わるものです。このアニメーションで異なるオプションを試せるよう、HTML ファイルに複数のスライダーとオプションを作成してください。また、うまくいったパラメータをコピーできるコピーボタンも付けてください。
こんな用途に最適:
- デザインシステムのアーティファクト作成
- コンポーネントの調整
- コンポーネントライブラリの可視化
- アニメーションのプロトタイピング
レポート、調査、学習
Claude Code は、複数のデータソースからの情報を統合し、読みやすいレポートに変換する際に非常に効果的です。Slack やコードベース、Git の履歴、あるいはインターネットを検索して、読みやすいレポートを生成するように Claude に指示することができます。
これは長い HTML ドキュメントの形式や、インタラクティブな解説資料、さらにはスライド/プレゼンテーションの形式で構成することも可能です。図解には SVG を使用して視覚化を支援するよう Claude に依頼しましょう。

例の プロンプト:
*レートリミッターが実際にどのように動作しているのか理解できません。関連するコードを読み込み、トークンバケットフローの図、注釈付きの主要な 3〜4 のコードスニペット、そして下部に「注意点」セクションを含む単一の HTML 解説ページを作成してください。一度読むだけで理解できる人に最適化してください。
以下のような用途で利用できます:
- 機能の要約作成
- 解説ページの生成
- 週次ステータスレポートの下書き作成
- インシデントレポートの作成
- SVG イラスト、フローチャート、技術図面の生成
カスタム編集インターフェース
テキストボックスに記述するだけでは、何を求めているかを正確に表現するのが難しい場合があります。このユースケースでは、私はしばしば Claude に、私が取り組んでいるものそのもの専用の使い捨てエディタを作成させることがあります。製品や再利用可能なツールではなく、特定のデータ項目 1 つのために特別に設計された単一の HTML ファイルです。
常に重要なのは、最後にエクスポート機能を含めることです。「JSON としてコピー」または「プロンプトとしてコピー」というボタンを用意し、UI 上で行った操作をすべて、Claude Code に貼り付けたりファイルにコミットしたりできる形式に変換します。あなたはプロセスの中心に留まりながら、ループがはるかに短縮されます。

例のプロンプト:
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
- これらの Linear チケット 30 件を優先順位付けし直してください。各チケットをドラッグ可能なカードとして「Now」「Next」「Later」「Cut」の列に配置できる HTML ファイルを作成してください。私の最善の推測に基づいて事前にソートしてください。最終的な順序と、各バケットに対する 1 行の理由をエクスポートする「コピー as Markdown」ボタンも追加してください。
- これが機能フラグの設定ファイルです。これ用のフォームベースのエディタを構築し、フラグを領域ごとにグループ化し、相互依存関係を表示してください。前提条件がオフになっている状態でフラグを有効にしようとした場合は警告を出してください。変更されたキーのみを出力する「コピー diff」ボタンも追加してください。
- このシステムプロンプトを調整しています。左右分割エディタを作成してください:左側には変数スロットをハイライト表示した編集可能なプロンプト、右側には埋め込まれたテンプレートがリアルタイムで再描画される 3 つのサンプル入力を用意してください。文字数/トークン数のカウンターとコピーボタンも追加してください。
これに使用:
- チケット、テストケース、フィードバックなどの並び替え、選別、またはバケット分け
- 構造化された設定(機能フラグ、環境変数、制約付きの JSON/YAML)の編集
- ライブプレビュー付きのプロンプト、テンプレート、コピーライティングの調整
- データセットのカレーション — 行の承認/却下、例へのタグ付け、選択結果のエクスポート
- ドキュメント、トランスクリプト、差分(diff)への注釈付けと注釈のエクスポート
- テキストで表現するのが難しい値の選定:色、イージングカーブ、切り抜き領域、cron スケジュール、正規表現
よくある質問
HTML を Claude Code と併用することについて最もよく寄せられる質問と、私が実際に身につけた日常的な習慣を以下にまとめます:
効率が落ちるのではないでしょうか?
Markdown はしばしばトークン数を削減しますが、HTML の持つ表現力の豊かさと、私がそれを読み取る可能性がはるかに高いという事実から、全体的により良い出力が得られると実感しています。Opus 4.7 の 1MM コンテキストウィンドウでは、トークン使用量の増加がコンテキストウィンドウ上で目立つことはほとんどありません。
現在、Markdown を使うのはどのような時ですか?
正直なところ、私はほぼすべての用途で Markdown を完全にやめました。おそらく私は HTML マキシマリストの極端な側にいるのでしょう。
これが計画策定の置き換え方法なのでしょうか?
私は単一の計画を持つのではなく、計画の異なる部分や段階ごとにいくつかの異なる HTML ファイルを作成する傾向があることに気づきました。例えば、実装計画を HTML で作成し、UI の探索のための別のファイルを作り、最後にすべてのデザインをリストした HTML コンポーネントを作成します。これらのファイルは将来のリファレンスとして、また検証のために使用するために、私は常に手元に置いておきます。
Claude との連携を維持する
上記すべてが示すのは、Markdown ではなく HTML を使用する本当の理由は、それが私に Claude との連携感をより強く持たせてくれるからです。Claude が担う役割が増えるにつれ、計画をあまり詳しく読んでいないことに気づき、その選択を手放しにするのではなく、関与し続ける方法が必要でした。HTML はまさにそれを実現するものでした。今では、以前よりもはるかに Claude との連携感を持っています。
Claude Code で始めましょう。
*この記事は、技術スタッフの Thariq Shihipar によって執筆され、Claude Code と HTML ファイルの使用に対する彼の個人的な意見および愛着を反映しています*。
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等)は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
原文を表示
Why use HTML?
A few things make HTML a better fit than Markdown for the kind of work I'm now doing with Claude Code, including tasks that require or entail:
Information density

HTML can convey much richer information compared to Markdown. It can, of course, do simple document structure like headers and formatting, but it can also represent all sorts of other information such as:
- Tabular data using tables
- Design data with CSS
- Illustrations with SVG
- Code snippets with script tags
- Interactions using HTML elements with javascript + CSS
- Workflows using SVG and HTML
- Spatial data using absolute positions and canvases
- Images using image tags
In my opinion, there is almost no set of information that Claude can read that you cannot efficiently represent with HTML. This makes it a highly efficient way for the model to communicate in-depth information to you and for you to review it.
I’ve found that in the absence of being able to do this, the model may do more inefficient things in Markdown, like ASCII diagrams or, my favorite, estimating colors with unicode characters.

Visual clarity and ease of reading

As Claude is capable of tackling more complex work, it's also able to write larger and larger specs and plans. I’ve found that I tend to not actually read more than a 100-line Markdown file, and I certainly am not able to get anyone else in my organization to read it.
But HTML documents are much easier to read because Claude can organize the structure visually to be ideal to navigate with tabs, illustrations, and links. It can even be mobile responsive so you can read it differently based on your form factor.
Ease of sharing
Markdown files are fairly hard to share since most browsers do not render them natively well. You often have to add them as attachments to emails or messages.
As long as you upload the HTML file, you can share the link easily. Your colleagues can open it wherever they wish and easily reference it.
The chance of someone actually reading your spec, report, or PR writeup is much higher if it’s in HTML.
Two-way interactions

HTML can also allow you to interact with the document; for example, you might want to ask it to add sliders or knobs to adjust a design or allow you to tweak different options in the algorithm to see what happens. You can also ask it to let you copy these changes into a prompt to paste back into Claude Code.
When useful, this can allow you to create individual editing environments for the specific problem you’re working on.
Data ingestion
One of the biggest reasons to use Claude Code to make HTML files instead of Claude.ai or Claude Design is all of the context Claude Code can ingest. For example, when writing this article, I asked Claude Code to read through my code folder and find all the HTML files I've generated, group and categorize them, and then make an HTML file with diagrams representing each type. The diagrams you see in this article are a direct result of that.
Besides the file system, Claude Code can find additional context using your MCPs (like Slack, Linear, etc.), your web browser (with Claude in Chrome), and your git history.
Getting started
One thing worth noting: you don't need to do much to get Claude to generate HTML like this. You can simply prompt it to "*make an HTML file*" or "*make an HTML artifact*." The main thing is knowing what you want the artifact to do and how you might use it. Over time, it may make sense to build a skill around recurring patterns, but starting by prompting from scratch is a good way to get a feel for how it works across different use cases.
Use cases
To make this approach more concrete, below are some example use cases where I think using HTML files make more sense than Markdown. You can also follow along with a GitHub gallery of these use cases, here.
Specs, planning, and exploration
HTML is a rich canvas for Claude to dive into a problem. When I start working on a problem instead of a simple Markdown plan I expect to make a web of HTML files. For example, I might start with asking Claude Code to brainstorm and create some explorations of different options. I would then ask it to expand more into one, maybe make mockups or examples of the type interfaces. Finally, when I feel good I’ll ask it to write an implementation plan. When I’m happy with the plan I’ll create a new session and pass in all of these files for it to implement.
When verifying I’ll also ask the verification agent to read in the files and it will have much broader context on what is needed.

Example prompts:
- I'm not sure what direction to take the onboarding screen. Generate 6 distinctly different approaches—vary layout, tone, and density—and lay them out as a single HTML file in a grid so I can compare them side by side. Label each with the tradeoff it's making.
- Create a thorough implementation plan in a HTML file, be sure to make some mockups, show data flow and add important code snippets I might want to review. Make it easy to read and digest.
Use this for:
- Exploring other ways to implement something in code
- Experimenting with multiple visual designs at once
Code review and understanding
Code can be difficult to read in a Markdown file, but with HTML, we can render diffs, annotations, flowcharts, and modules. Use HTML to understand code that the agent has written, to review code, or to explain a PR to someone reviewing your code.

Example prompt:
*Help me review this PR by creating an HTML artifact that describes it. I'm not very familiar with the streaming/backpressure logic, so focus on that. Render the actual diff with inline margin annotations, color-code findings by severity and whatever else might be needed to convey the concept well.*
Use this for:
- Creating a PR
- Reviewing a PR
- Understanding a topic in code
Design and prototypes
Claude Design is based on HTML because HTML is incredibly expressive at design, even if your end surface is not HTML. Claude can sketch out a design in HTML and then write it in your language of choice, be it React, Swift, etc.
You can also prototype interactions, such as animations, actions, etc. Consider asking Claude to make sliders, knobs, etc. to tune in exactly what you’re looking for.

Example prompt:
I want to prototype a new checkout button, when clicked it does a play animation and then turns purple quickly. Create a HTML file with several sliders and options for me to try different options on this animation, give me a copy button to copy the parameters that worked well.
Use this for:
- Creating design system artifacts
- Adjusting components
- Visualizing component libraries
- Prototyping animations
Reports, research, and learning
Claude Code is very effective at synthesizing information across multiple data sources and converting it into a report for readability. You can prompt Claude to search your Slack, your codebase, git history, or the internet and use it to generate easy to read reports..
You could assemble this in the form of a long HTML document, an interactive explainer or even a slideshow/deck. Ask Claude to use SVG for diagrams to help visualize it.

Example prompt:
*I don't understand how our rate limiter actually works. Read the relevant code and produce a single HTML explainer page: a diagram of the token-bucket flow, the 3–4 key code snippets annotated, and a "gotchas" section at the bottom. Optimize it for someone reading it once.*
Use this for:
- Writing feature summarizations
- Generating explainers
- Drafting weekly status reports
- Creating incident reports
- Producing SVG illustrations, flowcharts, and technical diagrams,
Custom editing interfaces
Sometimes it’s hard to describe what you want purely in a text box. For this use case, I'll often ask Claude to build me a throwaway editor for the exact thing I'm working on: not a product, or a reusable tool, but a single HTML file, purpose-built for this one piece of data.
The trick is always to end with an export: a "copy as JSON" or "copy as prompt" button that turns whatever I did in the UI back into something I can paste into Claude Code or commit to a file. You stay in the loop, but the loop gets much tighter.

Example prompts:
- I need to reprioritize these 30 Linear tickets. Make me an HTML file with each ticket as a draggable card across Now / Next / Later / Cut columns. Pre-sort them by your best guess. Add a "copy as Markdown" button that exports the final ordering with a one-line rationale per bucket.
- Here's our feature flag config. Build a form-based editor for it, group flags by area, show dependencies between them, warn me if I enable a flag whose prerequisite is off. Add a "copy diff" button that gives me just the changed keys.
- I'm tuning this system prompt. Make a side-by-side editor: editable prompt on the left with the variable slots highlighted, three sample inputs on the right that re-render the filled template live. Add a character/token counter and a copy button.
Use this for:
- Reordering, triaging, or bucketing anything (tickets, test cases, feedback)
- Editing structured config (feature flags, env vars, JSON/YAML with constraints)
- Tuning prompts, templates, or copy with live preview
- Curating datasets — approve/reject rows, tag examples, export the selection
- Annotating a document, transcript, or diff and exporting the annotations
- Picking values that are painful to express in text: colors, easing curves, crop regions, cron schedules, regexes
Frequently asked questions
These are the questions I get asked most often about using HTML with Claude Code, paired with the practical, day-to-day habits I've landed on:
Isn’t it less efficient?
While Markdown often uses fewer tokens, I’ve found that the added expressiveness of HTML and the much higher likelihood of me reading it means I get overall better output. With the 1MM context window in Opus 4.7, the increased token usage is not really noticeable in the context window.
When do you use Markdown for now?
I have honestly stopped using Markdown altogether for almost everything, but I’m probably far on the HTML maximalist side of things.
Is this how you’ve replaced planning?
I’ve found that instead of having a single plan, I tend to have a few different HTML files for different parts/stages of the plan. For example, I may make an implementation plan in HTML and then do another file for exploration of UIs, and then finally make a HTML component that lists every design. I tend to keep these files around as references for the future, as well for use in verification.
Staying in the loop with Claude
All of the above is to say that the real reason I use HTML instead of Markdown is that it helps me feel much more in the loop with Claude. As Claude takes on more, I'd noticed I was reading plans less closely, and I wanted a way to stay engaged with its choices rather than just hand them off. HTML turned out to be exactly that. I feel more in the loop now than I ever did before."
Get started with Claude Code.
*This article was written by Thariq Shihipar, member of technical staff, and expresses his personal opinions – and affinity – for using HTML files with Claude Code*.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み