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

Function saveCustomTitle

src/utils/sessionStorage.ts:2617–2638  ·  view source on GitHub ↗
(
  sessionId: UUID,
  customTitle: string,
  fullPath?: string,
  source: 'user' | 'auto' = 'user',
)

Source from the content-addressed store, hash-verified

2615/* eslint-enable custom-rules/no-sync-fs */
2616
2617export async function saveCustomTitle(
2618 sessionId: UUID,
2619 customTitle: string,
2620 fullPath?: string,
2621 source: 'user' | 'auto' = 'user',
2622) {
2623 // Fall back to computed path if fullPath is not provided
2624 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
2625 appendEntryToFile(resolvedPath, {
2626 type: 'custom-title',
2627 customTitle,
2628 sessionId,
2629 })
2630 // Cache for current session only (for immediate visibility)
2631 if (sessionId === getSessionId()) {
2632 getProject().currentSessionTitle = customTitle
2633 }
2634 logEvent('tengu_session_renamed', {
2635 source:
2636 source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
2637 })
2638}
2639
2640/**
2641 * Persist an AI-generated title to the JSONL as a distinct `ai-title` entry.

Callers 4

LogSelectorFunction · 0.85
autoNameSessionFromPlanFunction · 0.85
callFunction · 0.85
callFunction · 0.85

Calls 5

appendEntryToFileFunction · 0.85
getSessionIdFunction · 0.85
getProjectFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected