<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>git — jd:/dev/blog</title><description>Posts tagged &quot;git&quot; on jd:/dev/blog.</description><link>https://julien.danjou.info/</link><item><title>How Entire Works Under the Hood</title><link>https://julien.danjou.info/blog/how-entire-works-under-the-hood/</link><guid isPermaLink="true">https://julien.danjou.info/blog/how-entire-works-under-the-hood/</guid><description>I dug into Entire&apos;s open source Checkpoints CLI. It&apos;s a clever abuse of git internals — shadow branches, orphan metadata, and a session state machine. Here&apos;s how it works.</description><pubDate>Thu, 12 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In &lt;a href=&quot;https://julien.danjou.info/blog/github-wont-work-for-ai-agents&quot;&gt;part 1&lt;/a&gt;, I covered why Entire raised $60M and what problem they&apos;re solving. Now let&apos;s look at the actual code.&lt;/p&gt;
&lt;p&gt;I pointed Claude Code at &lt;a href=&quot;https://github.com/entireio/cli&quot;&gt;Entire&apos;s open source CLI&lt;/a&gt; and asked it to explain how things work. The architecture is more interesting than I expected — they&apos;ve essentially built a session-aware metadata layer on top of git using nothing but git&apos;s own primitives.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://julien.danjou.info/images/blog/entire/repo.png&quot; alt=&quot;The Entire CLI repository on GitHub&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;The Big Picture&lt;/h2&gt;
&lt;p&gt;Entire hooks into two things: your AI agent (Claude Code, Gemini CLI) and git itself. The agent hooks capture what&apos;s happening during a session. The git hooks capture what the developer commits.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Agent hooks (Claude Code)         Git hooks
  SessionStart                     prepare-commit-msg
  UserPromptSubmit                 post-commit
  Stop                             pre-push
  PreToolUse / PostToolUse
         │                              │
         └──────────┬───────────────────┘
                    │
            ┌───────▼────────┐
            │   Strategy     │
            │                │
            │ SaveChanges()  │
            │ Rewind()       │
            │ Condense()     │
            └───────┬────────┘
                    │
         ┌──────────┴──────────┐
         │                     │
    Shadow branches      Metadata branch
    (local, temp)        (shared, permanent)
    entire/&amp;lt;hash&amp;gt;        entire/checkpoints/v1
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;How Agent Hooks Get Installed&lt;/h2&gt;
&lt;p&gt;Running &lt;code&gt;entire enable&lt;/code&gt; writes hook entries into &lt;code&gt;.claude/settings.json&lt;/code&gt;. Seven hooks, covering the full session lifecycle:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SessionStart/SessionEnd&lt;/strong&gt; — track session boundaries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UserPromptSubmit&lt;/strong&gt; — fires before the agent starts working (captures human edits)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stop&lt;/strong&gt; — fires after the agent finishes a turn (triggers checkpoint save)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PreToolUse/PostToolUse[Task]&lt;/strong&gt; — track subagent spawning&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PostToolUse[TodoWrite]&lt;/strong&gt; — capture task state&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each hook is just a shell command: &lt;code&gt;entire hooks claude-code stop&lt;/code&gt;. The CLI parses the agent&apos;s transcript to extract everything it needs.&lt;/p&gt;
&lt;h2&gt;The Transcript Is the Source of Truth&lt;/h2&gt;
&lt;p&gt;This is the key insight. When the Stop hook fires, Claude Code passes two things via stdin: a &lt;code&gt;session_id&lt;/code&gt; and a &lt;code&gt;transcript_path&lt;/code&gt;. That transcript — the JSONL file where Claude logs every message, tool call, and response — is the single source of truth.&lt;/p&gt;
&lt;p&gt;The CLI mines it for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Modified files&lt;/strong&gt; — scans for &lt;code&gt;tool_use&lt;/code&gt; blocks where the tool is &lt;code&gt;Write&lt;/code&gt;, &lt;code&gt;Edit&lt;/code&gt;, etc., and extracts the &lt;code&gt;file_path&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;User prompts&lt;/strong&gt; — finds &lt;code&gt;type: &quot;user&quot;&lt;/code&gt; entries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Token usage&lt;/strong&gt; — sums &lt;code&gt;input_tokens&lt;/code&gt;, &lt;code&gt;output_tokens&lt;/code&gt; from response metadata&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Summary&lt;/strong&gt; — grabs the last assistant message&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No magic, no APIs. It just reads the same JSONL file that Claude Code writes to disk.&lt;/p&gt;
&lt;h2&gt;Shadow Branches: Snapshots Without Commits&lt;/h2&gt;
&lt;p&gt;Here&apos;s where it gets clever. When the agent finishes a turn, Entire needs to save a snapshot of the working tree. But it can&apos;t commit to your branch — that would mess up your history.&lt;/p&gt;
&lt;p&gt;So it creates &lt;strong&gt;shadow branches&lt;/strong&gt;: refs like &lt;code&gt;entire/2b4c177-a5e3f2&lt;/code&gt; that live in your local repo but never touch your working branch.&lt;/p&gt;
&lt;p&gt;The name encodes two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2b4c177&lt;/code&gt; — first 7 chars of HEAD when the session started&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a5e3f2&lt;/code&gt; — hash of the worktree ID (to support &lt;code&gt;git worktree&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The snapshot is built entirely in memory using go-git&apos;s plumbing APIs:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take HEAD&apos;s tree (the full repo structure)&lt;/li&gt;
&lt;li&gt;Apply the agent&apos;s changes (add/remove/modify blobs)&lt;/li&gt;
&lt;li&gt;Attach the metadata directory (&lt;code&gt;.entire/metadata/&amp;lt;session-id&amp;gt;/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Create a commit on the shadow branch&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;No checkout, no stash, no visible side effects. The user and agent don&apos;t even know it happened.&lt;/p&gt;
&lt;p&gt;Deduplication is automatic: if the tree hash matches the previous checkpoint, it skips the commit. Git&apos;s content-addressable storage means identical files share blobs across checkpoints.&lt;/p&gt;
&lt;h2&gt;The Condensation Model&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://julien.danjou.info/images/blog/entire/branch.png&quot; alt=&quot;The entire/checkpoints/v1 orphan branch stores all metadata&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Shadow branches are local scratch space. The real metadata lives on &lt;code&gt;entire/checkpoints/v1&lt;/code&gt; — an orphan branch (no common ancestor with your code) that&apos;s pushed alongside your regular branches.&lt;/p&gt;
&lt;p&gt;The flow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Agent works → checkpoints saved on shadow branch (local)&lt;/li&gt;
&lt;li&gt;You commit → &lt;code&gt;post-commit&lt;/code&gt; hook fires&lt;/li&gt;
&lt;li&gt;&lt;code&gt;prepare-commit-msg&lt;/code&gt; adds a trailer: &lt;code&gt;Entire-Checkpoint: a3b2c4d5e6f7&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Shadow branch data gets &lt;strong&gt;condensed&lt;/strong&gt; — copied into the metadata branch&lt;/li&gt;
&lt;li&gt;Shadow branch gets cleaned up&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The checkpoint ID (&lt;code&gt;a3b2c4d5e6f7&lt;/code&gt;) is 6 random bytes, not a git SHA. It&apos;s sharded into a directory path on the metadata branch:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;entire/checkpoints/v1  (orphan branch)
└── a3/b2c4d5e6f7/
    ├── metadata.json          # summary, attribution, token usage
    ├── 0/
    │   ├── full.jsonl         # complete session transcript
    │   ├── prompt.txt         # user prompts
    │   └── context.md         # generated context
    └── 1/                     # additional sessions if any
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That one-line trailer in your commit — &lt;code&gt;Entire-Checkpoint: a3b2c4d5e6f7&lt;/code&gt; — is the bidirectional link. From the commit you find metadata via the sharded path. From the metadata you find the commit by searching for the trailer.&lt;/p&gt;
&lt;h2&gt;Attribution: Who Wrote What?&lt;/h2&gt;
&lt;p&gt;This is the piece that matters for engineering leads. Entire tracks line-level code attribution: what percentage was agent-written vs. human-written.&lt;/p&gt;
&lt;p&gt;The trick is the &lt;strong&gt;UserPromptSubmit&lt;/strong&gt; hook. Every time you type a new prompt — &lt;em&gt;before&lt;/em&gt; the agent starts working — the CLI snapshots the worktree diff against the last checkpoint. This captures exactly what you changed between agent turns.&lt;/p&gt;
&lt;p&gt;By commit time, it has:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Agent lines&lt;/strong&gt;: changes from the last checkpoint&apos;s tree&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Human added&lt;/strong&gt;: lines you added between prompts&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Human modified&lt;/strong&gt;: lines you edited in agent-written code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent percentage&lt;/strong&gt;: the ratio&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The result is stored in &lt;code&gt;initial_attribution&lt;/code&gt; in the metadata:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;agent_lines&quot;: 150,
  &quot;human_added&quot;: 25,
  &quot;human_modified&quot;: 10,
  &quot;agent_percentage&quot;: 85.7
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It even uses a LIFO heuristic for self-modifications — if you add lines then remove lines from the same file, it assumes you&apos;re removing your own first, not penalizing the agent&apos;s contribution.&lt;/p&gt;
&lt;h2&gt;Multi-Developer: Conflict-Free by Design&lt;/h2&gt;
&lt;p&gt;The metadata branch gets pushed during &lt;code&gt;git push&lt;/code&gt; (via the &lt;code&gt;pre-push&lt;/code&gt; hook). Multiple developers push to the same &lt;code&gt;entire/checkpoints/v1&lt;/code&gt; branch.&lt;/p&gt;
&lt;p&gt;This works because checkpoint IDs are random — two developers will essentially never produce the same 12-hex-char ID. Merging is just a tree union: flatten both trees, combine entries, done. No merge conflicts possible.&lt;/p&gt;
&lt;p&gt;If a normal push fails (non-fast-forward), the CLI fetches the remote, merges trees, creates a merge commit, and retries.&lt;/p&gt;
&lt;h2&gt;What&apos;s Missing&lt;/h2&gt;
&lt;p&gt;The architecture is solid engineering, but a few things stood out:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Transcript privacy.&lt;/strong&gt; Session transcripts (full agent conversations) get pushed to a branch anyone with repo access can read. For private repos, maybe fine. For orgs with varying access levels — that&apos;s a problem.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Squash merges break links.&lt;/strong&gt; If a PR with 5 commits (each with &lt;code&gt;Entire-Checkpoint&lt;/code&gt; trailers) gets squash-merged, those trailers disappear. The metadata exists but the bidirectional link from the merged commit is broken.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The metadata branch grows forever.&lt;/strong&gt; Every session from every developer, including abandoned PRs and throwaway experiments, accumulates on &lt;code&gt;entire/checkpoints/v1&lt;/code&gt;. There&apos;s an &lt;code&gt;entire clean&lt;/code&gt; command for local shadow branches, but no retention policy for the permanent metadata. For a large team over months, that&apos;ll bloat.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;No PR linkage.&lt;/strong&gt; The branch name is stored, but there&apos;s no PR number or URL. You can&apos;t easily ask &quot;show me all sessions related to PR #42.&quot;&lt;/p&gt;
&lt;h2&gt;The Smart Parts&lt;/h2&gt;
&lt;p&gt;What I genuinely admire:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Git as a free database.&lt;/strong&gt; Shadow branches store full repo snapshots, but git&apos;s content-addressable storage means only changed blobs cost anything. You get atomic snapshots, deduplication, and transport for free.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-memory tree building.&lt;/strong&gt; Checkpoints are created through go-git plumbing APIs — no worktree checkout, no stash, nothing visible. Zero disruption to the developer&apos;s flow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Attribution at prompt boundaries.&lt;/strong&gt; Capturing human edits &lt;em&gt;before&lt;/em&gt; the agent contaminates the worktree is the cleanest measurement point possible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Shadow branch migration.&lt;/strong&gt; If you rebase or pull (HEAD changes), the shadow branch name automatically updates. Your session continues seamlessly. This handles a common workflow that would otherwise silently break.&lt;/p&gt;
&lt;h2&gt;So What?&lt;/h2&gt;
&lt;p&gt;Entire doesn&apos;t solve a burning problem today. Most of us are fine with agent-written code landing in our repos without detailed provenance. But the trajectory is clear: as agents write more code, the audit trail becomes essential.&lt;/p&gt;
&lt;p&gt;The approach of storing session context alongside code in git — rather than in a separate system — is the right architectural bet. Git is already where your code lives, where your CI runs, where your reviews happen. Adding a metadata layer inside git itself (instead of a SaaS dashboard somewhere) means the context travels with the code.&lt;/p&gt;
&lt;p&gt;Whether Entire is the company that turns this into a platform worth $300M is above my pay grade. But the engineering is genuine, the problem is real, and the timing feels right.&lt;/p&gt;
&lt;p&gt;I&apos;ll be watching.&lt;/p&gt;
</content:encoded><category>ai</category><category>git</category><category>developer-experience</category></item><item><title>Agent-Written Code Needs More Than Git</title><link>https://julien.danjou.info/blog/github-wont-work-for-ai-agents/</link><guid isPermaLink="true">https://julien.danjou.info/blog/github-wont-work-for-ai-agents/</guid><description>The former GitHub CEO just raised $60M to rebuild developer tooling for the agentic era. He might be right that git needs a rethink — I&apos;ve been hacking around the same problems.</description><pubDate>Wed, 11 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The former GitHub CEO just raised $60M at a $300M valuation for a seed round. For a CLI tool. Let that sink in.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://julien.danjou.info/images/blog/entire/entire-io.png&quot; alt=&quot;Entire.io — a new developer platform for the agentic era&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thomas Dohmke left GitHub and launched &lt;a href=&quot;https://entire.io/blog/hello-entire-world&quot;&gt;Entire&lt;/a&gt;, a developer platform built from scratch for the age of AI coding agents. It&apos;s the largest seed round in dev tools history.&lt;/p&gt;
&lt;p&gt;My first reaction was &quot;that&apos;s insane.&quot; My second reaction was &quot;wait, I&apos;ve been solving the same problem with duct tape and hooks.&quot;&lt;/p&gt;
&lt;h2&gt;The Problem Is Real&lt;/h2&gt;
&lt;p&gt;If you&apos;re using AI agents like Claude Code or Gemini CLI daily — and I am — you&apos;ve already felt it. Git was built for humans writing code. It assumes you know what you changed and why. It assumes your commit messages mean something. It assumes the person who wrote the code will remember what they were thinking.&lt;/p&gt;
&lt;p&gt;AI agents break all of that.&lt;/p&gt;
&lt;p&gt;When Claude Code rewrites a module for me, the commit message says what happened, but not &lt;em&gt;why&lt;/em&gt;. There&apos;s no trace of the conversation that led there. No record of the three approaches the agent considered and rejected. No way to know if the prompt was &quot;refactor this for clarity&quot; or &quot;make this 10x faster and I don&apos;t care about readability.&quot;&lt;/p&gt;
&lt;p&gt;The transcript — the actual reasoning behind the code — lives in a terminal session that vanishes when you close the tab.&lt;/p&gt;
&lt;h2&gt;My Duct Tape Solution&lt;/h2&gt;
&lt;p&gt;I ran into this a few weeks ago when I wanted to resume a Claude Code session after a reboot. The session was gone, and I had no idea what context the agent had when it made certain decisions.&lt;/p&gt;
&lt;p&gt;So I did what any engineer would do: I wrote a hook. A simple Claude Code hook that links each commit to its session ID via a git trailer. Nothing fancy — just enough that I can trace a commit back to the conversation that produced it.&lt;/p&gt;
&lt;p&gt;Combined with &lt;a href=&quot;https://github.com/Mergify/mergify-cli&quot;&gt;Mergify&apos;s CLI&lt;/a&gt; for stacking PRs, it made my workflow usable. But it&apos;s duct tape. It doesn&apos;t capture the transcript, doesn&apos;t track attribution, doesn&apos;t handle multi-session work.&lt;/p&gt;
&lt;p&gt;Which is exactly the gap Entire is going after.&lt;/p&gt;
&lt;h2&gt;What Entire Actually Claims to Be&lt;/h2&gt;
&lt;p&gt;Beyond the buzzwords in the press release, Entire is shipping three things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Checkpoints&lt;/strong&gt; — an open source CLI that captures session context (prompts, transcripts, reasoning) alongside every commit, stored in git without polluting your history&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A semantic reasoning layer&lt;/strong&gt; — meant to let multiple AI agents collaborate on the same codebase with shared context&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An AI-native UI&lt;/strong&gt; — designed for agent-to-human collaboration rather than human-to-human&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;They&apos;re not claiming to have a finished product — and they&apos;re upfront about it. The Checkpoints CLI is the first concrete thing they&apos;ve shipped, and it&apos;s open source. The rest is where the $60M goes. Fair enough — let&apos;s look at what actually exists.&lt;/p&gt;
&lt;h2&gt;Why $60M for This?&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://julien.danjou.info/images/blog/entire/techcrunch.png&quot; alt=&quot;TechCrunch: Former GitHub CEO raises record $60M dev tool seed round&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The bet isn&apos;t that the current CLI is worth $300M. The bet is that the developer tooling stack needs to be rebuilt for a world where most code is written by agents, and the first company to nail the foundation wins.&lt;/p&gt;
&lt;p&gt;Think about it: if 99% of code is agent-written in two years (which is where things are heading), then the code review, debugging, and understanding workflow we have today is fundamentally broken. You can&apos;t review AI-written code the same way you review human-written code. You need the &lt;em&gt;context&lt;/em&gt; — what was the agent trying to do, what constraints did it have, what alternatives did it consider.&lt;/p&gt;
&lt;p&gt;That&apos;s a platform opportunity, and $60M is the price of a credible attempt at it. Whether Entire is the one to build it is a different question — but the problem is real and urgent.&lt;/p&gt;
&lt;h2&gt;My Take&lt;/h2&gt;
&lt;p&gt;Dohmke knows exactly where GitHub&apos;s limits are (he ran it). The investor list — Felicis, Madrona, Olivier Pomel — signals real conviction. And the core insight, that agent context is as important as the code itself, is something I believe in my bones because I&apos;ve been hacking around it myself.&lt;/p&gt;
&lt;p&gt;Their long-term ambition seems to involve moving beyond git. I&apos;m more dubious about that part. Git is unkillable. My bet is that the reality will be hooks and duct tape around git for the next few years — and honestly, that&apos;s probably enough. Git&apos;s data model bends a lot further than people think before it breaks.&lt;/p&gt;
&lt;p&gt;There&apos;s a deeper tension, though. Entire&apos;s model assumes humans are still in the loop — driving agents, reviewing output, caring about attribution. But that&apos;s already not quite how it works. I haven&apos;t written a line of code in months. I describe what I want, the agent writes it, I tell it to fix its mistakes, and it does. I&apos;m not a developer anymore — I&apos;m a director.&lt;/p&gt;
&lt;p&gt;And the trajectory is obvious: agents won&apos;t need directors much longer either. If agents are fully autonomous, who&apos;s the audience for commit context and session transcripts? The agent doesn&apos;t need to remember what it was thinking — it can just re-derive it. The human who never touched the code doesn&apos;t need line-level attribution.&lt;/p&gt;
&lt;p&gt;That could go either way for Entire. Maybe full autonomy makes provenance &lt;em&gt;more&lt;/em&gt; critical — precisely because no human was involved, you need a machine-readable audit trail. Or maybe it makes the whole problem vanish — agents that manage their own context don&apos;t need git hacks to preserve it.&lt;/p&gt;
&lt;p&gt;Either way, if you&apos;re leading an engineering team right now, you should be thinking about how you&apos;ll audit, understand, and trust the code your agents produce — whether there&apos;s a human in the loop or not.&lt;/p&gt;
&lt;p&gt;Next up, I&apos;ll dig into the actual source code and show you &lt;a href=&quot;https://julien.danjou.info/blog/how-entire-works-under-the-hood&quot;&gt;how Entire&apos;s Checkpoints CLI works under the hood&lt;/a&gt;. It&apos;s a clever piece of engineering that abuses git internals in ways I genuinely admire.&lt;/p&gt;
</content:encoded><category>ai</category><category>git</category><category>developer-experience</category></item></channel></rss>