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

Function saveCustomTitle

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

Source from the content-addressed store, hash-verified

2654/* eslint-enable custom-rules/no-sync-fs */
2655
2656export async function saveCustomTitle(
2657 sessionId: UUID,
2658 customTitle: string,
2659 fullPath?: string,
2660 source: 'user' | 'auto' = 'user',
2661) {
2662 // Fall back to computed path if fullPath is not provided
2663 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
2664 appendEntryToFile(resolvedPath, {
2665 type: 'custom-title',
2666 customTitle,
2667 sessionId,
2668 })
2669 // Cache for current session only (for immediate visibility)
2670 if (sessionId === getSessionId()) {
2671 getProject().currentSessionTitle = customTitle
2672 }
2673 logEvent('tengu_session_renamed', {
2674 source:
2675 source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
2676 })
2677}
2678
2679/**
2680 * 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