[FEATURE] Incognito mode in Claude Code
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
When I run Claude code in --print mode, I usually don't need to refer to that conversation later.
For example, I often use it to automatically commit changes to my code.
These conversations aren't something I'll ever refer back to, BUT they end up cluttering up the conversation history when I try to find an earlier session using /resume.
Proposed Solution
I'd like to be able to run claude --print --incognito. This would prevent the conversation history from being stored in ~/.claude/projects.
Alternative Solutions
I can't think of any other way to accomplish this other than a native flag.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Example:
- I make some changes with Claude Code.
- I leave the session and run
claude -p "/dev:commit" --incognito - Claude Code commits the files
- I run
claude -c - Claude resumes the previous session where I made the changes
- The conversation history for the commit workflow is not stored
Additional Context
No response
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
id still love that feature for tons of haiku microagents doing their work without having to script-cleanup after them!
I'd still prefer a proper command-line arg, but I found a workaround where you can capture the conversation id via the --output-format json argument and then clear out the conversation right away. Here is a bash wrapper in the meantime:
https://gist.github.com/superjax/5e4b9c78d42458d0c6b1d5a05aa66288