#14567: feat(hooks): add entire-checkpoints bundled hook for AI session tracking
stale
size: M
Cluster:
Hooks Enhancements and Fixes
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
#9914: fix(hooks): resolve bundled hook dist paths and packaging checks
by zimmra · 2026-02-05
78.8%
#6405: feat(security): Add HTTP API security hooks for plugin scanning
by masterfung · 2026-02-01
75.0%
#7771: Hooks: wire lifecycle events and tests
by rabsef-bicrym · 2026-02-03
73.7%
#11817: fix(build): compile bundled hook handlers into dist
by AnonO6 · 2026-02-08
73.0%
#15571: feat: infrastructure foundation — hooks, model failover, sessions, ...
by tangcruz · 2026-02-13
72.8%
#6017: feat(hooks): add systemPrompt and tools to before_agent_start event
by yajatns · 2026-02-01
72.4%
#6630: feat(hooks): add agent:turn_start and agent:turn_end lifecycle events
by drdigital13 · 2026-02-01
72.3%
#14222: core: add needsApproval to before_tool_call; move AgentShield to ex...
by Eventedge · 2026-02-11
72.1%
#17667: feat: tool-hooks extension — run shell commands on tool calls
by FaradayHunt · 2026-02-16
72.0%
#7580: feat: add message:received internal hook with prompt injection
by rodrigoschott · 2026-02-03
71.8%