MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isMetaSession

Function isMetaSession

src/commands/insights.ts:2846–2861  ·  view source on GitHub ↗
(log: LogOption)

Source from the content-addressed store, hash-verified

2844
2845 // Filter out /insights meta-sessions (facet extraction API calls get logged as sessions)
2846 const isMetaSession = (log: LogOption): boolean => {
2847 for (const msg of log.messages.slice(0, 5)) {
2848 if (msg.type === 'user' && msg.message) {
2849 const content = msg.message.content
2850 if (typeof content === 'string') {
2851 if (
2852 content.includes('RESPOND WITH ONLY A VALID JSON OBJECT') ||
2853 content.includes('record_facets')
2854 ) {
2855 return true
2856 }
2857 }
2858 }
2859 }
2860 return false
2861 }
2862
2863 // Load uncached sessions in batches to yield to event loop between batches
2864 const LOAD_BATCH_SIZE = 10

Callers 1

generateUsageReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected