Skip to content

Cowork hook integration for SessionEnd capture #37

@Paul-Kyle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions