Skip to content

Consider hook-based automatic artifact capture for recap #358

@acreeger

Description

@acreeger

Summary

Currently, artifact capture in the recap system relies on agents manually calling add_artifact after creating comments/issues/PRs. A more deterministic approach would be to capture artifacts automatically via a PostToolUse hook.

Background

Research was done in #351 (see analysis comment) exploring this approach.

Proposed Approach

  1. Migrate hook to TypeScript - Move templates/hooks/iloom-hook.js to src/hooks/iloom-hook.ts and compile via tsup
  2. Add MCP client to hook - On PostToolUse for artifact-creating tools, spawn a recap-server instance and call add_artifact
  3. Pass config via env var - Use ILOOM_RECAP_FILE_PATH (already set) so hook's recap-server writes to same file

Tools to Monitor

  • mcp__issue_management__create_comment → artifact type comment
  • mcp__issue_management__update_comment → artifact type comment
  • Bash with gh pr create pattern → artifact type pr

Tradeoffs

Aspect Hook-Based Agent-Based (Current)
Determinism High - always captures Lower - agent may forget
Complexity Higher - MCP client in hook Lower - prompt guidance
Testing Harder (needs Claude Code) Easier (MCP unit tests)
Maintenance Single hook file 10+ template files

Status

The current agent-based approach is working well. This issue tracks the hook-based approach as a potential future improvement if we find agents are forgetting to log artifacts.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions