MCPcopy Create free account
hub / github.com/codeaashu/claude-code / deriveSessionTitle

Function deriveSessionTitle

src/bridge/bridgeMain.ts:1956–1960  ·  view source on GitHub ↗

Derive a session title from a user message: first line, truncated.

(text: string)

Source from the content-addressed store, hash-verified

1954
1955/** Derive a session title from a user message: first line, truncated. */
1956function deriveSessionTitle(text: string): string {
1957 // Collapse whitespace — newlines/tabs would break the single-line status display.
1958 const flat = text.replace(/\s+/g, ' ').trim()
1959 return truncateToWidth(flat, TITLE_MAX_LEN)
1960}
1961
1962/**
1963 * One-shot fetch of a session's title via GET /v1/sessions/{id}.

Callers 1

runBridgeLoopFunction · 0.85

Calls 1

truncateToWidthFunction · 0.85

Tested by

no test coverage detected