| 16667 | `))}catch(r7){return await od(N5,`Error downloading files: ${d6(r7)}`)}let VK=z4??(Array.isArray(g7)?{messages:g7,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:S4,initialState:H$,contentReplacements:void 0}:void 0);if(VK)hl8(H),Sl8(H),await PK8(N5,{getFpsMetrics:qK,stats:Xq,initialState:VK.initialState},{...Iz,mainThreadAgentDefinition:VK.restoredAgentDef??S4,initialMessages:VK.messages,initialFileHistorySnapshots:VK.fileHistorySnapshots,initialContentReplacements:VK.contentReplacements,initialAgentName:VK.agentName,initialAgentColor:VK.agentColor},fM6);else await X65(N5,{getFpsMetrics:qK,stats:Xq,initialState:H$},As(r1()),{...Iz,initialSearchQuery:Tq,forkSession:H.forkSession,filterByPr:W9})}else{let J1=oO&&nY.length===0?oO:void 0;U4("action_after_hooks"),hl8(H),Sl8(H);let g7=null;if(H.deepLinkOrigin)d("tengu_deep_link_opened",{has_prefill:Boolean(H.prefill),has_repo:Boolean(H.deepLinkRepo)}),g7=fw(V15({cwd:Z8(),prefillLength:H.prefill?.length,repo:H.deepLinkRepo,lastFetch:H.deepLinkLastFetch!==void 0?new Date(H.deepLinkLastFetch):void 0}),"warning");else if(H.prefill)g7=fw("Launched with a pre-filled prompt — review it before pressing Enter.","warning");let z4=g7?[g7,...nY]:nY.length>0?nY:void 0;await PK8(N5,{getFpsMetrics:qK,stats:Xq,initialState:H$},{...Iz,initialMessages:z4,pendingHookMessages:J1},fM6)}}).version(`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.88",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-03-30T21:59:52Z"}.VERSION} (Claude Code)`,"-v, --version","Output the version number"),K.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),K.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),tq6())K.addOption(new G3("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());K.addOption(new G3("--enable-auto-mode","Opt in to auto mode").hideHelp()),K.addOption(new G3("--brief","Enable SendUserMessage tool for agent-to-user communication")),K.addOption(new G3("--channels <servers...>","MCP servers whose channel notifications (inbound push) should register this session. Space-separated server names.").hideHelp()),K.addOption(new G3("--dangerously-load-development-channels <servers...>","Load channel servers not on the approved allowlist. For local channel development only. Shows a confirmation dialog at startup.").hideHelp()),K.addOption(new G3("--agent-id <id>","Teammate agent ID").hideHelp()),K.addOption(new G3("--agent-name <name>","Teammate display name").hideHelp()),K.addOption(new G3("--team-name <name>","Team name for swarm coordination").hideHelp()),K.addOption(new G3("--agent-color <color>","Teammate UI color").hideHelp()),K.addOption(new G3("--plan-mode-required","Require plan mode before implementation").hideHelp()),K.addOption(new G3("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),K.addOption(new G3("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),K.addOption(new G3("--agent-type <type>","Custom agent type for this teammate").hideHelp()),K.addOption(new G3("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),K.addOption(new G3("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),K.addOption(new G3("--remote [description]","Create a remote session with the given description").hideHelp()),K.addOption(new G3("--remote-control [name]","Start an interactive session with Remote Control enabled (optionally named)").argParser((j)=>j||!0).hideHelp()),K.addOption(new G3("--rc [name]","Alias for --remote-control").argParser((j)=>j||!0).hideHelp()),U4("run_main_options_built");let _=process.argv.includes("-p")||process.argv.includes("--print"),z=process.argv.some((j)=>j.startsWith("cc://")||j.startsWith("cc+unix://"));if(_&&!z)return U4("run_before_parse"),await K.parseAsync(process.argv),U4("run_after_parse"),K;let Y=K.command("mcp").description("Configure and manage MCP servers").configureHelp(q()).enablePositionalOptions();if(Y.command("serve").description("Start the Claude Code MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:j,verbose:H})=>{let{mcpServeHandler:J}=await Promise.resolve().then(() => (O36(),A36));await J({debug:j,verbose:H})}),L15(Y),ir())h15(Y);Y.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(j,H)=>{let{mcpRemoveHandler:J}=await Promise.resolve().then(() => (O36(),A36));await J(j,H)}),Y.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:j}=await Promise.resolve().then(() => (O36(),A36));await j()}),Y.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async(j)=>{let{mcpGetHandler:H}=await Promise.resolve().then(() => (O36(),A36));await H(j)}),Y.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(j,H,J)=>{let{mcpAddJsonHandler:M}=await Promise.resolve().then(() => (O36(),A36));await M(j,H,J)}),Y.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async(j)=>{let{mcpAddFromDesktopHandler:H}=await Promise.resolve().then(() => (O36(),A36));await H(j)}),Y.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:j}=await Promise.resolve().then(() => (O36(),A36));await j()});let $=K.command("auth").description("Manage authentication").configureHelp(q());$.command("login").description("Sign in to your Anthropic account").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai","Use Claude subscription (default)").action(async({email:j,sso:H,console:J,claudeai:M})=>{let{authLogin:X}=await Promise.resolve().then(() => (iy6(),QS8));await X({email:j,sso:H,console:J,claudeai:M})}),$.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").action(async(j)=>{let{authStatus:H}=await Promise.resolve().then(() => (iy6(),QS8));await H(j)}),$.command("logout").description("Log out from your Anthropic account").action(async()=>{let{authLogout:j}=await Promise.resolve().then(() => (iy6(),QS8));await j()});let A=()=>new G3("--cowork","Use cowork_plugins directory").hideHelp(),O=K.command("plugin").alias("plugins").description("Manage Claude Code plugins").configureHelp(q());O.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(A()).action(async(j,H)=>{let{pluginValidateHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),O.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(A()).action(async(j)=>{let{pluginListHandler:H}=await Promise.resolve().then(() => (Ax(),$x));await H(j)});let w=O.command("marketplace").description("Manage Claude Code marketplaces").configureHelp(q());if(w.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(A()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .claude-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(j,H)=>{let{marketplaceAddHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),w.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(A()).action(async(j)=>{let{marketplaceListHandler:H}=await Promise.resolve().then(() => (Ax(),$x));await H(j)}),w.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(A()).action(async(j,H)=>{let{marketplaceRemoveHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),w.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(A()).action(async(j,H)=>{let{marketplaceUpdateHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),O.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(A()).action(async(j,H)=>{let{pluginInstallHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),O.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.claude/plugins/data/{id}/)").addOption(A()).action(async(j,H)=>{let{pluginUninstallHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),O.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${e0.join(", ")} (default: auto-detect)`).addOption(A()).action(async(j,H)=>{let{pluginEnableHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),O.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${e0.join(", ")} (default: auto-detect)`).addOption(A()).action(async(j,H)=>{let{pluginDisableHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),O.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${rH6.join(", ")} (default: user)`).addOption(A()).action(async(j,H)=>{let{pluginUpdateHandler:J}=await Promise.resolve().then(() => (Ax(),$x));await J(j,H)}),K.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").action(async()=>{let[{setupTokenHandler:j},{createRoot:H}]=await Promise.all([Promise.resolve().then(() => (El8(),yl8)),Promise.resolve().then(() => (s6(),Bl6))]),J=await H(Jo(!1));await j(J)}),K.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:j}=await Promise.resolve().then(() => (Eq5(),yq5));await j(),process.exit(0)}),IB8()!=="disabled"){let j=K.command("auto-mode").description("Inspect auto mode classifier configuration");j.command("defaults").description("Print the default auto mode environment, allow, and deny rules as JSON").action(async()=>{let{autoModeDefaultsHandler:H}=await Promise.resolve().then(() => (Rl8(),Ll8));H(),process.exit(0)}),j.command("config").description("Print the effective auto mode config as JSON: your settings where set, defaults otherwise").action(async()=>{let{autoModeConfigHandler:H}=await Promise.resolve().then(() => (Rl8(),Ll8));H(),process.exit(0)}),j.command("critique").description("Get AI feedback on your custom auto mode rules").option("--model <model>","Override which model is used").action(async(H)=>{let{autoModeCritiqueHandler:J}=await Promise.resolve().then(() => (Rl8(),Ll8));await J(H),process.exit()})}return K.command("remote-control",{hidden:!0}).alias("rc").description("Connect your local environment for remote-control sessions via claude.ai/code").action(async()=>{let{bridgeMain:j}=await Promise.resolve().then(() => (U_7(),F_7));await j(process.argv.slice(3))}),K.command("doctor").description("Check the health of your Claude Code auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:j},{createRoot:H}]=await Promise.all([Promise.resolve().then(() => (El8(),yl8)),Promise.resolve().then(() => (s6(),Bl6))]),J=await H(Jo(!1));await j(J)}),K.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:j}=await Promise.resolve().then(() => (hq5(),Rq5));await j()}),K.command("install [target]").description("Install Claude Code native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(j,H)=>{let{installHandler:J}=await Promise.resolve().then(() => (El8(),yl8));await J(j,H)}),U4("run_before_parse"),await K.parseAsync(process.argv),U4("run_after_parse"),U4("main_after_run"),zI6(),K}async function ZsY({hasInitialPrompt:q,hasStdin:K,verbose:_,debug:z,debugToStderr:Y,print:$,outputFormat:A,inputFormat:O,numAllowedTools:w,numDisallowedTools:j,mcpClientCount:H,worktreeEnabled:J,skipWebFetchPreflight:M,githubActionInputs:X,dangerouslySkipPermissionsPassed:P,permissionMode:W,modeIsBypass:D,allowDangerouslySkipPermissionsPassed:f,systemPromptFlag:G,appendSystemPromptFlag:Z,thinkingConfig:T,assistantActivationPath:v}){try{d("tengu_init",{entrypoint:"claude",hasInitialPrompt:q,hasStdin:K,verbose:_,debug:z,debugToStderr:Y,print:$,outputFormat:A,inputFormat:O,numAllowedTools:w,numDisallowedTools:j,mcpClientCount:H,worktree:J,skipWebFetchPreflight:M,...X&&{githubActionInputs:X},dangerouslySkipPermissionsPassed:P,permissionMode:W,modeIsBypass:D,inProtectedNamespace:Ik(),allowDangerouslySkipPermissionsPassed:f,thinkingType:T.type,...G&&{systemPromptFlag:G},...Z&&{appendSystemPromptFlag:Z},is_simple:f9()||void 0,is_coordinator:void 0,...v&&{assistantActivationPath:v},autoUpdatesChannel:N7().autoUpdatesChannel??"latest",...{}})}catch(V){H6(V)}}function hl8(q){}function Sl8(q){let K=q.brief,_=i6(process.env.CLAUDE_CODE_BRIEF);if(!K&&!_)return;let{isBriefEntitled:z}=(dQ(),Eq(IK6)),Y=z();if(Y)tp(!0);d("tengu_brief_mode_enabled",{enabled:Y,gated:!Y,source:_?"env":"flag"})}function GsY(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(Gu)}function TsY(q){if(typeof q!=="object"||q===null)return{};let K=q,_=K.teammateMode;return{agentId:typeof K.agentId==="string"?K.agentId:void 0,agentName:typeof K.agentName==="string"?K.agentName:void 0,teamName:typeof K.teamName==="string"?K.teamName:void 0,agentColor:typeof K.agentColor==="string"?K.agentColor:void 0,planModeRequired:typeof K.planModeRequired==="boolean"?K.planModeRequired:void 0,parentSessionId:typeof K.parentSessionId==="string"?K.parentSessionId:void 0,teammateMode:_==="auto"||_==="tmux"||_==="in-process"?_:void 0,agentType:typeof K.agentType==="string"?K.agentType:void 0}}var Sq5=()=>(AY(),Eq(SV1)),KsY=()=>Eq(x7K),_sY=()=>(s26(),Eq(Ri1)),zsY=null,YsY,sA7=11;var CA7=y(()=>{Cx();VK1();kv1();a_7();x3();po6();c71();Fu();H3();jN();Kz7();Ib();rtK();o1();atK();hx8();b56();yV1();ZD();aN6();GU();BD();eq6();i$();n48();G7();V1();cc6();q0();xf();q48();i1();vK();As6();nC();NF();Ec8();l8();L$7();qeK();H16();o1();k8();xc6();v8();yA();P65();p16();SA7();ZU();PD();bA7();T15();SP();Lo();WJ6();fP();qL6();mA7();m8();A$7();a78();E5();k97();vO();E8();$A7();aq();Yn();yW();fX();Jy();pX();F18();z88();aV();KC();JK6();_K();bA8();U1();Zc();gj();lE6();E15();Sx8();jm();R15();S15();S87();ON6();PD();f0();NJ();Oa6();i$7();fH6();cC();c9();xr();lQ();I7();_8();y8();e7();RA();y18();aT1();tN();a48();kO();v8();b15();I15();m15();p15();g15();U15();d15();l15();i15();o15();s15();H$7();e15();uQ();zw6();EV6();tS6();M0();HG();oY();WK8();bj();XS6();K$();VM();am();WL();f$6();d0();U4("main_tsx_entry");yS7();xCq();YsY=Eq(mK6);U4("main_tsx_imports_loaded");if(AsY())process.exit(1)});process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CLAUDE_CODE_REMOTE==="true"){let q=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=q?`${q} --max-old-space-size=8192`:"--max-old-space-size=8192"}async function vsY(){let q=process.argv.slice(2);if(q.length===1&&(q[0]==="--version"||q[0]==="-v"||q[0]==="-V")){console.log(`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.88",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-03-30T21:59:52Z"}.VERSION} (Claude Code)`);return}let{profileCheckpoint:K}=await Promise.resolve().then(() => (Cx(),jM7));if(K("cli_entry"),process.argv[2]==="--claude-in-chrome-mcp"){K("cli_claude_in_chrome_mcp_path");let{runClaudeInChromeMcpServer:$}=await Promise.resolve().then(() => (YF1(),zF1));await $();return}else if(process.argv[2]==="--chrome-native-host"){K("cli_chrome_native_host_path");let{runChromeNativeHost:$}=await Promise.resolve().then(() => (PFK(),XFK));await $();return}else if(process.argv[2]==="--computer-use-mcp"){K("cli_computer_use_mcp_path");let{runComputerUseMcpServer:$}=await Promise.resolve().then(() => (rg1(),ig1));await $();return}if(q[0]==="remote-control"||q[0]==="rc"||q[0]==="remote"||q[0]==="sync"||q[0]==="bridge"){K("cli_bridge_path");let{enableConfigs:$}=await Promise.resolve().then(() => (V1(),G16));$();let{getBridgeDisabledReason:A,checkBridgeMinVersion:O}=await Promise.resolve().then(() => (Jd(),nq7)),{BRIDGE_LOGIN_ERROR:w}=await Promise.resolve().then(() => rSK),{bridgeMain:j}=await Promise.resolve().then(() => (U_7(),F_7)),{exitWithError:H}=await Promise.resolve().then(() => fo8),{getClaudeAIOAuthTokens:J}=await Promise.resolve().then(() => (G7(),_L));if(!J()?.accessToken)H(w);let M=await A();if(M)H(`Error: ${M}`);let X=O();if(X)H(X);let{waitForPolicyLimitsToLoad:P,isPolicyAllowed:W}=await Promise.resolve().then(() => (ZD(),dF1));if(await P(),!W("allow_remote_control"))H("Error: Remote Control is disabled by your organization's policy.");await j(q.slice(1));return}if(!1)switch(q[0]){case"ps":case"logs":case"attach":case"kill":default:}if((q.includes("--tmux")||q.includes("--tmux=classic"))&&(q.includes("-w")||q.includes("--worktree")||q.some(($)=>$.startsWith("--worktree=")))){K("cli_tmux_worktree_fast_path");let{enableConfigs:$}=await Promise.resolve().then(() => (V1(),G16));$();let{isWorktreeModeEnabled:A}=await Promise.resolve().then(() => tJK);if(A()){let{execIntoTmuxWorktree:O}=await Promise.resolve().then(() => (d0(),pgK)),w=await O(q);if(w.handled)return;if(w.error){let{exitWithError:j}=await Promise.resolve().then(() => fo8);j(w.error)}}}if(q.length===1&&(q[0]==="--update"||q[0]==="--upgrade"))process.argv=[process.argv[0],process.argv[1],"update"];if(q.includes("--bare"))process.env.CLAUDE_CODE_SIMPLE="1";let{startCapturingEarlyInput:z}=await Promise.resolve().then(() => (cc6(),Zaq));z(),K("cli_before_main_import");let{main:Y}=await Promise.resolve().then(() => (CA7(),bq5));K("cli_after_main_import"),await Y(),K("cli_after_main_complete")}vsY(); |