Skip to content llms.txt

Factory Droid — Hooks

File format
JSON
Discovery path
.factory/settings.json
Syllago install method
JSON merge
Symlink support
No
Config file
.factory/settings.json
Handler types
command

Hook events

Canonical Event Native Name Category
after_tool_execute PostToolUse Tool
agent_stop Stop Lifecycle
before_compact PreCompact Context
before_prompt UserPromptSubmit Lifecycle
before_tool_execute PreToolUse Tool
session_end SessionEnd Lifecycle
session_start SessionStart Lifecycle
subagent_start SubagentStart Lifecycle
subagent_stop SubagentStop Lifecycle

Features

How each feature converts to syllago's canonical format. See format conversion for what these statuses mean.

Fields

Native frontmatter or config fields this provider exposes. The first column is the provider's own field name; the canonical key column links to syllago's cross-provider equivalent.

Provider fieldConversionCanonical keySummary
hooks Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → JSON config under top-level hooks key with matcher patterns (exact, regex, or *) routing to command-type entries.
PreCompact Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → Fires before context compaction, allowing hooks to inject memory or state into the compaction prompt to preserve important context.

Other features

Behaviors, conventions, and capabilities that aren't tied to a single named field — things like path-based activation, discovery rules, and lifecycle behavior.

FeatureConversionSummary
decision_control Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → hook_exit_code_behavior: Factory Droid hooks use exit codes to signal block (non-zero) or allow (zero) decisions on the triggering action
Hook Events Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → Nine hook events including PreToolUse (block), PostToolUse (rerun), UserPromptSubmit (modify inputText), Stop, SubagentStop, PreCompact, SessionStart, SessionEnd, Notification.
Hook Exit Code Behavior Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → Exit code 2 suppresses output; JSON output fields decision, reason, stopReason, inputText, suppressOutput; FACTORY_TOOL_INPUT env var provided.
Hook Scope Files Not portable Conversion type: Not portable Unique to this provider — can’t be carried across providers. Learn more → Hooks live in scoped settings files: ~/.factory/settings.json (global), .factory/settings.json (project), .factory/settings.local.json (local), plus plugin settings.

Sources

Source
https://docs.factory.ai/cli/configuration/hooks-guide
https://docs.factory.ai/reference/hooks-reference