Skip to content

The session hook

The plugin keeps your files current by running aegis sync when you send Claude Code a message. This is a hook: a command Claude Code runs when something happens.

 you send a message
        │
        ▼
 plugin: has it been 5 minutes since the last sync?
        │ no ─────────────────────────────┐
        │ yes                             │
        ▼                                 │
 aegis sync  (updates changed files)      │
        │                                 │
        ▼                                 ▼
 Claude Code reads your message, with the latest rules

How it behaves

  • It syncs at most once every five minutes, so most messages skip it.
  • It never holds you up. If Aegis can't be reached, your key has stopped working, or anything else goes wrong, Claude Code carries on as normal and the error goes to ~/.config/aegis/hook.log.
  • It leaves files you've edited alone, just like aegis sync.

What you might see

Usually nothing. Two notices can appear, each at most once a day:

  • A newer version of Aegis is available. Run aegis update.
  • Aegis isn't managing this computer's files, if you haven't run aegis manage. Your repositories still update.

If updates seem to stop

Run aegis doctor, or /aegis:doctor in Claude Code. Then look in ~/.config/aegis/hook.log for errors the hook recorded.