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

Function getAgentDescriptionsTotalTokens

src/utils/statusNoticeHelpers.ts:9–20  ·  view source on GitHub ↗
(
  agentDefinitions?: AgentDefinitionsResult,
)

Source from the content-addressed store, hash-verified

7 * Calculate cumulative token estimate for agent descriptions
8 */
9export function getAgentDescriptionsTotalTokens(
10 agentDefinitions?: AgentDefinitionsResult,
11): number {
12 if (!agentDefinitions) return 0
13
14 return agentDefinitions.activeAgents
15 .filter(a => a.source !== 'built-in')
16 .reduce((total, agent) => {
17 const description = `${agent.agentType}: ${agent.whenToUse}`
18 return total + roughTokenCountEstimation(description)
19 }, 0)
20}
21

Callers 2

checkAgentDescriptionsFunction · 0.85

Calls 1

Tested by

no test coverage detected