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

Function getCacheSharingParams

src/commands/compact/compact.ts:251–288  ·  view source on GitHub ↗
(
  context: ToolUseContext,
  forkContextMessages: Message[],
)

Source from the content-addressed store, hash-verified

249}
250
251async function getCacheSharingParams(
252 context: ToolUseContext,
253 forkContextMessages: Message[],
254): Promise<{
255 systemPrompt: SystemPrompt
256 userContext: { [k: string]: string }
257 systemContext: { [k: string]: string }
258 toolUseContext: ToolUseContext
259 forkContextMessages: Message[]
260}> {
261 const appState = context.getAppState()
262 const defaultSysPrompt = await getSystemPrompt(
263 context.options.tools,
264 context.options.mainLoopModel,
265 Array.from(
266 appState.toolPermissionContext.additionalWorkingDirectories.keys(),
267 ),
268 context.options.mcpClients,
269 )
270 const systemPrompt = buildEffectiveSystemPrompt({
271 mainThreadAgentDefinition: undefined,
272 toolUseContext: context,
273 customSystemPrompt: context.options.customSystemPrompt,
274 defaultSystemPrompt: defaultSysPrompt,
275 appendSystemPrompt: context.options.appendSystemPrompt,
276 })
277 const [userContext, systemContext] = await Promise.all([
278 getUserContext(),
279 getSystemContext(),
280 ])
281 return {
282 systemPrompt,
283 userContext,
284 systemContext,
285 toolUseContext: context,
286 forkContextMessages,
287 }
288}

Callers 2

callFunction · 0.85
compactViaReactiveFunction · 0.85

Calls 3

keysMethod · 0.65
getSystemPromptFunction · 0.50

Tested by

no test coverage detected