> your AI agent picks dependencies from memory; give it dated facts — try starlog.dev ↗ vet your agent's deps ↗ vibe-coding is fine. vibe-importing isn’t. — try starlog.dev ↗ vibe-importing isn’t fine ↗ your agent has never seen your private packages — try starlog.dev ↗ facts for private packages ↗ a linter for the dependencies your AI agent picks — try starlog.dev ↗ a linter for agent deps ↗

Back to Articles

Entire CLI: How Git Hooks Turn Your AI Coding Sessions Into a Time Machine

[ View on GitHub ]

Entire CLI: How Git Hooks Turn Your AI Coding Sessions Into a Time Machine

Hook

Your AI agent just spent 45 minutes refactoring a module, made 12 commits, and somehow broke authentication. You remember it working perfectly 20 minutes ago, but which commit? This is the problem Entire CLI solves.

Context

AI coding assistants have fundamentally changed how we write software. Claude, Copilot, and Gemini can generate entire features in minutes, refactor legacy code, and fix bugs faster than any human. But this velocity creates a new problem: when an AI agent makes dozens of rapid-fire changes, our traditional Git workflow breaks down. Commit messages become noise. The development history becomes opaque. And when something goes wrong—which it inevitably does—you're left digging through a tangled mess of AI-generated commits trying to find where the code was last working.

The typical solution is to squash commits or manually curate history, but this destroys the very information that could help you understand what happened. You lose the prompts you gave the AI, the reasoning behind decisions, and the incremental steps that led to the final code. Entire CLI takes a different approach: instead of fighting against AI-generated commits, it embraces them while keeping your main Git history clean. By using Git hooks to intercept AI interactions and storing session data on a separate branch, it creates a parallel timeline of your AI-assisted development that's fully searchable and rewindable without cluttering your production branches.

Technical Insight

Entire CLI's architecture is elegant precisely because it doesn't reinvent the wheel. When you run entire enable in a repository, it installs Git hooks (primarily post-commit and post-checkout) that intercept every commit and capture metadata about the AI session that created it. This data—prompts, responses, token usage, files modified—gets serialized to JSON and committed to a separate branch called entire/checkpoints/v1. Your working branch remains completely untouched.

Here's what a typical workflow looks like after installation:

# Install and enable Entire in your repo
brew install entireio/tap/entire
cd my-project
entire enable

# Now work with your AI agent as normal
# Claude makes changes, commits them
git commit -m "Add user authentication"

# Behind the scenes, the post-commit hook captures:
# - The prompt you gave Claude
# - Claude's response and reasoning
# - Files modified in this commit
# - Token usage and timing
# All stored on entire/checkpoints/v1 branch

# Later, search your AI sessions
entire search "authentication logic"
# Returns: Sessions where auth was discussed, with full context

# Or rewind to a specific checkpoint
entire checkpoint list
entire rewind <checkpoint-id>
# Your working directory returns to that exact state

The checkpoint system is where Entire CLI shows its sophistication. A "session" represents an entire AI interaction—you might spend an hour working with Claude on a feature. Within that session, every commit creates a "checkpoint." Checkpoints are rewindable save points with full context. When you run entire rewind, the tool uses git worktree under the hood to reconstruct the exact state of your repository at that checkpoint, including which files existed and their contents.

The session metadata stored on the separate branch follows a structured format that makes it queryable:

{
  "session_id": "ses_abc123",
  "checkpoint_id": "chk_def456",
  "timestamp": "2024-01-15T10:30:00Z",
  "agent": "claude-code",
  "prompt": "Add JWT authentication to the user service",
  "response": "I'll implement JWT auth with token refresh...",
  "files_modified": [
    "services/auth.go",
    "middleware/jwt.go"
  ],
  "tokens_used": 2847,
  "parent_commit": "a1b2c3d4",
  "checkpoint_commit": "e5f6g7h8"
}

This JSON structure enables powerful search capabilities. Running entire search "JWT" doesn't just grep your codebase—it searches across all AI sessions, finding conversations where JWT was discussed, even if that code has since been deleted or refactored. This creates an institutional memory of how your codebase evolved with AI assistance.

The multi-agent support is particularly clever. Entire CLI doesn't hardcode support for specific AI tools. Instead, it provides a generic interface that AI agents can integrate with. When an agent like Claude Code wants to log a session, it writes to a JSON file in .entire/sessions/ before committing. The post-commit hook picks this up automatically. This means new AI agents can add Entire support without requiring updates to the CLI itself.

One architectural decision that might seem limiting but is actually brilliant: Entire never auto-commits to your working branch. Many tools try to be "helpful" by automatically creating commits or modifying your Git history. Entire deliberately avoids this. All session data goes to the separate branch. Your main branch remains under your complete control. This manual-commit strategy prevents the nightmare scenario where a tool's automation conflicts with your Git workflow or accidentally pushes sensitive data.

Gotcha

The biggest limitation is repository bloat. Every AI session adds metadata to the entire/checkpoints/v1 branch, and if you're using AI agents heavily—dozens of sessions per day—this branch grows quickly. In a six-month project with extensive AI usage, one team reported their checkpoint branch reaching 500MB while their main codebase was only 50MB. This doesn't affect your working directory size, but it does impact clone times and repository hosting costs. Entire CLI doesn't currently offer automatic pruning of old checkpoints, so you'll need to manually manage this by periodically deleting old checkpoint data or using Git's pruning tools.

The second gotcha is that Entire's effectiveness depends entirely on AI agents playing nice with Git. If you're using an AI tool that makes changes without committing, or that bypasses Git hooks, Entire won't capture those interactions. Some agents batch multiple logical changes into a single commit, which makes the checkpoint granularity coarser than ideal. And if an AI agent crashes mid-session without committing, that entire interaction is lost—there's no auto-save mechanism capturing uncommitted work. This means Entire works beautifully with well-behaved agents like Claude Code that integrate deeply with Git, but struggles with agents that treat Git as an afterthought.

Finally, there's a learning curve for teams. Developers need to understand that there are now two parallel Git histories: their normal branches and the checkpoint branch. This conceptual overhead is minimal for senior developers comfortable with Git internals, but can confuse junior developers who are still mastering basic Git workflows. And if your team already has complex Git workflows with lots of hooks, adding Entire's hooks into the mix requires careful coordination to avoid conflicts.

Verdict

Use Entire CLI if you're working on production systems where you need auditability of AI-generated code, especially in regulated industries like finance or healthcare where you must document how code was created. It's perfect for teams that do extensive pair programming with AI agents and want to share learnings—new developers can literally replay how features were built. Use it if you frequently experiment with AI agents and need a safety net to quickly revert when experiments go wrong. The rewind capability alone justifies the overhead when you're pushing AI agents to their limits. Skip it if you use AI agents sparingly or only for small, isolated tasks where the overhead of session tracking exceeds the benefit. Skip it if your repository is already massive and you can't afford additional storage bloat. Skip it if your team uses AI tools that don't integrate well with Git, or if you work in an environment where adding Git hooks requires extensive approval processes. And definitely skip it if your developers aren't comfortable with intermediate Git concepts—the mental model of parallel branches will cause more confusion than the tool provides value.