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

Function saveGoal

src/utils/sessionStorage.ts:2748–2763  ·  view source on GitHub ↗
(
  sessionId: UUID,
  state: GoalState,
  fullPath?: string,
)

Source from the content-addressed store, hash-verified

2746 * past compaction's tail-read window.
2747 */
2748export function saveGoal(
2749 sessionId: UUID,
2750 state: GoalState,
2751 fullPath?: string,
2752): void {
2753 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
2754 appendEntryToFile(resolvedPath, {
2755 type: 'goal',
2756 sessionId,
2757 state,
2758 timestamp: new Date().toISOString(),
2759 })
2760 if (sessionId === getSessionId()) {
2761 getProject().currentSessionGoal = state
2762 }
2763}
2764
2765/**
2766 * Persist a "goal cleared" tombstone so a future --resume cannot

Callers

nothing calls this directly

Calls 4

appendEntryToFileFunction · 0.85
getSessionIdFunction · 0.85
getProjectFunction · 0.85

Tested by

no test coverage detected