find_optimal_compact_turn
Scans candidate /compact checkpoint turns to find the exact compaction turn that minimizes total session and monthly token spend for a coding session.
Instructions
Scan every candidate /compact checkpoint turn across a multi-turn coding session to compute the exact compaction turn that minimizes total session and monthly token spend.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "find_optimal_compact_turn"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| turns | No | Total coding session length in turns (1..100). | |
| modelId | No | Reference LLM pricing tier ID. | claude_sonnet_4_5 |
| imageTokens | No | Token count of visual attachments when imageInjectionTurn > 0. | |
| cacheTtlMode | No | Prompt-cache TTL mode (5m, 1h, or none). | 5m |
| avgOutputTokens | No | Average assistant output tokens per turn. | |
| mcpSchemaTokens | No | Eager MCP schema token weight per turn. | |
| compactKeepRatio | No | Fraction of accumulated conversation history retained after /compact summarization (default: 0.20). | |
| sessionsPerMonth | No | Monthly session count used to project monthly savings. | |
| avgTurnGapMinutes | No | Average minutes elapsed between turns. | |
| systemRulesTokens | No | Static rules token weight per turn. | |
| imageInjectionTurn | No | Optional turn where visual screenshots are injected mid-session. | |
| avgTurnGrowthTokens | No | Average context delta added per turn. |