Add search, continue commands and Nix packaging#459
Draft
jwiegley wants to merge 4 commits intogit-ai-project:mainfrom
Draft
Add search, continue commands and Nix packaging#459jwiegley wants to merge 4 commits intogit-ai-project:mainfrom
jwiegley wants to merge 4 commits intogit-ai-project:mainfrom
Conversation
bf56b1b to
46a9a34
Compare
Implement two new commands for querying and restoring AI prompt history: - `git-ai search` finds AI sessions by commit, file/line range, text pattern, or prompt ID with five output formats (default, JSON, verbose, porcelain, count) and filters for tool, author, and time range. - `git-ai continue` restores conversation context from prompt history and delivers it via agent launch (using Unix exec() for proper terminal passthrough), clipboard, JSON, or stdout with secret redaction and message truncation. Also adds format_transcript() utility for rendering PromptRecord messages as labeled text, and comprehensive integration tests for both commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Register the git-ai-search skill alongside the existing prompt-analysis skill so it deploys automatically when git-ai installs into Claude Code environments. The SKILL.md provides workflow-oriented documentation with decision tables, seven usage patterns, command references, and integration examples for CI/CD and shell scripting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When launching an agent with `git ai continue --launch`, the agent now starts silently by default. Pass `--summary` to have the agent produce a brief overview of what was being worked on, what was accomplished, and what remains before prompting for input. Also refactors launch_agent() to build the command incrementally, keeping the unix exec() and non-unix subprocess paths in sync. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enhance the continue command to provide comprehensive context when restoring AI sessions. Previously, only conversation history and basic commit metadata were included; the restored agent lacked the broader repository context needed to continue work effectively. Add helper functions to retrieve commit diffs (get_commit_diff), project instructions from CLAUDE.md (read_project_context), and current git status (get_git_status_info). Introduce SessionContext struct and gather_session_context to centralize context collection, replacing scattered inline logic in both CLI and TUI code paths. The restored session now includes: full commit messages (not just subject lines), commit diffs with stat and patch output, CLAUDE.md project instructions, and current branch/recent commit status. All context is size-limited (100KB diffs, 50KB CLAUDE.md) and secrets are redacted before output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46a9a34 to
f5293c4
Compare
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
flake.nixwith NixOS and Home Manager modules, comprehensive settings options (includePromptsInRepositories,defaultPromptStorage), and documentationgit-ai searchcommand: Search AI prompt sessions by commit, commit range, file (with line ranges), pattern, or prompt ID — with JSON, verbose, and summary output modesgit-ai continuecommand: Restore AI session context from search results, with launch (spawns Claude Code), clipboard, and interactive TUI session selection modesgit-ai-searchskill: Claude Code skill for AI context discovery using the new search/continue commandsTest plan
cargo testpasses for existing and new integration testsgit-ai search --commit <sha>returns prompt metadata for a known commitgit-ai search --file <path> --lines <range>filters correctlygit-ai continue --commit <sha>outputs formatted context blocksgit-ai continue --commit <sha> --launchspawns Claude Code with contextnix buildproduces a workinggit-aibinary🤖 Generated with Claude Code