[FEATURE] Flag to limit amount of turn history sent
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 trying to use -p mode for a relatively long running process. Taking in a prompt, making multiple tool calls, one of which is to get work from a queue to process on. These work are generally unrelated to anything else, and so I don't need the entire turn history to be sent back and cost me tokens every time.
This ends up KILLING my subscription session token usage, and I'm on Max plan.
Proposed Solution
Not sure how exactly, but have some kind of flag to limit the maximum number of previous turn history that is sent back as part of the invocation.
Alternative Solutions
Only alternative is, I think, to specifically have claude -p exit after every single task, and pay a penalty in startup/re-processing the initial prompt.
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
I have a non-trivial system prompt that is in a file, with instructions as to the MCP to use, what tool to start using at startup, what the work item(s) are, what to do with them, and how to discover more work to end up enqueuing to then continue processing at a later time.
Additional Context
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗