npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fix-chrome-diskwrite

v5.0.0

Published

Fix Chrome crashes caused by excessive disk writes on macOS

Downloads

30

Readme

fix-chrome-diskwrite

Chrome の過剰なディスク書き込みにより macOS の書き込み制限を超過してクラッシュする問題を修正する。

原因

ディスク書き込み超過クラッシュ

Chrome は以下のデータを自動ダウンロード・書き込みし、macOS の disk writes 制限(約 2GB/24h)を超過すると OS に強制終了される。

  • Gemini Nano AI モデルOptGuideOnDeviceModel/ 約 4GB)
  • optimization_guide_model_store(最適化用モデル、再起動のたびに再生成)
  • screen_ai(OCR/アクセシビリティ AI、約 123MB)
  • WasmTtsEngine(テキスト読み上げ、約 22MB)
  • component_crx_cache(コンポーネントキャッシュ、約 157MB)
  • その他コンポーネントの自動更新

クラッシュループ

ディスク書き込み超過などで Chrome が一度クラッシュすると、Preferences に exit_type: Crashed が記録される。次回起動時に Chrome は前回のセッション(大量のタブや Google Meet 等)を一斉復元しようとし、再びクラッシュ → 起動 → クラッシュを繰り返す「クラッシュループ」に陥ることがある。

やること

  1. Enterprise Policy GenAILocalFoundationalModelSettings=1 を設定(Gemini Nano の自動ダウンロードを禁止)
  2. 既存のモデルデータ(OptGuideOnDeviceModel/)を削除

--full オプション(推奨)

上記に加えて以下も適用:

  1. コンポーネント自動更新を停止(ComponentUpdatesEnabled=false
  2. ScreenAI・TTS・バックグラウンドモードを無効化
  3. Chrome 内蔵パスワードマネージャー・自動入力を無効化(macOS の SafariPlatformSupport.Helper クラッシュ防止)
  4. 追加コンポーネントデータの削除(screen_ai, WasmTtsEngine, component_crx_cache 等)
  5. ブラウザキャッシュの削除(~/Library/Caches/Google/Chrome/ — HTTP キャッシュ・Code Cache)
  6. ディスクキャッシュサイズの制限(DiskCacheSize=50MB, MediaCacheSize=32MB

注意: Chrome 内蔵パスワードマネージャーの無効化は 1Password 等の拡張機能に影響しません。

使い方

Chrome を終了してから実行。

npx(推奨)

# 基本(Gemini Nano のみ)
npx fix-chrome-diskwrite

# フル対策(推奨)
npx fix-chrome-diskwrite --full

# フル対策 + optimization_guide_model_store 自動削除
npx fix-chrome-diskwrite --full --opt-guide --schedule

curl

# 基本
curl -fsSL https://raw.githubusercontent.com/kanketsu-jp/fix-chrome-diskwrite/main/bin/fix.sh | bash

# フル対策
curl -fsSL https://raw.githubusercontent.com/kanketsu-jp/fix-chrome-diskwrite/main/bin/fix.sh | bash -s -- --full

# フル対策 + optimization_guide_model_store 自動削除
curl -fsSL https://raw.githubusercontent.com/kanketsu-jp/fix-chrome-diskwrite/main/bin/fix.sh | bash -s -- --full --opt-guide --schedule

オプション一覧

| オプション | 説明 | |---|---| | (なし) | Gemini Nano の DL 禁止 + 既存モデル削除 | | --full | コンポーネント更新停止・ScreenAI/TTS 無効化・内蔵パスワードマネージャー無効化・追加データ削除 | | --opt-guide | optimization_guide_model_store も削除 | | --schedule | LaunchAgent で 2 分ごとにキャッシュを自動クリーンアップ(--opt-guide と併用)。Chrome 未起動時は 100MB 超のキャッシュを削除+クラッシュ後の壊れたキャッシュを自動修復。Chrome 起動中はクラッシュループ防止のみ | | --fix-crash-loop | クラッシュループを修復(全プロファイルの exit_type リセット + セッションファイル削除) | | --undo | すべての設定を元に戻す(--full, --opt-guide --schedule と併用可) |

クラッシュループの修復

Chrome が「起動 → すぐクラッシュ → 再起動」を繰り返す場合:

npx fix-chrome-diskwrite --fix-crash-loop

これは全プロファイル(Default, Profile 2, ...)に対して以下を行う:

  • Preferences の exit_typeCrashedNormal にリセット
  • 破損したセッションファイルをバックアップして削除

修復後、Chrome は空の新しいタブで起動する。以前のタブは chrome://history から個別に復元できる。

定期キャッシュクリーンアップ(--schedule

--opt-guide --schedule を指定すると、2 分ごとに以下を自動実行する LaunchAgent が登録される:

  • Chrome 未起動時: optimization_guide_model_storeGraphiteDawnCacheBrowserMetrics 等の共有キャッシュと、各プロファイルの Service Worker/CacheStorageDawnWebGPUCacheDIPS-wal をクリーンアップ(各ディレクトリが 100MB を超えた場合のみ削除)。クラッシュが検知された場合は壊れたキャッシュ(HTTP Cache、Code Cache 等)も自動修復する。Chrome は次回起動時に必要なキャッシュを小さいサイズから再生成する。
  • Chrome 起動中: クラッシュが検知された場合は exit_typeNormal にリセットしてクラッシュループを防止する(キャッシュは起動中に削除すると逆効果のため触らない)。クラッシュが検知されなければ何もしない。

ログは ~/Library/Logs/fix-chrome-diskwrite-cleanup.log に記録される。

元に戻す

# 基本設定のみ元に戻す
npx fix-chrome-diskwrite --undo

# すべて元に戻す
npx fix-chrome-diskwrite --undo --full --opt-guide --schedule

確認方法

Chrome を再起動して chrome://policy を開く。設定したポリシーが反映されていれば OK。

参考

おまけ: macOS の .DS_Store をリモート/USB ドライブに作らせない

Google Workspace(Google Drive)や NAS などのネットワークマウント、USB ドライブに .DS_Store が生成されるのを防ぐワンライナー。

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true && defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

設定後、ログアウト→ログイン(または再起動)で反映される。

確認:

defaults read com.apple.desktopservices

元に戻す:

defaults delete com.apple.desktopservices DSDontWriteNetworkStores && defaults delete com.apple.desktopservices DSDontWriteUSBStores

注意: ローカルディスクの .DS_Store は Finder の表示設定に使われるため、無効化する公式手段はない。

License

MIT