MCPcopy Index your code
hub / github.com/codeaashu/claude-code / logAPIPrefix

Function logAPIPrefix

src/utils/api.ts:281–294  ·  view source on GitHub ↗
(systemPrompt: SystemPrompt)

Source from the content-addressed store, hash-verified

279 * (see https://console.statsig.com/4aF3Ewatb6xPVpCwxb5nA3/dynamic_configs/claude_cli_system_prompt_prefixes)
280 */
281export function logAPIPrefix(systemPrompt: SystemPrompt): void {
282 const [firstSyspromptBlock] = splitSysPromptPrefix(systemPrompt)
283 const firstSystemPrompt = firstSyspromptBlock?.text
284 logEvent('tengu_sysprompt_block', {
285 snippet: firstSystemPrompt?.slice(
286 0,
287 20,
288 ) as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
289 length: firstSystemPrompt?.length ?? 0,
290 hash: (firstSystemPrompt
291 ? createHash('sha256').update(firstSystemPrompt).digest('hex')
292 : '') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
293 })
294}
295
296/**
297 * Split system prompt blocks by content type for API matching and cache control.

Callers 1

queryModelFunction · 0.85

Calls 3

splitSysPromptPrefixFunction · 0.85
logEventFunction · 0.85
updateMethod · 0.65

Tested by

no test coverage detected