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

Function truncateContent

src/utils/telemetry/betaSessionTracing.ts:103–117  ·  view source on GitHub ↗
(
  content: string,
  maxSize: number = MAX_CONTENT_SIZE,
)

Source from the content-addressed store, hash-verified

101 * Truncate content to fit within Honeycomb limits.
102 */
103export function truncateContent(
104 content: string,
105 maxSize: number = MAX_CONTENT_SIZE,
106): { content: string; truncated: boolean } {
107 if (content.length <= maxSize) {
108 return { content, truncated: false }
109 }
110
111 return {
112 content:
113 content.slice(0, maxSize) +
114 '\n\n[TRUNCATED - Content exceeds 60KB limit]',
115 truncated: true,
116 }
117}
118
119/**
120 * Generate a short hash (first 12 hex chars of SHA-256).

Callers 6

addToolContentEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected