Skip to content
← Back to Glossary

SessionEnd

ai-engineering hooks lifecycle

A lifecycle event that fires when an agent session ends.

↑ Contents

Definition

SessionEnd is a hook event that triggers when the user exits the agent or the session terminates. Scripts attached to this event can perform cleanup tasks, save session summaries, log metrics, or persist state. Like all hooks, SessionEnd scripts run as code outside the context window.

↑ Contents

Source

↑ Contents