Windows 11 support: changes needed for all agent files
メンテナーはふだん 15 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- powershell, python
- 領域
- cli, devtools, operating-systems
調査の方向性
agents/s01 から s12 および s_full の run_bash() 関数と SYSTEM 文字列から始め、次に .env.example と必須の MODEL_ID 設定を確認します。PowerShell を使用して Windows 11 のセットアップを検証し、.env の命名、PowerShell コマンドの実行、危険なコマンドのブロック、すべてのエージェントファイルにおける Windows 対応のプロンプトを含めて確認します。
索引モデルが issue の本文から書いたものです。
説明
Resolved problem to use on Windows computer.
My guide covers all changes required to run the full learn-claude-code agent series
(s01 – s12 + s_full) on Windows 11 with the Anthropic API.
The original repo targets Linux/macOS. Four categories of changes are needed on Windows:
1. .env file — correct naming (Windows hides extensions by default)
2. Environment vars — MODEL_ID must be set
3. bash tool — all 12 agent files use subprocess; must point to PowerShell
4. System prompt — Claude must know it is on Windows to write correct shell commands
Prerequisites
- Python 3.10 or later
pip install -r requirements.txt- An Anthropic API key — get one at https://console.anthropic.com
Step 1 — Create the .env file
⚠️ Windows hides file extensions by default.
If you rename.env.examplein File Explorer it may silently becomeenv.txtinstead of.env.
The agent will fail withKeyError: 'MODEL_ID'if the file is named incorrectly.
Recommended: use PowerShell to copy and verify:
Copy-Item .env.example .env
Get-ChildItem -Name # confirm the file is named exactly .env (not env.txt)
If you see env.txt, rename it:
Rename-Item env.txt .env
To show extensions permanently in File Explorer:
View → Show → File name extensions ✓
Step 2 — Edit .env
Open .env and set these two required variables:
ANTHROPIC_API_KEY=sk-ant-your-real-key-here
MODEL_ID=claude-haiku-4-5
Available models (choose one):
| Model | Speed | Cost | Good for |
|---|---|---|---|
claude-haiku-4-5 |
Fastest | Lowest | Learning, testing all sessions |
claude-sonnet-4-5 |
Balanced | Medium | Recommended for real tasks |
claude-opus-4-5 |
Slowest | Highest | Most capable, complex sessions |
No other changes to .env are needed for the Anthropic API.
Step 3 — Change run_bash() in all agent files
This is the most important Windows change. Every agent file in agents/ contains a
run_bash() function that calls a shell via subprocess. The original code uses
["bash", "-c", command] which does not exist on Windows.
Replace the function in each of the 12 agent files (s01 through s12 and s_full):
Original code (Linux/macOS):
def run_bash(command: str) -> str:
dangerous = ["rm -rf /", "sudo", "shutdown", "reboot", "> /dev/"]
if any(d in command for d in dangerous):
return "Error: Dangerous command blocked"
try:
r = subprocess.run(command, shell=True, cwd=os.getcwd(),
capture_output=True, text=True, timeout=120)
out = (r.stdout + r.stderr).strip()
return out[:50000] if out else "(no output)"
except subprocess.TimeoutExpired:
return "Error: Timeout (120s)"
Replace with (Windows 11):
def run_bash(command: str) -> str:
dangerous = [
"rm -rf /", "sudo", "shutdown", "reboot", "> /dev/", # Linux patterns
"Format-Volume", "Remove-Item -Recurse C:\\", # Windows patterns
"del /f /s /q C:\\",
]
if any(d in command for d in dangerous):
return "Error: Dangerous command blocked"
try:
r = subprocess.run(
["powershell", "-NoProfile", "-Command", command],
cwd=os.getcwd(),
capture_output=True, text=True, timeout=120,
)
out = (r.stdout + r.stderr).strip()
return out[:50000] if out else "(no output)"
except subprocess.TimeoutExpired:
return "Error: Timeout (120s)"
Key differences:
["powershell", "-NoProfile", "-Command", command]replaces["bash", "-c", command]
(or theshell=Trueshorthand)-NoProfilemakes startup faster by skipping user profile scripts- Added Windows-specific dangerous command patterns
Step 4 — Update the system prompt in all agent files
Each agent file contains a SYSTEM string near the top. Without telling Claude it is on
Windows, it will write Linux commands (ls, cat, grep, mkdir -p, etc.) that fail
under PowerShell.
Find (varies slightly per file):
SYSTEM = """You are a helpful assistant with access to a bash tool.
..."""
Add one line at the top of the system prompt:
SYSTEM = """You are a helpful assistant with access to a bash tool.
You are running on Windows 11. Use PowerShell syntax for all shell commands.
Use Get-ChildItem instead of ls, Copy-Item instead of cp, Remove-Item instead of rm,
New-Item -ItemType Directory instead of mkdir, Get-Content instead of cat, and so on.
..."""
This single addition prevents the majority of Windows-related tool failures across all
sessions.
- 主要言語
- Python
- スター
- 79.5k
- フォーク
- 12.7k
- 平均マージ
- 11日 19時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
shareAI-lab/learn-claude-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
shareAI-lab/learn-claude-code#583 ·
メンテナーはふだん 15 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
shareAI-lab/learn-claude-code#528 ·
メンテナーはふだん 15 日以内に返信
-
s17: IDLE teammates cannot resume their own in-progress tasks対応中かも @hichipli が 60 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
shareAI-lab/learn-claude-code#519 ·
メンテナーはふだん 15 日以内に返信
-
s09: select_relevant_memories 的 "recent" 拼接顺序与切片不合理,不是真正的最近 2k 上下文対応中かも @siri666942 が 77 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
shareAI-lab/learn-claude-code#517 ·
メンテナーはふだん 15 日以内に返信
-
plan_approval_response 不会唤醒 idle teammate再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
shareAI-lab/learn-claude-code#455 ·
メンテナーはふだん 15 日以内に返信
shareAI-lab/learn-claude-code の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4860 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
:bug: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
scikit-image/scikit-image#8377 ·
メンテナーはふだん 1 日以内に返信
-
Ingredient import validation accepts negative nutrient values and NaN対応中かも @LukeSekai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
wger-project/wger#2564 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/ponymail-foal#351 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 4 日以内に返信