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

Function appendEntryToFile

source code/utils/sessionStorage.ts:2574–2586  ·  view source on GitHub ↗
(
  fullPath: string,
  entry: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

2572 */
2573/* eslint-disable custom-rules/no-sync-fs -- sync callers (exit cleanup, materialize) */
2574function appendEntryToFile(
2575 fullPath: string,
2576 entry: Record<string, unknown>,
2577): void {
2578 const fs = getFsImplementation()
2579 const line = jsonStringify(entry) + '\n'
2580 try {
2581 fs.appendFileSync(fullPath, line, { mode: 0o600 })
2582 } catch {
2583 fs.mkdirSync(dirname(fullPath), { mode: 0o700 })
2584 fs.appendFileSync(fullPath, line, { mode: 0o600 })
2585 }
2586}
2587
2588/**
2589 * Sync tail read for reAppendSessionMetadata's external-writer check.

Callers 9

saveCustomTitleFunction · 0.85
saveAiGeneratedTitleFunction · 0.85
saveTaskSummaryFunction · 0.85
saveTagFunction · 0.85
linkSessionToPRFunction · 0.85
saveAgentNameFunction · 0.85
saveAgentColorFunction · 0.85
saveWorktreeStateFunction · 0.85

Calls 2

getFsImplementationFunction · 0.85
jsonStringifyFunction · 0.85

Tested by

no test coverage detected