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

Function getBuiltInAgents

src/tools/AgentTool/builtInAgents.ts:22–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22export function getBuiltInAgents(): AgentDefinition[] {
23 // Allow disabling all built-in agents via env var (useful for SDK users who want a blank slate)
24 // Only applies in noninteractive mode (SDK/API usage)
25 if (
26 isEnvTruthy(process.env.CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS) &&
27 getIsNonInteractiveSession()
28 ) {
29 return []
30 }
31
32 // Use lazy require inside the function body to avoid circular dependency
33 // issues at module init time. The coordinatorMode module depends on tools
34 // which depend on AgentTool which imports this file.
35 if (feature('COORDINATOR_MODE')) {
36 if (isEnvTruthy(process.env.CLAUDE_CODE_COORDINATOR_MODE)) {
37 /* eslint-disable @typescript-eslint/no-require-imports */
38 const { getCoordinatorAgents } =
39 require('../../coordinator/workerAgent.js') as typeof import('../../coordinator/workerAgent.js')
40 /* eslint-enable @typescript-eslint/no-require-imports */
41 return getCoordinatorAgents()
42 }
43 }
44
45 const agents: AgentDefinition[] = [
46 GENERAL_PURPOSE_AGENT,
47 STATUSLINE_SETUP_AGENT,
48 ]
49
50 if (areExplorePlanAgentsEnabled()) {
51 agents.push(EXPLORE_AGENT, PLAN_AGENT)
52 }
53
54 // Include Code Guide agent for non-SDK entrypoints
55 const isNonSdkEntrypoint =
56 process.env.CLAUDE_CODE_ENTRYPOINT !== 'sdk-ts' &&
57 process.env.CLAUDE_CODE_ENTRYPOINT !== 'sdk-py' &&
58 process.env.CLAUDE_CODE_ENTRYPOINT !== 'sdk-cli'
59
60 if (isNonSdkEntrypoint) {
61 agents.push(CLAUDE_CODE_GUIDE_AGENT)
62 }
63
64 if (
65 feature('VERIFICATION_AGENT') &&
66 getFeatureValue_CACHED_MAY_BE_STALE('tengu_hive_evidence', false)
67 ) {
68 agents.push(VERIFICATION_AGENT)
69 }
70
71 return agents
72}
73

Callers 1

loadAgentsDir.tsFile · 0.85

Calls 6

isEnvTruthyFunction · 0.85
featureFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected