Skip to content

Cowork hook integration for SessionEnd capture #37

Description

@Paul-Kyle

What

Mirror the Claude Code SessionEnd hook integration (shipped in #32) for Cowork. When a Cowork session ends — including /clear, logout, or normal exit — auto-capture a snapshot to palinode-api.

Context

#32 landed palinode init which scaffolds .claude/CLAUDE.md, .claude/settings.json, .claude/hooks/palinode-session-end.sh, and .mcp.json in a project. Claude Code has a documented hook surface with a SessionEnd event and matcher: \"clear\" value that fires on /clear, so the integration is straightforward.

Cowork's hook model is different and, as of 2026-04, not fully documented:

Scope

  • Verify current Cowork hook surface (read docs, test `hooks/hooks.json` in a Cowork plugin)
  • If lifecycle hooks work: add a Cowork branch to `palinode init` that writes the equivalent config
  • If not: ship a Cowork-flavored skill or global-instructions template that prompts `palinode_session_end` before `/clear`
  • Add a `--surface cowork` flag to `palinode init` (or auto-detect)
  • Document in `examples/hooks/` and `docs/INSTALL-CLAUDE-CODE.md` (rename to `INSTALL.md`?)

Depends on

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions