node -e "let b='';process.stdin.on('data',c=>b+=c);process.stdin.on('end',()=>{const fs=require('fs');let d={};try{d=JSON.parse(b);}catch(e){}const sid=d.session_id||'default';const tmp=(process.env.TEMP||'C:/Users/29711/AppData/Local/Temp').replace(/\\\\/g,'/');const f=tmp+'/claude-loop-'+sid+'.json';let s={count:0,last_sig:'',repeat:0};try{s=JSON.parse(fs.readFileSync(f,'utf8'));}catch(e){}const sig=(d.tool_name||'')+'|'+(d.tool_input?JSON.stringify(d.tool_input):'');if(sig===s.last_sig){s.repeat++;}else{s.repeat=1;s.last_sig=sig;}s.count++;fs.writeFileSync(f,JSON.stringify(s));if(s.count>25){console.log(JSON.stringify({continue:false,stopReason:'已达到 Agentic Loop 上限(25次工具调用),请重新提问'}));}else if(s.repeat>=5){console.log(JSON.stringify({continue:false,stopReason:'检测到重复调用(连续'+s.repeat+'次相同命令),已自动停止,请调整思路后重新提问'}));}});"