Open
Conversation
Claude Code: read per-entry gitBranch (last wins per interaction) and authoritative cwd from JSONL entries instead of lossy directory name decoding. Store both in metadata. Codex: detect branch changes from git checkout/switch in exec command output, overriding the initial session_meta branch. Add comments for non-obvious ordering semantics and a TODO for locale assumptions. Includes tests for branch extraction, session parsing, sanitization, cwd extraction, and project name decoding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resume picker (--resume): find sessions by git branch or project directory. Presents a TUI picker when multiple sessions match. Checks for dirty working tree before switching branches. Semantic search: both TUIs use witchcraft for / search instead of substring matching. Results update live as the user types (3+ chars). The resume picker lazy-loads the embedder only when search is first used, avoiding model load delay on startup. Carries cwd through BranchSession so launch_resume no longer reads the entire JSONL file. Integrates upstream --exclude and --since filters into the unified build_sql_filter. Includes tests for SQL filter construction, search result dedup, format_date, and parse_range. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2db1fab to
7cad98b
Compare
Replaces (session_id, path, cwd, source, branch, project) tuples with the existing BranchSession struct throughout search_tui, confirm_resume, resume_session, and launch_resume. No behavior change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- `--branch .` resolves to current git branch - With --branch: search/pick resumes with git checkout - Without --branch: search resumes without checkout (branches are short-lived; old conversations shouldn't try dead branches) - Remove resume_for_branch, resume_for_project, find_sessions_for_project (dead after --resume removal) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only attempt git checkout when running interactively (stderr is a terminal) and after a y/N prompt. Prevents unintended side effects when pickbrain is invoked as a skill or in a pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jacobgorm
reviewed
Apr 17, 2026
| } else { | ||
| eprintln!("Usage: pickbrain [--branch NAME|.] [--session UUID] [--exclude UUID,...] [--since 24h|7d|2w] <query>"); | ||
| eprintln!(" pickbrain --branch NAME|."); | ||
| eprintln!("Usage: pickbrain [--branch NAME|.] [--session UUID] [--exclude UUID,...] [--since 24h|7d|2w] [query]"); |
Collaborator
There was a problem hiding this comment.
Lets ask Claude to split this into N extra-indented alpha-sorted sub-lines, perhaps with comments
Byte-slicing into a multi-byte character (e.g. em dash) caused a panic. Use floor_char_boundary to find a safe cut point. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both TUIs now: - Exit search mode on arrow up/down (falling through to navigation) - Highlight the search bar (bg) when in search mode - Remove list highlight when search bar is focused - Esc and Enter both accept current search results Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Esc cancels the search and restores previous results. Enter and arrow keys accept and exit. Help text leads with ⏎ since that's the intuitive action most users will try first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Arrow down was falling through to navigation, advancing past item 1. Now exits search with continue so the highlight lands on the current selection. Co-Authored-By: Claude Opus 4.6 <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.
Pickbrain was close but didn't quite match my workflow since it is often branch based. This adds 1 flags
--branch Xwhen used alone, it will filter the conversations by branch and allow a normal pickbrain search. Because a branch is picked, it will also try to check out that branch in the cwd.--branch .is for the current branchLots of unit tests.