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

Function logAPIPrefix

source code/utils/api.ts:283–296  ·  view source on GitHub ↗
(systemPrompt: SystemPrompt)

Source from the content-addressed store, hash-verified

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

Callers 1

queryModelFunction · 0.85

Calls 2

splitSysPromptPrefixFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected