What is Infa
Infa Chrome Extension
How to use and install our Chrome Extension
Community
Browse community design systems
Release Notes
Featuring the latest changes to keep you up-to-date
Research Program
Participate in shaping the future of Infa
SOC 2 Type II Compliance Badge
Enterprise Ready
SOC 2 Type II certified for enterprise-level security and compliance
EventsLearnPricing
Sign up for free

Feedback

Share your feedback

Close
Anonymous submissions are auto-posted to #feedback channel. You can also share directly in Slack.

Need help?

Reach out to contact@infa.ai or see docs

Navigation
Search...
⌘ K
Focus sentinel
Close

Search Documentation

PressESCto close
Focus sentinel
Infa Documentation
  • General Information
    • Boards
    • Components
      • Main Components Vs Component Views
      • Component Tagging
      • Component Anatomy
    • Labels
    • Teams
    • Authentication
    • Permissions
      • Inviting People to Teams
      • Inviting People to Boards
    • Billing & Subscription
      • Managing Subscription
      • Promo Code Activation
    • Data Import, Export & Sync
      • Local vs. Cloud Boards
  • App Blocks
    • Building App Blocks
  • Chrome Extension
    • Deep Links
    • Using Labels
    • Updating the Extension
  • Integrations
    • MCP Server
    • Claude Code Plugin
    • External API
    • Progressive Web App
    • Figma Plugin
    • Coda Pack
    • Overview
    • Managing Runs
    • Board Agents
    • Overview
    • Infa Capture
    • Installation
    • Authentication
    • Connect a Board
    • Run Modes
    • Hooks & Agents
    • File Sync
    • CLI Reference
Switch to Light theme
Switch to Dark theme
TermsPrivacyChat with Us
  1. Docs
  2. Integrations

Hooks & Agents

How Infa CLI configures Claude Code hooks during automated runs to report progress back to the cloud.

During automated local and remote / cloud runs, Infa CLI automatically configures Claude Code hooks. These hooks report activity back to Supabase in real time, so the Infa web UI can show live progress as Claude works.

Interactive sessions (infa session start) do not use hooks.

Copy link
What are hooks?

Claude Code hooks are HTTP or shell callbacks that fire on specific events during a session. Infa writes them to .claude/settings.local.json in the target repo before spawning Claude. The file is automatically deleted when the session ends.

Copy link
Hook configuration

Infa writes three hook types:

.claude/settings.local.json (generated)
Copy code
Copy code
{
"hooks": {
"PostToolUse": [{
"matcher": "Edit|Write|MultiEdit|Bash",
"hooks": [{
"type": "http",
"url": "https://{project}.supabase.co/functions/v1/run-hook",
"timeout": 10,
"headers": { "Authorization": "Bearer {run_token}" }
}]
}],
"Stop": [{
"hooks": [{
"type": "http",
"url": "https://{project}.supabase.co/functions/v1/run-hook",
"timeout": 10,
"headers": { "Authorization": "Bearer {run_token}" }
}]
}],
"SessionEnd": [{
"hooks": [{
"type": "command",
"command": "curl -s -X POST '{hook_url}' -H 'Content-Type: application/json' -H 'Authorization: Bearer {token}' -d '{\"event\":\"session_end\",\"run_id\":\"{runId}\"}'",
"timeout": 1
}]
}]
}
}
HookWhen it firesType
PostToolUse (Edit|Write|MultiEdit|Bash)After every file edit or shell commandHTTP
StopWhen Claude finishes respondingHTTP
SessionEndWhen the Claude process exitsShell curl

Copy link
Environment variables

Claude is also spawned with these environment variables:

VariableValuePurpose
INFA_RUN_IDUnique run identifierIdentify the run in hook payloads
INFA_RUN_TOKENUser's OAuth access tokenAuthenticate hook requests
INFA_PAPER_IDCloud Paper ID (if set)Link session output to a Paper

These are available inside Claude sessions — for example, a custom agent prompt can reference $INFA_RUN_ID.

Copy link
The run-hook edge function

All hooks point to the run-hook Supabase Edge Function. This function:

  • Receives the event payload from Claude
  • Updates the run record in the runs table (status, session_url, etc.)
  • Stores the Claude session URL when detected in output (format: https://claude.ai/...)
  • Broadcasts updates via Supabase Realtime to the web UI

Copy link
Cleanup

Hooks are automatically removed when the session ends:

Session exits (code 0 or non-zero)
    └─ .claude/settings.local.json is deleted

If a session crashes before cleanup, the file is left on disk and will be overwritten the next time a run starts on the same repo.

warning icon
Don't commit settings.local.json
This file contains a bearer token. Ensure .claude/settings.local.json is in your .gitignore.

Copy link
Next steps

  • Run Modes — when hooks are active vs not
  • CLI Reference

Content Feedback

Feedback on selected content

Close
Anonymous submissions are auto-posted to #feedback channel. You can also share directly in Slack.

Need help?

Reach out to contact@infa.ai or see docs

PreviousRun Modes
NextFile Sync