fix(Inference.ts): add --no-session-persistence to prevent orphan session files#1042
Open
BrentEubanks wants to merge 1 commit intodanielmiessler:mainfrom
Open
fix(Inference.ts): add --no-session-persistence to prevent orphan session files#1042BrentEubanks wants to merge 1 commit intodanielmiessler:mainfrom
BrentEubanks wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
…sion files Hooks calling Inference.ts (SessionAutoName, RatingCapture) spawn `claude --print`, which creates a new .jsonl session file per invocation. This produces dozens of orphan files per conversation that clutter the `claude --resume` picker. Adding --no-session-persistence prevents these transient inference calls from writing session files. The flag is compatible with --print which Inference.ts already uses. Fixes danielmiessler#947 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--no-session-persistenceflag to theclaude --printargs inInference.ts. Without this flag, every hook that callsInference.ts(SessionAutoName on 2nd+ turn, RatingCapture on responses) creates a new.jsonlsession file per invocation, producing dozens of orphan files per conversation that clutter theclaude --resumepicker.The Fix
One line added to the args array in
Inference.ts(line 85), after--setting-sources:The
--no-session-persistenceflag is compatible with--print(whichInference.tsalready uses) and simply tells the CLI not to write a session file for transient inference calls.Testing
.jsonlfiles created after the fixclaude --resumepicker shows only real sessionsContext
Fixes #947. Previous attempts at this fix (#635, #956) were either mis-targeted at older release paths or bundled with unrelated changes. This PR is scoped to the single flag addition only.