~/.gemini/settings.json. PeonPing provides a shell adapter with full CESP v1.0 conformance.
Setup
How It Works
Gemini CLI fires hook events and pipes JSON context to stdin:peon.sh expects:
Event Mapping
| Gemini CLI Hook | CESP Category | Trigger |
|---|---|---|
SessionStart (startup matcher) | session.start | Gemini CLI starts |
AfterAgent | task.complete | Agent finishes turn |
AfterTool (success) | task.complete | Tool succeeds |
AfterTool (failure) | task.error | Tool fails (exit_code ≠ 0) |
Notification | System notification | Gemini CLI notification event |
Tool Failure Detection
The adapter checksexit_code in AfterTool events:
task.error sounds with the tool name in stderr:
Hook Matchers
Gemini CLI uses matchers to filter when hooks fire:startup— Only fires on Gemini CLI startup*— Fires for all events- Custom patterns — Match specific tools or contexts
Configuration
Gemini CLI shares the global PeonPing config:- Config:
~/.claude/hooks/peon-ping/config.json - Packs:
~/.claude/hooks/peon-ping/packs/
Return Value
Gemini CLI hooks must return valid JSON. The adapter always returns{} to avoid breaking the hook chain:
Limitations
- No session end event — Gemini CLI doesn’t expose a session end hook
- No permission prompt detection — Tool approval events aren’t exposed
-
AfterTool fires for all tools — You might want to disable
task.completesounds if you use many tools: