Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Windows 11 support: changes needed for all agent files

Abierto
#65 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@yee211 ya está trabajando en esto.

Desde el 8/9/2026.

  • #393 de @cuic19053-hue — cerrado sin fusionar
  • #563 de @yee211 — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
powershell, python

Línea de trabajo

Comienza con las funciones run_bash() y las cadenas SYSTEM en agents/s01 a s12 y s_full; después, revisa .env.example y la configuración MODEL_ID obligatoria. Verifica la configuración de Windows 11 con PowerShell, incluidos el nombre de .env, la ejecución de comandos de PowerShell, el bloqueo de comandos peligrosos y los prompts adaptados a Windows en cada archivo de agente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

documentation feedback

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


Step 1 — Create the .env file

⚠️ Windows hides file extensions by default.
If you rename .env.example in File Explorer it may silently become env.txt instead of .env.
The agent will fail with KeyError: '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 the shell=True shorthand)
  • -NoProfile makes 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.

Lenguaje dominante
Python
Estrellas
79k
Forks
12.6k
Merge medio
8 d 11 h
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de shareAI-lab/learn-claude-code

Todos los issues de shareAI-lab/learn-claude-code

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.