Session Insights CLI reference

CLI reference

This page documents every command supported by the forgebench CLI. Most users only need forgebench setup, described in Getting started. Refer to this page for commands and flags beyond that basic setup.

Getting help

Every command below also supports --help, which lists the same flags documented here.

forgebench --help
forgebench run --help

To check the installed version, run forgebench --version.

Setup

Guided, opt-in setup. Run it with no flags for the keyboard-driven flow described in Getting started: choose the ForgeBench URL, sign in, pick tools and a history window, review the local preview, then approve sync and upload.

# Guided setup
forgebench setup

# Ask about automatic sync and the first upload separately
forgebench setup --advanced

# Non-interactive: sign in first, then configure one tool and upload
forgebench login
forgebench setup --tool claude_code --since 30d --install-hooks --sync-now
FlagDescription
--tool claude_codeSelect a tool. Repeat it to select several. Required when setup is not run in an interactive terminal. Accepted values: claude_code, codex, cursor, antigravity, github_copilot, opencode.
--url https://app.forgebench.aiThe ForgeBench app URL for your environment. The guided flow asks for it on the first screen.
--since 7dHistory to preview and upload once. Accepted values: 3d, 7d (default), 30d, 90d.
--no-previewSkip the local preview.
--sync-nowUpload the selected tools after the preview. Requires a stored login.
--install-hooksEnable automatic session-end sync for the selected tools. Antigravity has no session-end hook; use schedule for it.
--advancedChoose automatic sync and upload separately instead of the single yes/no prompt.
--statusShow the selected tools and hook status.
--uninstallRemove the session-end hooks and clear the selected tools.

Run

Parses local session logs, scores them, and optionally submits the result. This is the base command that other commands build on.

# First run: process all historical sessions and submit the result
forgebench run --all --push

# Daily check: local only, nothing submitted
forgebench run --since 24h
FlagDescription
--allProcess all historical sessions rather than only recent ones. Recommended for the first run.
--since 7dLimit processing to sessions started within this window. Accepts values such as 7d, 24h, and 2w.
--pushSubmit the result to Forgebench. Without this flag, the command only writes a local file.
--tool claude_codeRestrict processing to a single tool. Accepted values: claude_code, codex, cursor, antigravity, github_copilot, opencode.
--output path.jsonFile path to write the result to. Defaults to profile.json in the current directory.
--no-usageExclude token counts and collect only the working-style profile.
--no-repoSkip reading git history entirely.
--no-metaOmit the git branch associated with each session.
--machine-name office-macLabel this machine's usage with a name, so an administrator can identify the source.
--team platformTag this machine's usage with a team name.
--no-ai-analysisSkip generating the written summary of working style. Reduces run time and incurs no cost.
--clear-cacheClear any results that previously failed to submit and are queued for retry.
--project valueRestrict processing to a single project. Intended for advanced or scripted use; the value is a hash, not a folder name.

Login / logout

# Sign in through a browser (also available inside setup)
forgebench login

# On a remote machine without browser access, sign in with a key provided by an administrator
forgebench login --key

# Remove the stored key from this machine
forgebench logout
CommandDescription
loginSign in through a browser for the selected environment. --sso is also accepted.
login --keyEnter an API key privately, useful on SSH.
logoutRemove the stored key from this machine.

Schedule

Runs run --all on a recurring interval, so reporting does not depend on running the command manually.

# Run automatically once a day
forgebench schedule enable --interval daily

# Disable the schedule
forgebench schedule disable
CommandDescription
schedule enable --interval dailyEnable a recurring run. Accepted values: hourly, daily (default), weekly.
schedule disableDisable the recurring run.

Sync

The command the session-end hook runs internally. It is not normally run directly; it is documented here for completeness and is useful for running a hook's exact command manually if the hook appears to be stuck.

forgebench sync --quiet
FlagDescription
--quietSuppress output. This is the flag the hook itself passes.
--tool claude_codeSync a single tool instead of everything the hook normally covers.
--foregroundRun in the current terminal instead of in the background. Useful for confirming the command works.

Hooks

Enables automatic reporting whenever a session ends. This is the recommended, set-and-forget configuration and is the option used in Getting started.

# Enable automatic reporting
forgebench hooks install

# Also report after every response, not only when a session ends
forgebench hooks install --on-stop

# Only one tool (repeat --tool to pick several)
forgebench hooks install --tool codex
forgebench hooks install --tool opencode

# Check whether the hook is enabled and when it last ran
forgebench hooks status

# Disable automatic reporting
forgebench hooks uninstall

# Disable it for one tool only
forgebench hooks uninstall --tool claude_code
CommandDescription
hooks installEnable automatic reporting for selected tools. OpenCode uses a user-level plugin triggered when a session becomes idle.
hooks install --on-stopAlso report after every response, not only when a session ends. Increases reporting frequency.
hooks install --tool codexEnable reporting for one tool only: claude_code, codex, cursor, github_copilot, or opencode. Repeat to pick several.
hooks install --print-managedFor an administrator deploying this fleet-wide: print the configuration for distribution via MDM instead of installing it locally.
hooks statusCheck whether the hook is enabled and when it last reported.
hooks uninstallDisable automatic session reporting.
hooks uninstall --tool claude_codeDisable it for one tool only.

Status

Displays a summary of the current state: installed version, sign-in status, whether the hook is installed, and whether a schedule is running.

forgebench status

Update

Checks whether a newer version is available and prints the install command to run. This command does not install the update itself, since a running program cannot safely replace itself while executing, particularly on Windows.

# Check the stable channel (the default unless the preview channel was selected)
forgebench update

# Check the preview channel instead
forgebench update --channel preview
FlagDescription
--channel previewCheck the preview channel (newer, less tested) instead of stable.

Uninstall

Removes the schedule, the hook, and the stored login: everything the CLI can safely remove on its own. It then prints the command to remove the program itself.

forgebench uninstall

Next