Skip to content

[FEATURE] CLI flag to disable auto-compact #18085

Description

@peteruid

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions