MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / initializeEntrypoint

Function initializeEntrypoint

source code/main.tsx:519–542  ·  view source on GitHub ↗
(isNonInteractive: boolean)

Source from the content-addressed store, hash-verified

517 profileCheckpoint('eagerLoadSettings_end');
518}
519function initializeEntrypoint(isNonInteractive: boolean): void {
520 // Skip if already set (e.g., by SDK or other entrypoints)
521 if (process.env.CLAUDE_CODE_ENTRYPOINT) {
522 return;
523 }
524 const cliArgs = process.argv.slice(2);
525
526 // Check for MCP serve command (handle flags before mcp serve, e.g., --debug mcp serve)
527 const mcpIndex = cliArgs.indexOf('mcp');
528 if (mcpIndex !== -1 && cliArgs[mcpIndex + 1] === 'serve') {
529 process.env.CLAUDE_CODE_ENTRYPOINT = 'mcp';
530 return;
531 }
532 if (isEnvTruthy(process.env.CLAUDE_CODE_ACTION)) {
533 process.env.CLAUDE_CODE_ENTRYPOINT = 'claude-code-github-action';
534 return;
535 }
536
537 // Note: 'local-agent' entrypoint is set by the local agent mode launcher
538 // via CLAUDE_CODE_ENTRYPOINT env var (handled by early return above)
539
540 // Set based on interactive status
541 process.env.CLAUDE_CODE_ENTRYPOINT = isNonInteractive ? 'sdk-cli' : 'cli';
542}
543
544// Set by early argv processing when `claude open <url>` is detected (interactive mode only)
545type PendingConnect = {

Callers 1

mainFunction · 0.85

Calls 1

isEnvTruthyFunction · 0.85

Tested by

no test coverage detected