What session hooks do
An agent makes better decisions when it already knows whether the CLI is logged in, which organisation it is logged in to, and which Fjall project the session opened in. A session hook supplies those facts at session start, so the agent spends no turn discovering them.fjall agent install-hooks writes one SessionStart entry into ~/.claude/settings.json:
Fjall identifies its own hook by exact command equality. An entry running any
other command is treated as somebody else’s hook, so
fjall agent uninstall-hooks leaves it alone and the next install adds a second, real
entry beside it. Copy the command string verbatim if you hand-edit
settings.json.--agent; they just get no hooks.
Install hooks
Hooks are never installed automatically. Run the installer once:hooks.UserProjectConfig entry left behind by a CLI older than 19.0.0. That key was never read by Claude Code, and both install and uninstall delete it.
What the hook provides
The hook runsfjall agent session-context, which prints a TOON record. Run it yourself to see exactly what your agent receives:
Degraded output
A failed probe never becomes a wrong answer.auth: unknown means the question could not be asked, which is different from auth: logged_out, and the degraded field names the probe that fell over so the agent can tell the two apart.
unknown, never logged_out, so a flaky link cannot tell your agent to re-authenticate.
Installer output
On success the installer prints the file it wrote and how to manage the hook:Opting out
Suppress installation
FJALL_DISABLE_HOOKS=1 is read by the installer only, so it governs whether hooks get written and nothing else:
Skipped: all (opt-out active). Setting the variable on any other command has no effect, and it does not disable a hook that is already installed. To stop an installed hook running, remove it.
Remove and stay removed
- Removes the Fjall
SessionStartentry (and any legacyUserProjectConfigentry) from~/.claude/settings.json. - Writes a
~/.fjall/hook-opt-outsentinel file, or$FJALL_CONFIG_DIR/hook-opt-outwhen you have relocated the state root. - Skips future installs while the sentinel exists.
Re-enabling after opt-out
--force-install deletes the opt-out sentinel and installs a fresh hook.
Idempotency and repair
Fjall never rewrites a
settings.json it cannot parse, because overwriting it would destroy whatever else you keep there.
Security considerations
Next Steps
Agent Mode
Drive Fjall from an AI coding agent with structured TOON output.
Log In
Authenticate the CLI so the hook can report your organisation.
Connect AWS
Connect an AWS account to give the agent real deployment context.