環境変数
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE
自動コンパクション(文脈の圧縮)を実行するコンテキスト使用率の閾値(1〜100)を設定します。
使い方・用途
- デフォルトの約95%よりも早い段階で文脈を整理したい場合に、低い値(50など)を設定してメモリを最適化できます。
- サブエージェントとメインセッションの両方に適用され、ステータスラインのコンテキスト使用率と連動します。
英語原文(公式ドキュメントより)
Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like 50 to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the context_window.used_percentage field available in status line