Hooks & Permissions

Hooks are how Athena observes and controls agent runtimes. Each harness fires events at lifecycle points; Athena receives and processes them. The examples below use Claude Code's hook system, but the same event types are available on Codex via its event translation layer.

Hook Protocol

Claude Code → stdin JSON → athena-hook-forwarder → UDS NDJSON → Athena runtime

For events that expect a decision (interaction.expectsDecision: true), Athena writes a response back through the socket before the forwarder exits. Exit code 0 = passthrough, exit code 2 = block.

Auto-passthrough timeout: 5 seconds (5 minutes for permission/question events).

Hook Event Types

Tool Events (require "*" matcher)

Hook NameRuntimeEventKindCan Block
PreToolUsetool.preYes
PostToolUsetool.postNo
PostToolUseFailuretool.failureNo
PermissionRequestpermission.requestYes

Non-Tool Events

Hook NameRuntimeEventKind
SessionStartsession.start
SessionEndsession.end
UserPromptSubmituser.prompt
Stopstop.request
SubagentStartsubagent.start
SubagentStopsubagent.stop
Notificationnotification
PreCompactcompact.pre
Setupsetup

Blocking Decisions

Events marked "Can Block" allow Athena to respond before the agent proceeds:

  • passthrough — allow the action
  • block — deny with a reason string
  • json — structured response with intent

Athena's isolation policy evaluates tool.pre and permission.request events automatically. Decisions with source: 'rule' are auto-applied; decisions requiring user input pause the feed.

Isolation Presets

Control what the agent is allowed to do per-session:

PresetMCP ServersAllowed Tools
strictBlockedRead, Edit, Glob, Grep, Bash, Write
minimalProject serversAbove + WebSearch, WebFetch, Task, Skill, mcp__*
permissiveProject serversAbove + NotebookEdit

All presets use --setting-sources "" to fully isolate from Claude Code's own settings file. Tool enforcement is done via PreToolUse hooks, so Athena retains visibility over every tool call.

athena-flow --isolation=minimal

Workflows can declare an isolation preset. If the workflow requires a more permissive level than the user's setting, Athena upgrades it with a warning.