$ErrorActionPreference = 'Continue' $root = 'c:\DEV\MasterArbeit\QuellCode\CentronERP' $lauf = (Get-Content 'c:\DEV\MasterArbeit\Versuche\Versuch_02\_aktueller_lauf.txt' -Raw).Trim() $agents = (Get-Content 'c:\DEV\MasterArbeit\Versuche\Versuch_02\03_Agents.json' -Raw) $claude = Get-ChildItem "$env:USERPROFILE\.vscode\extensions\anthropic.claude-code-*-win32-x64\resources\native-binary\claude.exe" | Sort-Object FullName | Select-Object -Last 1 -ExpandProperty FullName $denyBash = @( 'Bash(rm:*)','Bash(rmdir:*)','Bash(mv:*)','Bash(cp:*)','Bash(dd:*)', 'Bash(truncate:*)','Bash(chmod:*)','Bash(chown:*)','Bash(ln:*)','Bash(tee:*)', 'Bash(sed -i:*)','Bash(git checkout:*)','Bash(git restore:*)','Bash(git clean:*)', 'Bash(git reset:*)','Bash(git add:*)','Bash(git commit:*)','Bash(git push:*)', 'Bash(dotnet:*)','Bash(msbuild:*)','Bash(npm install:*)','Bash(nuget:*)' ) $denyPs = @( 'PowerShell(Remove-Item:*)','PowerShell(Move-Item:*)','PowerShell(Copy-Item:*)', 'PowerShell(New-Item:*)','PowerShell(Set-Content:*)','PowerShell(Add-Content:*)', 'PowerShell(Clear-Content:*)','PowerShell(Out-File:*)','PowerShell(Set-ItemProperty:*)', 'PowerShell(dotnet:*)','PowerShell(msbuild:*)' ) # Modus custom: KEIN --safe-mode (es deaktiviert die Agentenrollen). Ersatz nach Skill 7.0.0: $denyCustom = @('Skill','WebSearch','WebFetch','SlashCommand') $env:CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS = '0' Set-Content -Path "$lauf\_meta\startzeit.txt" -Value (Get-Date -Format o) Set-Location $root Get-Content "$lauf\_meta\combined_prompt.md" -Raw | & $claude -p ` --output-format json ` --strict-mcp-config ` --permission-mode acceptEdits ` --allowedTools "Bash" "PowerShell" ` --disallowedTools @($denyBash + $denyPs + $denyCustom) ` --model claude-opus-5 ` --effort medium ` --agents $agents ` --add-dir "$lauf" ` 2> "$lauf\Stderr.log" | Set-Content "$lauf\RawResult.json" Set-Content -Path "$lauf\_meta\endzeit.txt" -Value (Get-Date -Format o) Set-Content -Path "$lauf\_meta\exitcode.txt" -Value $LASTEXITCODE