Skip to main content
Glama

Session Hook Setup

faf_setup
Idempotent

Install or remove the native SessionStart hook in project settings so every Claude Code session starts with fresh .faf context. Previews first; writes only with confirm: true.

Instructions

Install the native SessionStart hook in the project settings (/.claude/settings.json) — every Claude Code session in this project starts with fresh .faf context. Shows the exact settings first (preview); writes only with confirm: true, install or remove. faf changes only its own hook entry; every other key and hook stays as written. remove: true takes out only the hook whose command is exactly the faf hook command. Never writes the user settings: the home folder is refused.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoProject path. Defaults to the current project context.
removeNoRemove the faf SessionStart hook (and only it) from the project settings. Previews unless confirm: true.
confirmNoWrite the change to the project settings (.claude/settings.json). Without it, faf_setup only previews — install and remove alike.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesWhat faf_setup did
messageYesHuman-readable summary
settingsNoThe full settings object as written (or as it would be written in preview)
hookCommandNoThe command the SessionStart hook runs
settingsPathYesThe settings file involved

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv6.0.0
  2. Removedv5.11.0
  3. Addedv5.9.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds substantial behavioral detail beyond the annotations: it previews before writing, requires confirm: true to mutate, modifies only its own hook entry, preserves every other key and hook, and refuses the user settings/home folder. These details clarify the safety envelope and mutation semantics, consistent with readOnlyHint=false, destructiveHint=false, and idempotentHint=true.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loads the main action before its conditions. It packs a lot into one long compound sentence, which is efficient but slightly dense. Every clause earns its place by covering install, preview, confirm, scope, and removal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter hook-management tool with a full output schema, the description covers the critical operational facts: default preview, confirm-gated write, removal behavior, scope of changes, and refusal of user settings. An agent has enough context to invoke it correctly without needing return-value details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters are already documented in the input schema. The description reinforces confirm and remove semantics, but does not add parameter syntax or formats beyond what the schema provides. A baseline score of 3 is appropriate when the schema carries the parameter-documentation burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: install the native SessionStart hook in the project settings. It also explains the downstream effect, that every Claude Code session starts with fresh .faf context, and covers both install and remove modes. This distinguishes it from sibling tools like faf_init or faf_context, which manage context rather than session-hook installation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear operating context: preview is the default, writes happen only with confirm: true, and remove: true targets only the faf hook. It also states an explicit exclusion, that user settings and the home folder are never written. However, it does not name or compare against alternative faf tools for related setup tasks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.