[FEATURE] CLI flag to disable auto-compact

Resolved 💬 3 comments Opened Jan 14, 2026 by peteruid Closed Feb 27, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I'm building a web app that spawns Claude Code sessions for different operations. Some operations (like /reflect) use a lot of context and would benefit from the full 200k without the 45k autocompact buffer.

Currently I can pass CLI flags like --mcp-config to configure MCP servers per-operation. I'd like a similar flag like --no-auto-compact or --autocompact=false to disable auto-compaction for specific sessions.

Proposed Solution

The cleanest solution would be if Claude Code added a --no-auto-compact CLI flag. Then your terminal server could conditionally include it based on which operation is being run:

// Hypothetical future code
const mcpFlags = needsMcp ? '--strict-mcp-config --mcp-config=data/butler-mcp.json' : '';
const compactFlag = disableAutoCompact ? '--no-auto-compact' : '';
const fullCommand = claude ${mcpFlags} ${compactFlag} ${command};

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

Use case: Long-running reflection sessions that analyze multiple data sources benefit from maximum context, while quick assist operations don't need the extra space.

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗