What session hooks do
When you work with an AI coding agent (Claude Code, Codex, Cursor, GitHub Copilot), the agent makes better decisions when it knows your deployment context: which organisation, applications, and AWS accounts you are working with. A session hook injects that context automatically when an agent session starts. Instead of the agent runningfjall status itself, the hook runs a lightweight status check and supplies the result as ambient context.
Install hooks
Hooks are not installed automatically. Run the installer once:| Agent | Configuration file | Hook key |
|---|---|---|
| Claude Code | ~/.claude/settings.json | hooks.UserProjectConfig |
| Codex | ~/.codex/hooks.json | pre-session event |
fjall status --agent --budget minimal, which outputs a compact summary of your deployment state in roughly 50 tokens.
What the hook provides
Installer output
On success, the installer prints the files it wrote and how to manage the hooks:Opting out
Temporary (single invocation)
Set the environment variable before running a command:FJALL_DISABLE_HOOKS=1 is set, fjall agent install-hooks skips installation.
Permanent (survives upgrades)
- Removes Fjall session hooks from all detected agent configuration files.
- Writes a
~/.fjall/hook-opt-outsentinel file. - Stops future installs while the sentinel exists.
Re-enabling after opt-out
--force-install flag removes the opt-out sentinel and installs fresh hooks.
Idempotency and updates
| Behaviour | What happens |
|---|---|
| Running the installer again | Updates the existing hook in place. It does not create duplicates. |
| Malformed hook entry | The installer overwrites it cleanly. |
| Updated hook command | A later install rewrites the hook entry with the current command. |
Security considerations
| Property | Detail |
|---|---|
| Read-only | Hooks run only the fjall status command. They never modify infrastructure. |
| Existing credentials | The hook runs with whatever credentials are already configured in your environment. |
| No external data | No data leaves your machine beyond what fjall status reads from the Fjall API. |
| Local output | Hook output goes to the agent’s context window, not to any third-party service. |
Next Steps
Agent Mode
Use Fjall from AI coding agents with structured TOON output.
Log In
Authenticate the Fjall CLI before running agent commands.
Connect AWS
Connect an AWS account so the CLI has deployment context to inject.