---
title: "Get git diff stats"
method: GET
path: "/api/sessions/{session_id}/git-diff"
tags: ["sessions"]
---

# Get git diff stats

`GET /api/sessions/{session_id}/git-diff`

get git diff stats for the session's work directory

## Path parameters

- `session_id` string, uuid, required

## Response `200`

Successful Response

- GitDiffStats — Git diff statistics for a work directory.
  - `is_git_repo` boolean, required — Whether the directory is a git repo
  - `has_changes` boolean — Whether there are uncommitted changes
  - `total_additions` integer — Total added lines
  - `total_deletions` integer — Total deleted lines
  - `files` GitFileDiff[] — Per-file diff stats
    - `path` string, required — File path
    - `additions` integer, required — Number of added lines
    - `deletions` integer, required — Number of deleted lines
    - `status` 'added' | 'modified' | 'deleted' | 'renamed', required — File change status
  - `error` string, nullable — Error message if any

## Other responses

- `422` — Validation Error

## Changes

- **2026-02-04** `0843dee5b725` — 1 info
  - endpoint added
- **2026-01-29** `c455806f620b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface/changes/api/sessions/:session_id/git-diff/get.md)

---

[API](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface.md) · [All operations](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/moonshotai/kimi-code-cli-web-interface/revisions/8eac348b2e66/schema)
