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 / diff / hooks / pane-state / turn-totals-of / turn-totals-of.ts
16 lines · 503 BRaw
1import type Turns from '../../turns'
2import type { HeaderTotals } from '../header-totals'
3
4/**
5 * A turn's header counts: its files and their summed lines; nothing falls
6 * past a cap.
7 *
8 * @param turn the turn
9 * @returns the counts
10 */
11export const turnTotalsOf = (turn: Turns.TurnDiff): HeaderTotals => ({
12 filesCount: turn.files.length,
13 linesAdded: turn.files.reduce((sum, file) => sum + file.added, 0),
14 linesRemoved: turn.files.reduce((sum, file) => sum + file.removed, 0),
15 notShown: 0,
16})