Skip to content

Add search, continue commands and Nix packaging#459

Draft
jwiegley wants to merge 4 commits intogit-ai-project:mainfrom
jwiegley:johnw/continue
Draft

Add search, continue commands and Nix packaging#459
jwiegley wants to merge 4 commits intogit-ai-project:mainfrom
jwiegley:johnw/continue

Conversation

@jwiegley
Copy link
Contributor

@jwiegley jwiegley commented Feb 4, 2026

Summary

  • Nix flake packaging: Add flake.nix with NixOS and Home Manager modules, comprehensive settings options (includePromptsInRepositories, defaultPromptStorage), and documentation
  • git-ai search command: Search AI prompt sessions by commit, commit range, file (with line ranges), pattern, or prompt ID — with JSON, verbose, and summary output modes
  • git-ai continue command: Restore AI session context from search results, with launch (spawns Claude Code), clipboard, and interactive TUI session selection modes
  • git-ai-search skill: Claude Code skill for AI context discovery using the new search/continue commands
  • Toolchain pinning: Pin Rust toolchain to 1.93.0 via rust-overlay; add libexec symlink for Fork git client compatibility
  • Integration tests: Comprehensive test suites for both search and continue commands

Test plan

  • cargo test passes for existing and new integration tests
  • git-ai search --commit <sha> returns prompt metadata for a known commit
  • git-ai search --file <path> --lines <range> filters correctly
  • git-ai continue --commit <sha> outputs formatted context blocks
  • git-ai continue --commit <sha> --launch spawns Claude Code with context
  • nix build produces a working git-ai binary
  • NixOS and Home Manager module options validate correctly

🤖 Generated with Claude Code

@jwiegley jwiegley force-pushed the johnw/continue branch 5 times, most recently from bf56b1b to 46a9a34 Compare February 7, 2026 05:55
@svarlamov svarlamov self-assigned this Feb 7, 2026
jwiegley and others added 4 commits February 7, 2026 10:30
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants