Skip to content

Bug: SessionStart hook with "compact" matcher not firing after compaction #760

@hermesthecat

Description

@hermesthecat

Environment

  • Droid CLI version: 0.70.0
  • OS: macOS (darwin 25.3.0)
  • Shell: zsh

Description

According to the hooks reference documentation, the SessionStart event should support a "compact"
matcher that fires after auto or manual compaction:

Matchers:

  • startup - Invoked from startup
  • resume - Invoked from --resume, --continue, or /resume
  • clear - Invoked from /clear
  • compact - Invoked from auto or manual compact

However, the SessionStart hook with "matcher": "compact" never fires after compaction.

Configuration

{
	"hooks": {
		"SessionStart": [
           {
             "matcher": "compact",
             "hooks": [
               {
                 "type": "command",
                 "command": "python3 ~/.factory/hooks/compact-reinject.py AGENTS.md",
                 "timeout": 10
               }
             ]
           }
         ]
       }
}

Steps to Reproduce

  1. Configure a SessionStart hook with "matcher": "compact" as shown above
  2. Start a Droid session and work until auto-compaction triggers (or use /compact)
  3. Check session logs for hook execution

Expected Behavior

After compaction, the SessionStart hook with "compact" matcher should fire, and the hook's output should be injected into context.

Actual Behavior
• The compaction_state event appears in session logs
• No SessionStart hook fires after compaction
• No hook output (e.g., additionalContext) is injected

Session log analysis shows:

  1. compaction_state entry exists with timestamp
  2. Next message after compaction has NO hook output injected
  3. The expected [RE-INJECTED AFTER COMPACTION: ...] context never appears

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions