開発環境
Windows 11
手順
プロジェクトの作成
この部分もClaude Codeに実行させることが可能なのでしょうが、節約のためにVisual Studioで素直にWinFormという名前のWindowsフォームアプリケーション(.NET Framework)を作りました。
このようなファイル構成になります。
WinForm
│ WinForm.slnx
└─WinForm
│ App.config
│ Form1.cs
│ Form1.Designer.cs
│ Program.cs
│ WinForm.csproj
└─Properties
AssemblyInfo.cs
Resources.Designer.cs
Resources.resx
Settings.Designer.cs
Settings.settings
Claude Codeの起動
二つ目のWinForm(WinForm.csprojが存在するフォルダ)でClaude Codeを立ち上げました。
CLAUDE.mdの作成と修正
/initを実行するとCLAUDE.mdを作成してくれます。
Buildingの部分がこのようになりましたが、このままでは動きませんので修正が必要です。
こちらを参考にさせて頂きました。
修正前
### Building ```bash # Debug build msbuild WinForm.csproj /p:Configuration=Debug # Release build msbuild WinForm.csproj /p:Configuration=Release ```
修正後
### Building ```bash # Debug build powershell.exe -Command "& 'C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe' WinForm.csproj -p:Configuration=Debug" # Release build powershell.exe -Command "& 'C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe' WinForm.csproj -p:Configuration=Release" ```
これでClaude Code内でビルドができるようになります。
Runコマンドが書かれている場合には以下のように修正するのが良いと思います。
### Run ``` powershell.exe -Command "& '.\bin\Debug\net48\WinForm.exe'" ``` ``` powershell.exe -Command "& '.\bin\Release\net48\WinForm.exe'" ```
.claude/settings.jsonの作成
{
"permissions": {
"deny": [
"Read(bin/)",
"Read(obj/)"
]
}
}