Skip to main content
Session hooks give Claude Code ambient awareness of your Fjall state before its first turn.

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.
Claude Code is the only host the installer writes to. Agents on other hosts — Codex, Cursor, Copilot — get agent mode output the same way every caller does, by passing --agent; they just get no hooks.

Install hooks

Hooks are never installed automatically. Run the installer once:
The installer also retires any legacy 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 runs fjall 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.
The command is cache-first and makes exactly one network call, a 2-second identity probe. Past that bound the answer is 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:
Upgrading from a CLI older than 19.0.0 adds one housekeeping line:

Opting out

Suppress installation

FJALL_DISABLE_HOOKS=1 is read by the installer only, so it governs whether hooks get written and nothing else:
The installer skips every target and reports 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

This command:
  1. Removes the Fjall SessionStart entry (and any legacy UserProjectConfig entry) from ~/.claude/settings.json.
  2. Writes a ~/.fjall/hook-opt-out sentinel file, or $FJALL_CONFIG_DIR/hook-opt-out when you have relocated the state root.
  3. 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.