make deps # Install dependencies
make generate # Generate ent code
make gryph # Build binary
make test # Run tests
make lint # Run linter (golangci-lint)Always run make lint before submitting changes to catch issues early.
When modifying the Event model (core/events/event.go) or any payload types, run make generate-schema.
core/ → Domain models (events, sessions, audit, security) - most stable
config/ → Viper-based configuration
storage/ → SQLite + ent ORM
agent/ → Adapter pattern (claudecode/, cursor/ and more)
cli/ → Cobra commands as an App pattern
tui/ → Output formatters (table, json, csv)
cmd/gryph/main.go- Entry pointcli/root.go- App struct, dependency injectionagent/adapter.go- Agent adapter interfacestorage/storage.go- Store interface
- SQLite driver:
modernc.org/sqlite(pure Go, usessqlitenotsqlite3) - Config paths: macOS
~/Library/Application Support/gryph/, Linux~/.config/gryph/ - Storage layer fully implemented with ent ORM
- Self-audit logs tool actions (install, uninstall, config changes)
- Hooks configured in
~/.claude/settings.json(per official docs) - Hook types:
PreToolUse,PostToolUse,PostToolUseFailure,SessionStart,SessionEnd,Notification - Uses matcher pattern
"*"for tool hooks to capture all tools - Version detection via
claude -vcommand
- Hooks configured in
~/.cursor/hooks.json - Hook types:
beforeSubmitPrompt,beforeShellExecution,beforeMCPExecution,beforeReadFile,afterFileEdit,stop
- SessionID: Deterministic UUID derived from agent's session_id using
uuid.NewSHA1(uuid.NameSpaceOID, []byte(agentSessionID)) - AgentSessionID: Original session ID string from the agent, stored for correlation with agent's own storage (e.g., Claude Code transcripts)
- Sessions are created on first event and updated on subsequent events
- Session end detected from
SessionEnd(Claude Code) orstop(Cursor) hook types
docs/e2e.md- Writing and running E2E tests (test/cli/)docs/agent-adapter.md- Adding a new agent adapter
- Do not use unnecessary code comments
- Re-use existing code and patterns whenever possible
- Keep things simple, minimal, extensible, maintainable
- Code should be easy to understand and maintain
- Follow idiomatic Go code conventions, especially for error handling, testing (table driven tests) and documentation