← Back to PRs

#14567: feat(hooks): add entire-checkpoints bundled hook for AI session tracking

by egorkaBurkenya open 2026-02-12 09:24 View on GitHub →
stale size: M
Summary Adds a bundled hook that integrates OpenClaw with Entire CLI for automatic AI coding session checkpoint tracking. Entire CLI (by ex-GitHub CEO Thomas Dohmke) captures full session context — prompts, transcripts, file attribution — and stores them on a Git orphan branch alongside your code. Companion PR This hook works with the OpenClaw agent integration in Entire CLI: entireio/cli#297 How it works The hook maps OpenClaw lifecycle events to Entire's agent hook verbs: | OpenClaw Event | Entire CLI Verb | Purpose | | --------------------------- | ------------------ | ---------------------------- | | gateway:startup | session-start | Initialize tracking | | command:new / command:reset | stop → session-end | Save checkpoint before reset | | command:stop | stop | Save final checkpoint |Files • src/hooks/bundled/entire-checkpoints/HOOK.md — Hook metadata + docs • src/hooks/bundled/entire-checkpoints/handler.ts — Event handler • src/hooks/bundled/entire-checkpoints/handler.test.ts — Tests Requirements • entire CLI in PATH • Project enabled with entire enable --agent openclaw Testing • E2E tested: gateway startup → file change → commit → checkpoint with Entire-Checkpoint trailer ✅ • Hook auto-discovered by bundled-dir scanner ✅ <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new bundled internal hook (`entire-checkpoints`) that invokes the external `entire` CLI on key OpenClaw lifecycle events (gateway startup, command new/reset/stop) to create checkpoints for AI session tracking. The hook is discovered via the existing bundled hook directory scanner (HOCK.md + handler.ts), and it gates execution on the presence of the `entire` binary and an `.entire/settings.json` marker file in the workspace. The handler maps events to Entire verbs (`session-start`, `stop`, `session-end`) and pipes a JSON payload to `entire hooks openclaw <verb>` over stdin. Tests were added, but currently they primarily validate that the handler doesn’t throw and do not assert that the expected `entire` invocations happen. <h3>Confidence Score: 3/5</h3> - This PR is moderately safe to merge, but has a few functional gaps that should be addressed first. - Core hook wiring is straightforward and gated, but the implementation doesn’t match documented behavior (payload prompt is never set) and relies on `which` for binary discovery, which can cause silent non-operation in some environments. The test suite added here doesn’t assert the intended `entire` invocations and would pass even if the hook never ran. - src/hooks/bundled/entire-checkpoints/handler.ts; src/hooks/bundled/entire-checkpoints/handler.test.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs