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

# Thinking Budgets

> Configure extended thinking token budgets

The `thinking` command manages thinking token budgets for complex reasoning.

## Quick Start

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Show current thinking budget
praisonai thinking status
```

## Usage

### Show Status

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai thinking status
```

**Expected Output:**

```
╭─ Thinking Budget ────────────────────────────────────────────────────────────╮
│  Level: medium                                                               │
│  Max Tokens: 8,000                                                           │
│  Adaptive: enabled                                                           │
╰──────────────────────────────────────────────────────────────────────────────╯
```

### Set Budget Level

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai thinking set high
```

Available levels: `minimal`, `low`, `medium`, `high`, `maximum`

## Use from `code` / `run`

For a single invocation without persisting a global default, pass `--thinking` on `praisonai code` or `praisonai run`:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai code --thinking high "Refactor src/utils.py for readability"
praisonai run --thinking medium "Plan a release checklist"
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Q[Need extended thinking?]
    Q -->|one-off call| Flag[--thinking on code/run]
    Q -->|every session| Set[praisonai thinking set]
    Flag --> Levels1[off / minimal / low / medium / high]
    Set --> Levels2[minimal / low / medium / high / maximum]
    Flag --> Note1[per-invocation, not persisted]
    Set --> Note2[persisted to .praison/thinking.json]

    classDef q fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef opt fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef out fill:#10B981,stroke:#7C90A0,color:#fff
    class Q q
    class Flag,Set opt
    class Levels1,Levels2,Note1,Note2 out
```

| Surface                        | Levels                                        | Persisted?                     |
| ------------------------------ | --------------------------------------------- | ------------------------------ |
| `--thinking` on `code` / `run` | `off`, `minimal`, `low`, `medium`, `high`     | No — per invocation            |
| `praisonai thinking set`       | `minimal`, `low`, `medium`, `high`, `maximum` | Yes — `.praison/thinking.json` |

Unknown `--thinking` values fail closed with exit code `1` before any work runs.

### Show Usage Stats

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai thinking stats
```

## Python API

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.thinking import ThinkingBudget, ThinkingTracker

# Use predefined levels
budget = ThinkingBudget.high()  # 16,000 tokens

# Track usage
tracker = ThinkingTracker()
session = tracker.start_session(budget_tokens=16000)
tracker.end_session(session, tokens_used=12000)

summary = tracker.get_summary()
print(f"Utilization: {summary['average_utilization']:.1%}")
```

## See Also

* [Thinking Budgets Feature](/docs/features/thinking-budgets)
