Skip to content

build(desktop): reduce installed app size by ~300MB - #4824

Merged
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
wukko:shrink-builds
Jul 29, 2026
Merged

build(desktop): reduce installed app size by ~300MB#4824
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
wukko:shrink-builds

Conversation

@wukko

@wukko wukko commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What Changed

Desktop app builds now:

  • Omit unused binaries from Claude SDK
  • Drop unused language packs (T3 Code is en-US only)
  • Pack dependencies into ASAR on compatible platforms (macOS/Linux) and retain the Windows-only unpacking for WSL

Why

The current version of the T3 Code desktop app is unreasonably huge: ~737 MB on arm64 macOS. This made me wonder why it's this big, and turns out it's pretty trivial to fix.

This PR brings it down to ~424 MB without any functional changes:

image

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Packaging-only change with a behavioral shift on macOS/Linux (no explicit asarUnpack); risk is native/runtime loading if anything still expected unpacked paths outside smart unpack—Windows WSL path remains explicitly unpacked.

Overview
Cuts installed desktop size (~737MB → ~424MB on arm64 macOS) by tightening electron-builder packaging in createBuildConfig, without changing runtime behavior for normal macOS/Linux backends.

Locale and dependency trimming: All platforms now set electronLanguages to en-US and add files exclusions that drop optional @anthropic-ai/claude-agent-sdk-* platform bundles (the app uses the user’s Claude binary, so those ~200MB packages are unused).

Platform-specific ASAR unpacking: asarUnpack is applied only on Windows via WINDOWS_ASAR_UNPACK (apps/server/dist/** and **/node_modules/** for the WSL backend). macOS and Linux builds no longer set asarUnpack; the old global DESKTOP_ASAR_UNPACK for @ff-labs/fff-bin-* is removed, with comments that native libs are handled via smart unpack / app.asar.unpacked (aligned with the fff-node patch).

Tests were updated to assert the new constants and that mac/linux configs omit asarUnpack while Windows keeps the WSL unpack list.

Reviewed by Cursor Bugbot for commit f424416. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Reduce desktop app installed size by ~300MB

  • Limits Electron locales to en-US via electronLanguages in createBuildConfig, dropping unused locale files.
  • Excludes optional Claude SDK platform bundles (@anthropic-ai/claude-agent-sdk-*) from packaged files via new DESKTOP_FILE_EXCLUSIONS constant.
  • Makes asarUnpack Windows-only using WINDOWS_ASAR_UNPACK; macOS and Linux builds no longer unpack asar contents.
  • Removes the old DESKTOP_ASAR_UNPACK constant that unconditionally unpacked @ff-labs/fff-bin-* on all platforms.
  • Behavioral Change: macOS and Linux builds no longer include asarUnpack, which may affect native module loading if any path relied on unpacked asar access.

Macroscope summarized f424416.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 57817d93-dc15-46bf-9357-b0406c2fdd13

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 29, 2026
- drop extra Electron language packs (~48MB)
- drop the Claude Agent SDK's bundled platform executables (~255MB).
  T3 Code always runs the user's own Claude install
- pack dependencies into ASAR on macOS/Linux, retaining Windows-only
  unpacking for WSL

macOS arm64: 737MB -> 424MB installed, 227MB -> 149MB DMG.
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved ff0f7ea

Build/packaging optimization changes only - limits Electron locales to en-US, excludes unused SDK executables, and makes asar unpacking Windows-specific. No runtime logic changes, well-documented rationale, and includes test coverage.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
juliusmarminge merged commit 72b960f into pingdotgg:main Jul 29, 2026
14 checks passed
@wukko
wukko deleted the shrink-builds branch July 29, 2026 10:47
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 29, 2026
## What's Changed
* Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828
* build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824
* Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832
* Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830
* Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679

## New Contributors
* @wukko made their first contribution in pingdotgg/t3code#4824

**Full Changelog**: pingdotgg/t3code@v0.0.31-nightly.20260729.944...v0.0.31-nightly.20260729.946

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.31-nightly.20260729.946
@LiquidBacn

Copy link
Copy Markdown

I know this is already merged, but build size is something I care about and needed to add my two-cents.

I've dived through electron-builders output semi extensivly before. I've done it before with an extensive deny lists, but a restrictive allow list is simpler.

Node packages include often sourcecode and documentation in their releases. Which isn't really a bad thing, but electron-builder doesn't know any better and takes everything.

I made this change

export const DESKTOP_FILE_EXCLUSIONS = [
  "apps/server/dist/**/*",
  "apps/desktop/dist-electron/**/*",
  // electron-builder takes *everything* in the node_modules folder.
  // which is far too much. So lets filter out the entire folder and
  // use an allow list to add only what we want.
  "!**/node_modules/**/*",

  // We want all JS, node native extensions and json files.
  "**/node_modules/**/{*.js,*.mjs,*.cjs,*.node,*.json}",

  // But not tests or examples.
  "!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
  "!**/node_modules/@*/*/{test,__tests__,tests,powered-test,example,examples}",
] as const;

and reduced the installer size from 146MB to 125MB, and the 'node_modules' folder from 141MB to 71MB.

It should have more testing done, but it does produce an application that launches.

H-Ekana added a commit to H-Ekana/v3code that referenced this pull request Jul 29, 2026
Brings in 20 upstream commits including native resource diagnostics (pingdotgg#2679),
event-driven Git ref invalidation (pingdotgg#4727), 300MB installer size reduction
(pingdotgg#4824), thread-shell preservation while detail loads (pingdotgg#4830), HTTP
compression, and the v0.0.30 release prep.

Merge resolutions of note:
- vcs.ts / ProcessDiagnostics / EventNdjsonLogger: upstream superseded our
  polling-interval, WMI, and log-batching fixes with better implementations
- build-desktop-artifact: kept fork artifact naming + bundled Codex plugin
  extraResource on top of upstream's size optimizations
- ChatView/ChatComposer: both feature sets kept (send-morph/reveal/hydration
  + thread-shell loading, sendDisabledReason, ThreadSyncStatusPill)
- RpcAuthorization: added fork-only shell.revealPath scope
- AGENTS.md: kept fork operational rules, took upstream's product sections
- ProjectionPipeline: expiry timestamps via DateTime.nowUnsafe (wall clock)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ohbentos pushed a commit to ohbentos/t3code that referenced this pull request Jul 29, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 29, 2026
## What's Changed
* Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806
* fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809
* Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828
* build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824
* Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832
* Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830
* Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679
* fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848
* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843
* fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854
* Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979
* fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853

## New Contributors
* @wukko made their first contribution in pingdotgg/t3code#4824
* @ohbentos made their first contribution in pingdotgg/t3code#4854
* @Sy-D made their first contribution in pingdotgg/t3code#4853

**Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31

## What's Changed
* Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806
* fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809
* Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828
* build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824
* Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832
* Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830
* Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679
* fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848
* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843
* fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854
* Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979
* fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853

## New Contributors
* @wukko made their first contribution in pingdotgg/t3code#4824
* @ohbentos made their first contribution in pingdotgg/t3code#4854
* @Sy-D made their first contribution in pingdotgg/t3code#4853

**Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.31
tarik02 added a commit to tarik02-org/t3code that referenced this pull request Jul 30, 2026
* fix(desktop): restore T3 Connect sign-in (pingdotgg#4809)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Simplify files panel header (pingdotgg#4828)

* build(desktop): reduce installed app size by ~300MB (pingdotgg#4824)

* Update model version from claude-opus-4-8 to claude-opus-5 (pingdotgg#4832)

* Preserve the thread shell while detail loads (pingdotgg#4830)

* Reduce idle work and disk churn with native resource diagnostics (pingdotgg#2679)

Co-authored-by: codex <codex@users.noreply.github.com>

* fix(server): detect repositories after initialization (pingdotgg#4848)

* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat (pingdotgg#4843)

* fix(git): disable external diff for review diff previews (pingdotgg#4854)

* Fix editable file focus and live syntax highlighting (pingdotgg#3979)

* fix(web): remember the rendered-markdown choice across threads (pingdotgg#4853)

Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

* chore(release): prepare v0.0.31

* fix(mobile): reduce thread feed scroll jank (pingdotgg#4874)

* fix(web): restore sidebar v2 thread actions and terminal icon (pingdotgg#4712)

* fix(web): settle button now works on hover, not just right-click (pingdotgg#4905)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(clients): disable add project while disconnected (pingdotgg#4834)

* fix(composer): hide default Codex service tier (pingdotgg#4784)

* docs: link iOS and Android app store downloads (pingdotgg#4902)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): align remote server update action (pingdotgg#4731)

* fix(connect): suggest a serve command that matches how you ran connect (pingdotgg#4897)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): stop shared content errors in Personal Team builds (pingdotgg#4943)

* perf(mobile): sends respond instantly, thread opens stop freezing (pingdotgg#4882)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): show Codex fast mode as a bolt (pingdotgg#4947)

* docs: seed worktrees with a copy of real userdata instead of banning it (pingdotgg#4949)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): support dragged images in the composer (pingdotgg#4953)

* fix(mobile): stop long iOS threads from jumping while scrolling up (pingdotgg#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): keep worktree default when switching a draft's machine (pingdotgg#4964)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* perf(mobile): reconnect environments immediately on resume (pingdotgg#4878)

* feat(web): pasting a huge screenshot now compresses it instead of erroring (pingdotgg#4967)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(web): regenerate thread titles from sidebar (pingdotgg#4810)

* fix(web): show server update progress through reconnect (pingdotgg#4903)

---------

Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: wukko <me@wukko.me>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: ohbentos <72638975+ohbentos@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: Simon Doba <simon.doba@hotmail.de>
Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Gabriel De Andrade <30420087+gabrielelpidio@users.noreply.github.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Max Katz <me@maxkatz.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants