MCPcopy
hub / github.com/codeaashu/claude-code / computeSimpleEnvInfo

Function computeSimpleEnvInfo

src/constants/prompts.ts:651–710  ·  view source on GitHub ↗
(
  modelId: string,
  additionalWorkingDirectories?: string[],
)

Source from the content-addressed store, hash-verified

649}
650
651export async function computeSimpleEnvInfo(
652 modelId: string,
653 additionalWorkingDirectories?: string[],
654): Promise<string> {
655 const [isGit, unameSR] = await Promise.all([getIsGit(), getUnameSR()])
656
657 // Undercover: strip all model name/ID references. See computeEnvInfo.
658 // DCE: inline the USER_TYPE check at each site — do NOT hoist to a const.
659 let modelDescription: string | null = null
660 if (process.env.USER_TYPE === 'ant' && isUndercover()) {
661 // suppress
662 } else {
663 const marketingName = getMarketingNameForModel(modelId)
664 modelDescription = marketingName
665 ? `You are powered by the model named ${marketingName}. The exact model ID is ${modelId}.`
666 : `You are powered by the model ${modelId}.`
667 }
668
669 const cutoff = getKnowledgeCutoff(modelId)
670 const knowledgeCutoffMessage = cutoff
671 ? `Assistant knowledge cutoff is ${cutoff}.`
672 : null
673
674 const cwd = getCwd()
675 const isWorktree = getCurrentWorktreeSession() !== null
676
677 const envItems = [
678 `Primary working directory: ${cwd}`,
679 isWorktree
680 ? `This is a git worktree — an isolated copy of the repository. Run all commands from this directory. Do NOT \`cd\` to the original repository root.`
681 : null,
682 [`Is a git repository: ${isGit}`],
683 additionalWorkingDirectories && additionalWorkingDirectories.length > 0
684 ? `Additional working directories:`
685 : null,
686 additionalWorkingDirectories && additionalWorkingDirectories.length > 0
687 ? additionalWorkingDirectories
688 : null,
689 `Platform: ${env.platform}`,
690 getShellInfoLine(),
691 `OS Version: ${unameSR}`,
692 modelDescription,
693 knowledgeCutoffMessage,
694 process.env.USER_TYPE === 'ant' && isUndercover()
695 ? null
696 : `The most recent Claude model family is Claude 4.5/4.6. Model IDs — Opus 4.6: '${CLAUDE_4_5_OR_4_6_MODEL_IDS.opus}', Sonnet 4.6: '${CLAUDE_4_5_OR_4_6_MODEL_IDS.sonnet}', Haiku 4.5: '${CLAUDE_4_5_OR_4_6_MODEL_IDS.haiku}'. When building AI applications, default to the latest and most capable Claude models.`,
697 process.env.USER_TYPE === 'ant' && isUndercover()
698 ? null
699 : `Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).`,
700 process.env.USER_TYPE === 'ant' && isUndercover()
701 ? null
702 : `Fast mode for Claude Code uses the same ${FRONTIER_MODEL_NAME} model with faster output. It does NOT switch to a different model. It can be toggled with /fast.`,
703 ].filter(item => item !== null)
704
705 return [
706 `# Environment`,
707 `You have been invoked in the following environment: `,
708 ...prependBullets(envItems),

Callers 1

getSystemPromptFunction · 0.85

Calls 8

getUnameSRFunction · 0.85
isUndercoverFunction · 0.85
getMarketingNameForModelFunction · 0.85
getKnowledgeCutoffFunction · 0.85
getCwdFunction · 0.85
getShellInfoLineFunction · 0.85
prependBulletsFunction · 0.85

Tested by

no test coverage detected