> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# conversation_prune_length

> Controls how aggressively Claude prunes conversation history to balance cost optimization with context preservation.

<Note>
  This setting is only supported for Claude models.
</Note>

Controls how aggressively Claude manages conversation context by pruning conversation history when LLM token limits are reached. This setting allows you to balance cost optimization against context preservation for longer conversations.

## Syntax

```yaml theme={null}
ai_settings:
  conversation_prune_length: <short | medium | max | long>
```

## Properties

<ParamField path="ai_settings" type="object">
  An object that contains various AI settings. See [`ai_settings`](/modeling/models/parameters/ai-settings) for more information.

  <Expandable title="ai_settings properties" defaultOpen="true">
    <ParamField path="conversation_prune_length" type="string" default="long">
      Controls how aggressively Claude manages conversation context by pruning conversation history when LLM token limits are reached.

      Must be one of the following values:

      | Value    | Pruning triggers at | Description                                          |
      | -------- | ------------------- | ---------------------------------------------------- |
      | `short`  | 75,000 tokens       | Aggressive pruning, cost-optimized                   |
      | `medium` | 125,000 tokens      | Balanced approach                                    |
      | `long`   | 175,000 tokens      | **Default**. Preserves most context.                 |
      | `max`    | 175,000 tokens      | Reserved for future expansion to >200k context sizes |

      When conversation context reaches the specified token threshold, Claude automatically prunes older messages from the conversation history to stay within limits while preserving the most recent and relevant context.

      <Note>
        The `max` value currently matches `long` (175k LLM tokens) but is reserved to allow future expansion to >200k context sizes. Using `max` as the default ensures you'll automatically benefit from increased context limits as they become available, while `long` will remain at 175k LLM tokens.
      </Note>
    </ParamField>
  </Expandable>
</ParamField>

## Examples

```yaml title="Optimize for cost with aggressive context pruning" theme={null}
ai_settings:
  conversation_prune_length: short
```

```yaml title="Balance cost and context preservation" theme={null}
ai_settings:
  conversation_prune_length: medium
```

```yaml title="Preserve maximum context" theme={null}
ai_settings:
  conversation_prune_length: max
```
