Unfold - AI Code Tutor
A VS Code extension that helps beginners read code in a guided order.
初心者がコードを読む順番で迷わないための VS Code 拡張です。
日本語 / Japanese | English
English
What Is Unfold?
Unfold is a VS Code extension for understanding unfamiliar code step by step.
Instead of dumping a full explanation at once, it guides you through the code in a reading order such as:
Overview -> Current block -> Related reading -> Internal steps
The goal of this version is simple: help beginners grasp what a file does, what to read next, and how each block connects.
Quick Start
- Install Unfold from the VS Code Marketplace.
- Open Settings and choose your provider (
Gemini, OpenRouter, or Ollama).
- Set your API key, or configure Ollama if you use a local model.
- Open a code file and run
Start Explanation.
- Start from the reading guide, then open a block to read it step by step.
For a screenshot-based setup guide, see the Quick Start page.
Who this is for
- Programming beginners who do not know how to start reading code
- Developers trying to understand unfamiliar codebases
- People who want to understand AI-generated code instead of just using it
- Learners who prefer guided, step-by-step reading over long one-shot explanations
Not designed for
- Full-repository code search or large-scale architectural analysis
- Autonomous code generation or agent-style implementation work
- Team documentation or knowledge management for entire projects
Current Features
1. Overview and reading order
- Generates an overview of the selected file or range.
- Shows a "Where to Start" guide so the user can begin from the right block.
- Keeps the top screen focused on choosing where to read first.

2. Block detail screen
- Explains the current block in plain language.
- Keeps the current explanation as the main content, with drill-down and support tools placed below it.
- Shows why the block matters now.
- Includes related blocks to read next.
- Lets the user drill down into internal steps when the block is complex.

3. Code highlighting and sync
- Highlights the target code range in the editor.
- Keeps the explanation panel and code location aligned while reading.
The main experience in this version is the reading guide, the current block explanation, step-by-step detail reading, and code highlighting. The following tools are optional support features.
- Function reference info
- Context-aware Q&A for the current block
- A small comprehension quiz for the current block (shown on the block detail screen only)
- An all-blocks list you can open when you want to look across the whole file
Supported Providers
In the current version, the settings screen lets you choose:
Unfold uses your own API key or your own local Ollama setup.
Provider and API note
Unfold uses the provider you configure (Gemini, OpenRouter, or Ollama).
If you use a cloud provider, you need to prepare your own API key.
If you use Ollama locally, make sure your local environment is running correctly.
Setup
- Open the
Unfold view from the VS Code Activity Bar.
- Open the
Settings view.
- Choose one provider:
Gemini, OpenRouter, or Ollama.
- Enter the required API key or local URL/model.
- Set the UI/output language if needed.
- Save.

For a screenshot-based setup guide, see the Quick Start page.
How To Use
- Open a code file in the editor.
- Run
Start Explanation from the Unfold sidebar.
- Read the overview.
- Start from the recommended block.
- Use related reading or drill-down when you want to open a block into smaller internal steps.
- Use Q&A or the quiz as optional support tools.

Requirements
- Visual Studio Code
1.107.0 or later
- One of:
- a configured
Gemini API key
- a configured
OpenRouter API key
- a local
Ollama environment
Currently Tested Languages
Unfold is currently tested mainly with Unity C# code.
Light verification has also been done with:
Other languages may still work depending on structure, but they are not the main verified targets in this version.
Tested IDE Environment
Unfold is currently tested mainly on VS Code.
Some features, especially block splitting, rely on symbol information provided by the editor. Because of that, behavior may differ in some VS Code fork IDEs.
We have confirmed this issue at least on Antigravity, where block splitting may not work as expected.
Notes
- The current version focuses on the sidebar reading experience.
- UI language can be switched between
Japanese and English, and generated output follows the configured language.
- Quiz is available on the block detail screen only.
- The quiz is intentionally lightweight: 1 to 2 multiple-choice questions, no score history.
FAQ
Q. Do I need an API key?
A. Yes, if you use Gemini or OpenRouter. If you use Ollama locally, you do not need a cloud API key, but you do need a working local Ollama setup.
Q. Can I use Ollama locally?
A. Yes. Unfold supports Ollama as one of its providers. Make sure Ollama is running and your model/settings are configured correctly.
Q. Nothing happens when I run Start Explanation.
A. First check your provider, API key, model name, and Ollama settings. Then try selecting a smaller unit such as a single function.
Q. What should I select first?
A. Start with a single function or one class. Smaller selections usually produce a clearer first experience.
Q. Is this a code generation tool?
A. No. Unfold is designed to help you read and understand code in a guided order.
Japanese (日本語)
Unfold とは?
Unfold は、見慣れないコードを段階的に理解するための VS Code 拡張です。
いきなり全部を説明するのではなく、次のような順序で読めるようにします。
全体像 -> 今読んでいるブロック -> 関連して読む -> 内部ステップ
このバージョンの目的はシンプルで、初心者が
- このファイルは何をしているか
- 次にどこを読むべきか
- 各ブロックがどうつながっているか
を迷わず追えるようにすることです。
3分で試す
- VS Code Marketplace から Unfold をインストールします。
- 設定画面で利用するプロバイダー(
Gemini / OpenRouter / Ollama)を選びます。
- APIキーを設定するか、ローカル利用の場合は Ollama を設定します。
- コードファイルを開き、
解説を開始する を実行します。
- まず「読み始めガイド」から読み、気になるブロックを開いて順に理解します。
スクリーンショット付きの導入手順は Quick Start ページ を参照してください。
このツールが向いている人
- コードをどこから読めばよいか分からないプログラミング初心者
- 初めて触るコードを順序立てて理解したい人
- AIが生成したコードを「使うだけ」でなく理解したい人
- 一気に長文説明されるより、段階的に読み進めたい学習者
このツールが主目的としていないこと
- リポジトリ全体を横断する大規模なコード検索や設計解析
- 自動実装やエージェント型のコード生成作業
- チーム全体向けのナレッジ管理やドキュメント基盤
現在の主な機能
1. 読み始めガイド
- 選択したファイルや範囲の概要を生成します。
読み始めガイド で最初に読むべきブロックを案内します。
- トップ画面は「どこから読むかを決める」ことに集中した UI です。

2. ブロック詳細画面
- 今見ているブロックを自然な言葉で解説します。
- ブロック詳細画面では、まず「現在の解説」を主役にし、その下にドリルダウンや補助機能を配置します。
- なぜ今このブロックを読むのかを表示します。
関連して読む で次に読む候補を出します。
- 複雑なブロックは、内部ステップに分けて順番に読めます。

3. コードのハイライトと位置同期
- 解説対象のコード範囲をエディタ上でハイライトします。
- 解説パネルとコード位置を同期しながら読めます。
4. 補助ツール
このバージョンの主役は、読み始めガイド・現在の解説・内部ステップへ分けて読む機能・コードのハイライトです。以下は理解を補助するための機能です。
- 関数の参照情報
- 現在のブロックに文脈を合わせた Q&A
- 現在のブロック向けの軽い理解チェッククイズ(ブロック詳細画面のみ)
- 必要なときに開いて、ファイル全体をたどれる全体ブロック一覧
対応プロバイダー
現在のバージョンの設定画面では、次の 3 つのプロバイダーを選べます。
API キーやローカルの Ollama 環境は、ユーザー自身で用意します。
プロバイダーとAPIについて
Unfold は、ユーザーが設定したプロバイダー(Gemini / OpenRouter / Ollama)を利用します。
クラウド系プロバイダーを使う場合は、ユーザー自身でAPIキーを用意する必要があります。
Ollama を使う場合は、ローカル環境が正しく起動していることを確認してください。
初期セットアップ
- VS Code のアクティビティバーから
Unfold を開きます。
Settings ビューを開きます。
Gemini、OpenRouter、Ollama のいずれかを選びます。
- API キー、またはローカル URL / model を設定します。
- 必要なら UI・出力言語を設定します。
- 保存します。

スクリーンショット付きの導入手順は Quick Start ページ を参照してください。
使い方
- エディタでファイルを開きます。
- Unfoldのサイドバーから
解説を開始する を実行します。
- まず全体像を読みます。
- 読み始めガイドで案内されたブロックから読み始めます。
- 必要に応じて
関連して読む や、ブロックを内部ステップに分けて読む機能を使います。
- 補助的に Q&A や理解チェックを使います。

動作要件
- Visual Studio Code
1.107.0 以上
- 次のいずれか
Gemini の API キー
OpenRouter の API キー
- ローカルの
Ollama 実行環境
現在の検証言語
Unfold は、現時点では主に Unity の C# コードで動作確認を行っています。
軽い動作検証を行った言語:
それ以外の言語でも動く場合がありますが、このバージョンでの主な検証対象ではありません。
検証済みIDE環境
Unfold は、現時点では主に VS Code 本体で動作確認を行っています。
特にブロック分割は、エディタが提供するシンボル情報に依存する部分があるため、一部の VS Code フォークIDEでは挙動が異なる可能性があります。
少なくとも Antigravity では、この影響によりブロック分割が期待どおりに動かない場合があることを確認しています。
補足
- 現在のバージョンはサイドバーでの読解体験に集中しています。
- UI 言語は
Japanese と English を切り替えでき、生成される解説も設定言語に合わせます。
- クイズはブロック詳細画面でのみ表示されます。
- クイズは 1〜2 問の4択で、履歴保存やスコア管理はありません。
よくある質問
Q. APIキーは必要ですか?
A. Gemini または OpenRouter を使う場合は必要です。Ollama をローカルで使う場合はクラウドAPIキーは不要ですが、ローカルの Ollama 環境が正しく動いている必要があります。
Q. Ollama をローカルで使えますか?
A. はい。Unfold はプロバイダーの1つとして Ollama に対応しています。Ollama が起動しており、モデルや設定が正しいことを確認してください。
Q. 解説を開始する を実行しても何も起きません。
A. まずプロバイダー設定、APIキー、モデル名、Ollama設定を確認してください。そのうえで、最初は関数1つなど小さい単位で試してください。
Q. 最初はどの範囲を選択すればよいですか?
A. まずは関数1つ、またはクラス1つから始めるのがおすすめです。小さい単位の方が最初の体験が安定します。
Q. これはコード生成ツールですか?
A. いいえ。Unfold はコードを順序立てて読み、理解するためのツールです。