Skip to content

GitLens/GitKraken MCP repeatedly unpacks gk CLI to temp, consuming disk space on macOS #5286

@alejandroiglesias

Description

@alejandroiglesias

Summary

GitLens 18.0.0 in Cursor appears to be repeatedly running the bundled GitKraken CLI command:

$HOME/Library/Application Support/Cursor/User/globalStorage/eamodio.gitlens/gk ai hook list-sessions --json

Each invocation creates a new macOS temp directory named gkinstall* under $TMPDIR, around 42 MB each, containing a fresh gk binary, gk_core_3.1.66_darwin_arm64.zip, and MCP resources. The directories are not being cleaned up, so disk usage grows continuously until the Mac runs out of space.

This happened while the machine was idle / no manual disk-writing operation was intentionally triggered.

Impact observed

On 2026-05-31 at 03:26:29 -03, the APFS Data volume was nearly full:

Filesystem      Size    Used   Avail Capacity Mounted on
/dev/disk3s5   926Gi   855Gi    14Gi    99%   /System/Volumes/Data

The GitKraken/GitLens temp install directories accounted for 64 GB:

find "$TMPDIR" -maxdepth 1 -type d -name 'gkinstall*' | wc -l
# 1789

find "$TMPDIR" -maxdepth 1 -type d -name 'gkinstall*' -mmin -10 | wc -l
# 30

du -sh "$TMPDIR"
# 64G

The current creation rate was about 30 temp dirs per 10 minutes. Since each directory is ~42 MB, that is roughly 126 MB/minute, or ~7.5 GB/hour, with three Cursor windows/extension hosts open.

A representative latest temp directory:

$TMPDIR/gkinstall1684973017                              42M
$TMPDIR/gkinstall1684973017/gk
$TMPDIR/gkinstall1684973017/gk_core_3.1.66_darwin_arm64.zip
$TMPDIR/gkinstall1684973017/mcp_resources/vendor.meta.json
$TMPDIR/gkinstall1684973017/mcp_resources/manifest.json
$TMPDIR/gkinstall1684973017/mcp_resources/vendor.bundle.js.gz

Live process evidence

While watching the directory, new gkinstall* folders appeared at the same time as Cursor extension host children launched gk ai hook list-sessions --json.

Example captured at 2026-05-31 02:57:13 -03:

$TMPDIR/gkinstall2404347799 created

26240  parent=9589  $HOME/Library/Application Support/Cursor/User/globalStorage/eamodio.gitlens/gk ai hook list-sessions --json
26245  parent=9590  $HOME/Library/Application Support/Cursor/User/globalStorage/eamodio.gitlens/gk ai hook list-sessions --json
26250  parent=9591  $HOME/Library/Application Support/Cursor/User/globalStorage/eamodio.gitlens/gk ai hook list-sessions --json

The parent processes were Cursor extension hosts, one per open window/workspace:

Cursor Helper (Plugin): extension-host (user) [window/workspace 1]
Cursor Helper (Plugin): extension-host (user) [window/workspace 2]
Cursor Helper (Plugin): extension-host (user) [window/workspace 3]

Environment

macOS: 15.7.4 (24G517)
Arch: arm64
Cursor: 3.6.21
GitLens extension: eamodio.gitlens 18.0.0 universal

The bundled gk in Cursor global storage:

Path: $HOME/Library/Application Support/Cursor/User/globalStorage/eamodio.gitlens/gk
Size: 19M
Mach-O: arm64
Signature: Developer ID Application: Axosoft, LLC (T7QVVUTZQ8)
Timestamp: 15 May 2026 at 6:31:36 AM
Runtime Version: 12.1.0

A temp gkinstall* gk binary was also signed by Axosoft and appeared to be a newer/staged CLI payload:

Path: $TMPDIR/gkinstall.../gk
Mach-O: arm64
Signature: Developer ID Application: Axosoft, LLC (T7QVVUTZQ8)
Timestamp: 29 May 2026 at 2:15:14 PM

Relevant logs

Cursor MCP logs for user-eamodio.gitlens-extension-GitKraken showed successful connection, then JSON parse failure / transport error:

2026-05-30 01:53:34.148 [info] [V2] Handling CreateClient action
2026-05-30 01:53:34.813 [info] Successfully connected to stdio server
2026-05-30 01:53:34.820 [info] CreateClient completed, connected: true, statusType: connected
2026-05-30 04:03:51.268 [error] Client error: Unexpected token 'c', "command fa"... is not valid JSON Unexpected token 'c', "command fa"... is not valid JSON
2026-05-30 04:03:51.284 [warning] [V2 FSM] connection:transport_error: conn=connected,auth=unknown -> conn=failed,auth=unknown

GitKraken CLI log snippets around the same GitLens connection:

{"level":"warning","msg":"GL connection valid (version: 18.0.0)","time":"2026-05-30T01:53:33.093666-03:00"}
{"level":"warning","msg":"Found discovery file for address $TMPDIR/gitkraken/gitlens/gitlens-ipc-server-...json","time":"2026-05-30T01:53:33.095393-03:00"}
{"level":"warning","msg":"User not authenticated, skipping fetch prompts","time":"2026-05-30T01:53:33.706769-03:00"}

There were also many repeated telemetry flush/shutdown failures:

{"error":"context deadline exceeded","level":"warning","msg":"otel flush failed",...}
{"error":"context deadline exceeded","level":"warning","msg":"otel shutdown failed",...}
{"error":"traces export: Post \"https://otel.gitkraken.com:4318/v1/traces\": dial tcp: lookup otel.gitkraken.com: no such host","level":"warning","msg":"otel flush failed",...}

Expected behavior

Running gk ai hook list-sessions --json should not create a fresh 42 MB temp install directory on every invocation. If the CLI needs to stage/update itself, it should either:

  • reuse one cached install location,
  • clean up temporary gkinstall* directories after successful/failed runs,
  • avoid concurrent per-window installs, and/or
  • avoid retry loops that continuously extract the CLI payload.

Actual behavior

Every minute, each Cursor/GitLens extension host appears to run gk ai hook list-sessions --json, and each run creates a new $TMPDIR/gkinstall* directory that remains on disk. With three Cursor windows this caused rapid growth and consumed 64 GB of temp data.

Workaround

Disabling/uninstalling the GitLens/GitKraken integration in Cursor should stop new folders from being created. Existing $TMPDIR/gkinstall* directories still need to be removed manually after Cursor/GitLens is stopped.

Possible root cause

It looks like gk ai hook list-sessions --json is entering the CLI install/update path and extracting gk_core_3.1.66_darwin_arm64.zip to a fresh temp directory on each call. The MCP JSON parse error (Unexpected token 'c', "command fa"...) may be related if non-JSON CLI output is causing the Cursor MCP client to mark the transport failed and later retry.

Metadata

Metadata

Assignees

Labels

area-ai-agentsIssues and features related to AI Agent functionalitytriagedTeam has reviewed, verified, or reproduced this

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions