[BUG] STACK DUMP
Resolved 💬 4 comments Opened May 6, 2026 by rsitdev Closed May 6, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When attempting bash test of generated python script i get the below stack dump.
What Should Happen?
The python script should execute and bugs identified, iterated and fixed
Error Messages/Logs
0){if(gA6($H.backgroundTaskId,$H,$))PO($H.backgroundTaskId,zcH($H),{toolUseId:Y,summary:D||w});let
e={...$H,backgroundTaskId:void 0},{taskOutput:DH}=u;if(DH.stdoutToFile&&!DH.outputFileRedundant)e.outputFilePa
th=DH.path,e.outputFileSize=DH.outputFileSize,e.outputTaskId=DH.taskId;return e}return
$H}if(v)return{stdout:T?J:"",stderr:"",code:0,interrupted:!1,backgroundTaskId:v,assistantAutoBackgrounded:N};i
f(q.signal.aborted&&q.signal.reason==="interrupt"&&!T){if(T=!0,!fcH){p("tengu_powershell_command_interrupt_bac
kgrounded");continue}u.kill()}if(Q){if(u.status==="backgrounded")return{stdout:"",stderr:"",code:0,interrupted
:!1,backgroundTaskId:Q,backgroundedByUser:!0}}let t=Date.now()-F,r=Math.floor(t/1000);if(!fcH&&v===void
0&&r>=IU7/1000){if(!Q)Q=UA6({command:w,description:D||w,shellCommand:u,agentId:M},$,Y);if(_?.({jsx:EGq.createE
lement(_MH,null),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0}),Y)A?.({kind:"background_
hint",toolUseId:Y})}yield{type:"progress",fullOutput:J,output:Z,elapsedTimeSeconds:r,totalLines:L,totalBytes:G
,taskId:u.taskOutput.taskId,...j?{timeoutMs:X}:void 0},g=Date.now()+qQ9}}finally{if(FM.stopPolling(u.taskOutpu
t.taskId),!v&&u.status!=="backgrounded"){if(Q)QA6(Q,c?zcH(c):"stopped",$);u.cleanup()}}}var YOH,EGq,RU7=`
4902 `,sg9,tg9,eg9,IU7=2000,qQ9=1000,$Q9=15000,KQ9,CU7="Enterprise policy requires sandboxing, but sandboxing is
: not available on native Windows. Shell command execution is blocked on this platform by
policy.",fcH,xU7,AQ9,fQ9,zQ9,XTH;var nVH=V(()=>{rq();j8();V8();JK();At();YA8();n8();R8();W$();l8();Bh();TK();N
A6();Zv();g5();S2();OMH();tM8();pMH();uA();$j();tQH();DLH();m0();cVH();dM8();n46();Ya();eBH();xB7();GU7();TU7(
);qcH();SU7();YOH=require("fs/promises"),EGq=m(WH(),1),sg9=new
Set(["select-string","get-childitem","findstr","where.exe"]),tg9=new
Set(["get-content","get-item","test-path","resolve-path","get-process","get-service","get-childitem","get-loca
tion","get-filehash","get-acl","format-hex"]),eg9=new
Set(["write-output","write-host"]);KQ9=["start-sleep","sleep"];fcH=yH(process.env.CLAUDE_CODE_DISABLE_BACKGROU
ND_TASKS),xU7=xH(()=>E.strictObject({command:E.string().describe("The PowerShell command to
execute"),timeout:gI(E.number().optional()).describe(`Optional timeout in milliseconds (max
${lD8()})`),description:E.string().optional().describe("Clear, concise description of what this command does
in active voice."),run_in_background:hL(E.boolean().optional()).describe("Set to true to run this command in
the background. Use Read to read the output
later."),dangerouslyDisableSandbox:hL(E.boolean().optional()).describe("Set this to true to dangerously
override sandbox mode and run commands without sandboxing.")})),AQ9=xH(()=>fcH?xU7().omit({run_in_background:!
0}):xU7()),fQ9=xH(()=>E.object({stdout:E.string().describe("The standard output of the
command"),stderr:E.string().describe("The standard error output of the
command"),interrupted:E.boolean().describe("Whether the command was
interrupted"),returnCodeInterpretation:E.string().optional().describe("Semantic interpretation for non-error
exit codes with special meaning"),isImage:E.boolean().optional().describe("Flag to indicate if stdout contains
image data"),persistedOutputPath:E.string().optional().describe("Path to persisted full output when too large
for inline"),persistedOutputSize:E.number().optional().describe("Total output size in bytes when
persisted"),backgroundTaskId:E.string().optional().describe("ID of the background task if command is running
in background"),backgroundedByUser:E.boolean().optional().describe("True if the user manually backgrounded the
command with Ctrl+B"),assistantAutoBackgrounded:E.boolean().optional().describe("True if the command was
auto-backgrounded by the assistant-mode blocking budget")})),zQ9=["npm","yarn","pnpm","node","python","python3
","go","cargo","make","docker","terraform","webpack","vite","jest","pytest","curl","Invoke-WebRequest","build"
,"test","serve","watch","dev"];XTH=YK({name:kK,searchHint:"execute Windows PowerShell
commands",maxResultSizeChars:30000,strict:!0,async description({description:H}){return H||"Run PowerShell
command"},async prompt(){return VU7()},isConcurrencySafe(H){return
this.isReadOnly?.(H)??!1},isSearchOrReadCommand(H){if(!H.command)return{isSearch:!1,isRead:!1};return
HQ9(H.command)},isReadOnly(H){if(aB7(H.command))return!1;return
RA6(H.command)},toAutoClassifierInput(H){return H.command},get inputSchema(){return AQ9()},get
outputSchema(){return fQ9()},userFacingName(){return"PowerShell"},getToolUseSummary(H){if(!H?.command)return
null;let{command:q,description:$}=H;if($)return $;return
V7(q,jN)},getActivityDescription(H){if(!H?.command)return"Running command";return`Running
${H.description??V7(H.command,jN)}`},isEnabled(){return!0},async validateInput(H){if(bU7())return{result:!1,me
ssage:CU7,errorCode:11};if(dd()&&H4()&&!fcH&&!H.run_in_background){let
q=uU7(H.command);if(q!==null)return{result:!1,message:`Blocked: ${q}. To wait for a condition, use Monitor
with an until-loop (e.g. \`until <check>; do sleep 2; done\` \u2014 Monitor runs bash). To wait for a command
you started, use run_in_background: true. Do not chain shorter sleeps to work around this
block.`,errorCode:10}}return{result:!0}},async checkPermissions(H,q){return await
ZU7(H,q)},renderToolUseMessage:kU7,renderToolUseProgressMessage:NU7,renderToolUseQueuedMessage:EU7,renderToolR
esultMessage:hU7,renderToolUseErrorMessage:yU7,mapToolResultToToolResultBlockParam({interrupted:H,stdout:q,std
err:$,isImage:K,persistedOutputPath:_,persistedOutputSize:A,backgroundTaskId:f,backgroundedByUser:z,assistantA
utoBackgrounded:Y},M){if(K){let j=Q46(q,M);if(j)return j}let O=q;if(_){let j=q?q.replace(/^(\s*\n)+/,"").trimE
nd():"",P=AA8(j,GmH);O=NzH({filepath:_,originalSize:A??0,isJson:!1,preview:P.preview,hasMore:P.hasMore})}else
if(q)O=q.replace(/^(\s*\n)+/,""),O=O.trimEnd();let w=$.trim();if(H){if($)w+=RU7;w+="<error>Command was aborted
before completion</error>"}let D="";if(f){let j=$Y(f);if(Y)D=`Command exceeded the assistant-mode blocking
budget (${$Q9/1000}s) and was moved to the background with ID: ${f}. It is still running \u2014 you will be
notified when it completes. Output is being written to: ${j}. In assistant mode, delegate long-running work to
a subagent or use run_in_background to keep this conversation responsive.`;else if(z)D=`Command was manually
backgrounded by user with ID: ${f}. Output is being written to: ${j}`;else D=`Command running in background
with ID: ${f}. Output is being written to:
${j}`}return{tool_use_id:M,type:"tool_result",content:[O,w,D].filter(Boolean).join(`
4903 `),is_error:H}},async call(H,q,$,K,_){if(bU7())throw
: Error(CU7);let{abortController:A,setToolJSX:f,emitToolProgress:z}=q,Y=!q.agentId,M=0;try{let
O=YQ9({input:H,abortController:A,taskRegistry:q.taskRegistry,abortSpeculation:q.abortSpeculation,setToolJSX:f,
emitToolProgress:z,preventCwdChanges:!Y,isMainThread:Y,toolUseId:q.toolUseId,agentId:q.agentId,sessionEnvVars:
q.sessionEnvVars}),w;do if(w=await O.next(),!w.done&&_){let u=w.value;_({toolUseID:`ps-progress-${M++}`,data:{
type:"powershell_progress",output:u.output,fullOutput:u.fullOutput,elapsedTimeSeconds:u.elapsedTimeSeconds,tot
alLines:u.totalLines,totalBytes:u.totalBytes,timeoutMs:u.timeoutMs,taskId:u.taskId}})}while(!w.done);let
D=w.value;if(!(D.code===0&&!D.stdout&&D.stderr&&!D.backgroundTaskId))he8(H.command,D.code,D.stdout);let
P=D.interrupted&&A.signal.reason==="interrupt",W=D.interrupted&&(A.signal.reason==="interrupt"||A.signal.reaso
n==="user-cancel"),X="";if(Y){let
u=q.getAppState();if(l46(u.toolPermissionContext))X=c46("")}if(D.backgroundTaskId){let
u=zA8(D.stdout||"",H.command);if(Y&&u.hints.length>0)for(let b of
u.hints)UD8(b);return{data:{stdout:u.stripped,stderr:[D.stderr||"",X].filter(Boolean).join(`
4904 `),interrupted:!1,backgroundTaskId:D.backgroundTaskId,backgroundedByUser:D.backgroundedByUser,assistantAutoBa
: ckgrounded:D.assistantAutoBackgrounded}}}let J=new FaH,Z=(D.stdout||"").trimEnd();J.append(Z+RU7);let
L=bB7(H.command,D.code,Z,D.stderr||""),G=g46(J.toString()),v=zA8(G,H.command);if(G=v.stripped,Y&&v.hints.lengt
h>0)for(let u of v.hints)UD8(u);if(D.preSpawnError)throw Error(D.preSpawnError);if(L.isError&&!P){let
u=Z.length<=8192?Z:Z.slice(0,4096)+Z.slice(-4096);throw d("tengu_powershell_tool_command_failed",{command_type
:nD8(H.command),exit_code:D.code,stdout_length:Z.length,error_class:CB7(u),powershell_edition:await
Ow8()??"unknown"}),new Ak(G,D.stderr||"",D.code,W)}let
T=67108864,N,y;if(D.outputFilePath&&D.outputTaskId)try{let u=await YOH.stat(D.outputFilePath);y=u.size,await
bLH();let b=_A8(D.outputTaskId,!1);if(u.size>T)await YOH.truncate(D.outputFilePath,T);try{await
YOH.link(D.outputFilePath,b)}catch{await YOH.copyFile(D.outputFilePath,b)}N=b}catch{}let
R=Dw8(G),I=G;if(R){let u=await d46(G,D.outputFilePath,y,Z3(q.options.mainLoopModel));if(u)I=u;else R=!1}let
C=[D.stderr||"",X].filter(Boolean).join(`
4905 `);return d("tengu_powershell_tool_command_executed",{command_type:nD8(H.command),stdout_length:I.length,stde
: rr_length:C.length,exit_code:D.code,interrupted:D.interrupted,powershell_edition:await
Ow8()??"unknown"}),{data:{stdout:I,stderr:C,interrupted:D.interrupted,returnCodeInterpretation:L.message,isIma
ge:R,persistedOutputPath:N,persistedOutputSize:y}}}finally{if(f)f(null);if(q.toolUseId)z?.({kind:"clear",toolU
seId:q.toolUseId})}},isResultTruncated(H){return Ix(H.stdout)||Ix(H.stderr)}})});async function
bt(H,q,$,K){let _=H;if(K==="bash"&&!H4())throw Error(`Skill ${$} requires bash (\`shell: bash\` in
frontmatter) but Git Bash was not found. Install Git for Windows (https://git-scm.com/downloads/win), or
change the skill's frontmatter to \`shell: powershell\`.`);let A=K==="powershell"&&bx()?mU7():H4()?c7:mU7(),f=
H.matchAll(MQ9),z=H.includes("!`")?vr8(H).matchAll(OQ9):[];return await
Promise.all([...f,...z].map(async(Y)=>{let M=Y[1]?.trim();if(M)try{let O=await
XP(A,{command:M},q,_j({content:[]}),"");if(O.behavior!=="allow")throw h(`Shell command permission check failed
for command in ${$}: ${M}. Error: ${O.message}`),new qi(`Shell command permission check failed for pattern
"${Y[0]}": ${O.message||"Permission denied"}`);let{data:w}=await A.call({command:M},q),D=await
VmH(A,w,pU7.randomUUID()),j=typeof
D.content==="string"?D.content:BU7(w.stdout,w.stderr);_=_.replace(Y[0],()=>j)}catch(O){if(O instanceof
qi)throw O;wQ9(O,Y[0])}})),_}function BU7(H,q,$=!1){let
K=[];if(H.trim())K.push(H.trim());if(q.trim())if($)K.push(`[stderr: ${q.trim()}]`);else K.push(`[stderr]
- isSearchOrReadCommand (B:/~BUN/root/src/entrypoints/cli.js:4902:2996)
- POH (B:/~BUN/root/src/entrypoints/cli.js:4973:773)
- Uf6 (B:/~BUN/root/src/entrypoints/cli.js:4973:1333)
- Nl9 (B:/~BUN/root/src/entrypoints/cli.js:4973:2612)
- vQ7 (B:/~BUN/root/src/entrypoints/cli.js:4974:2438)
- <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:6539:14514)
- LD (B:/~BUN/root/src/entrypoints/cli.js:519:30334)
- <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:507:9164)
- j9A (B:/~BUN/root/src/entrypoints/cli.js:6539:14155)
- t5 (B:/~BUN/root/src/entrypoints/cli.js:519:21141)
Steps to Reproduce
run claude
test script.py with settings.json
The script:
import serial.tools.list_ports
import json
import os
def insert_into_settings(label, serial_num):
settings_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "settings.json")
if not os.path.isfile(settings_path):
print(f" Could not find settings.json")
return
with open(settings_path, "r") as f:
settings = json.load(f)
key = f"serial{label}"
if key in settings:
count = 2
while f"{key}_{count}" in settings:
count += 1
new_key = f"{key}_{count}"
settings[new_key] = settings[key]
print(f" -> Duplicate label '{key}' found — added '{new_key}' with serial {settings[key]}")
else:
settings[key] = serial_num
print(f" -> Inserted '{key}': '{serial_num}' into settings.json")
with open(settings_path, "w") as f:
json.dump(settings, f, indent=4)
def scrape_stlink_serials():
print("="*50)
print(" ST-Link Serial Number Scraper")
print("="*50)
ST_VID = 0x0483
STLINK_PIDS = [0x374b, 0x374d, 0x374e, 0x374f, 0x3753, 0x3754]
ports = serial.tools.list_ports.comports()
seen_serials = set()
found_count = 0
for port in ports:
if port.vid == ST_VID and port.pid in STLINK_PIDS:
serial_num = port.serial_number
if serial_num and serial_num not in seen_serials:
seen_serials.add(serial_num)
found_count += 1
print(f"\n[{found_count}] {port.description}")
print(f" Serial Number : {serial_num}")
print(f" Hardware PID : {hex(port.pid)}")
print(f" COM Port : {port.device}")
label = input(f" Enter a label for this ST-Link (or press Enter to skip): ").strip()
if label:
insert_into_settings(label, serial_num)
else:
print(f" -> Skipped")
if found_count == 0:
print("\nNo ST-Links found!")
print("Note: Cheap aluminum ST-Link V2 clones do not expose COM ports and cannot be found this way.")
else:
print(f"\nSuccessfully identified {found_count} ST-Link(s).")
print("="*50)
if __name__ == '__main__':
scrape_stlink_serials()
settings.json:
{
"security.workspace.trust.untrustedFiles": "open",
"cortex-debug.armToolchainPath": "c:\\Users\\ab\\AppData\\Roaming\\Code\\User\\globalStorage\\bmd.stm32-for-vscode\\@xpack-dev-tools\\arm-none-eabi-gcc\\14.2.1-1.1.1\\.content\\bin",
"stm32-for-vscode.armToolchainPath": "c:\\Users\\ab\\AppData\\Roaming\\Code\\User\\globalStorage\\bmd.stm32-for-vscode\\@xpack-dev-tools\\arm-none-eabi-gcc\\14.2.1-1.1.1\\.content\\bin",
"stm32-for-vscode.makeConcurrentJobs": 1,
"stm32-for-vscode.openOCDPath": "c:\\Users\\ab\\AppData\\Roaming\\Code\\User\\globalStorage\\bmd.stm32-for-vscode\\@xpack-dev-tools\\openocd\\0.12.0-6.1\\.content\\bin\\openocd.EXE",
"stm32-for-vscode.makePath": "c:\\Users\\ab\\AppData\\Roaming\\Code\\User\\globalStorage\\bmd.stm32-for-vscode\\@xpack-dev-tools\\windows-build-tools\\4.4.1-3.1\\.content\\bin\\make.EXE",
"cortex-debug.openocdPath": "c:\\Users\\ab\\AppData\\Roaming\\Code\\User\\globalStorage\\bmd.stm32-for-vscode\\@xpack-dev-tools\\openocd\\0.12.0-6.1\\.content\\bin\\openocd.EXE",
"workbench.editor.enablePreview": false,
"workbench.editor.editorActionsLocation": "titleBar",
"workbench.editor.wrapTabs": true,
"terminal.integrated.defaultProfile.windows": "Ubuntu-24.04 (WSL)",
"serialBP": "0035001F4142501020353451",
"serialFP": "0035001F4142501020353451",
"serialLhA": "0035001F4142501020353451",
"serialLhd": "0035001F4142501020353451",
"serialPE": "0035001F4142501020353451",
"serialNumber": "0035001F4142501020353451",
"serialFP": "0035001F4142501020353451",
"serialMI": "0035001F4142501020353451",
"serialSC": "0035001F4142501020353451",
"terminal.integrated.scrollback": 10000,
"zenMode.restore": false,
"zenMode.hideLineNumbers": false,
"cortex-debug.liveWatchRefreshRate": 1000,
"explorer.compactFolders": false,
"explorer.fileNesting.enabled": true,
"debug.openExplorerOnEnd": true,
"serialcirig": "003F00273133511437363734",
"cmake.environment": {
"PATH": "c:/Users/ab/.vscode/extensions/stmicroelectronics.stm32cube-ide-build-cmake-1.44.0-win32-x64/resources/cube-cmake/win32/x86_64;c:\\Users\\ab\\.vscode\\extensions\\stmicroelectronics.stm32cube-ide-core-1.2.0-win32-x64\\resources\\binaries\\win32\\x86_64;${env.PATH}"
},
"stm32cube-ide-build-cmake.ignoreCubeProjectDiscovery": true,
"debug.allowBreakpointsEverywhere": true,
"claudeCode.preferredLocation": "panel",
"editor.tokenColorCustomizations": {
"[Dark+]": {}
},
"workbench.colorTheme": "Gruvbox Dark Hard",
"window.systemColorTheme": "dark",
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"workbench.colorCustomizations": {},
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash",
"icon": "terminal-git-bash"
},
"Ubuntu-24.04 (WSL)": {
"path": "C:\\Windows\\System32\\wsl.exe",
"args": [
"-d",
"Ubuntu-24.04"
]
}
},
"terminal.integrated.cwd": "build",
"cortex-debug.openocdPath.windows": ""
}
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.131
Platform
Other
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗