spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / agents-md / hooks / telemetry / load-row-of.ts
27 lines · 776 BRaw
1import type Modes from '../modes'
2import { LOAD_EVENT } from './load-event.js'
3import { modeChoiceOf } from './mode-choice-of.js'
4import type { LoadCounts, TelemetryRow } from './types'
5
6/**
7 * The first-context row: the mode and what was handed to the engine, in
8 * counts only; no path and no text.
9 *
10 * @param mode the configured mode
11 * @param counts what the first context handed on
12 * @returns the row to send
13 */
14export const loadRowOf = (
15 mode: Modes.Mode,
16 counts: LoadCounts,
17): TelemetryRow => ({
18 event: LOAD_EVENT,
19 props: {
20 mode: modeChoiceOf(mode),
21 file_count: counts.fileCount,
22 import_count: counts.importCount,
23 total_content_length: counts.totalContentLength,
24 yielded: counts.isYielded,
25 walk_failed: counts.isWalkFailed,
26 },
27})