MCPcopy Create free account
hub / github.com/WJX20/claude-code / isLoggableMessage

Function isLoggableMessage

src/utils/sessionStorage.ts:4352–4368  ·  view source on GitHub ↗
(m: Message)

Source from the content-addressed store, hash-verified

4350// Exported so useLogMessages can sync-compute the last loggable uuid
4351// without awaiting recordTranscript's return value (race-free hint tracking).
4352export function isLoggableMessage(m: Message): boolean {
4353 if (m.type === 'progress') return false
4354 // IMPORTANT: We deliberately filter out most attachments for non-ants because
4355 // they have sensitive info for training that we don't want exposed to the public.
4356 // When enabled, we allow hook_additional_context through since it contains
4357 // user-configured hook output that is useful for session context on resume.
4358 if (m.type === 'attachment' && getUserType() !== 'ant') {
4359 if (
4360 m.attachment.type === 'hook_additional_context' &&
4361 isEnvTruthy(process.env.CLAUDE_CODE_SAVE_HOOK_ADDITIONAL_CONTEXT)
4362 ) {
4363 return true
4364 }
4365 return false
4366 }
4367 return true
4368}
4369
4370function collectReplIds(messages: readonly Message[]): Set<string> {
4371 const ids = new Set<string>()

Callers

nothing calls this directly

Calls 2

getUserTypeFunction · 0.85
isEnvTruthyFunction · 0.85

Tested by

no test coverage detected