Patch release 1.0.14: new grok usage CLI for persisted session token/cost totals, richer PostToolUse hooks that can feedback and rewrite model-facing tool output, plus tighter sandbox and symlink permission behavior.
Changelog
[new]grok usage <session-id> [turn] — print persisted token and cost usage for any local session as JSON (sessionId, updatedAt, session, turns). Omit the turn for session totals plus every recorded turn; pass a turn number for one turn. Session totals include history inherited by resume or fork. costUsdTicks is 10¹⁰ ticks per USD. Interactive credit/billing stays on /usage in the TUI. Shell completions cover bash, zsh, fish, elvish, and PowerShell.
[new]PostToolUse can correct a tool call after it ran — hooks may deliver a block reason and additionalContext to the model next to the real result, or replace the model-facing output (updatedToolOutput / MCP alias updatedMCPToolOutput) to redact secrets, trim noisy logs, and similar, while scrollback, transcript, and telemetry keep the original. Replacements for built-in tools must match Grok’s own tool output shape; MCP replacements pass through. Command and HTTP hooks support full replacement; SDK-registered hooks can still send block reason and context but not replace output.
[changed]PostToolUse / PostToolUseFailure semantics — PostToolUse fires when a tool actually finished (including built-in logical errors such as a non-zero terminal exit). Dispatch failures and MCP error results fire PostToolUseFailure, which can add additionalContext only. PostToolUse defaults to the 600s gate timeout (with Stop / SubagentStop). Stdout is read even though nothing is blocked.
[changed]PostToolUse exit 2 — exit 2 now feeds stderr to the model (JSON reason wins when present). Logging hooks that end with run_checker; exit $? can leak checker noise whenever the checker exits 2; end those hooks with an explicit exit 0 to stay silent. Non-zero exits keep a block reason but drop additionalContext and output replacement.
[changed]Hook envelope compatibility — events include hook_event_name (PascalCase Claude-style value) alongside hookEventName (Grok snake_case). PostToolUse also emits a tool_response alias of toolResult for Claude-oriented hooks.
[changed]SessionEnd hook budget — each SessionEnd hook is bounded by its own timeout (default 1.5s). Override the default with GROK_SESSION_END_HOOKS_TIMEOUT_MS (milliseconds, capped at 60s).
[changed]strict sandbox profile — reads CWD, essential system paths, and ~/.grok; writes are limited to CWD, ~/.grok/sessions, and temp dirs (not the whole ~/.grok tree). Global hook paths remain write-denied where write is granted. Sandbox debug events are logged under ~/.grok/sessions instead of ~/.grok/sandbox-events.jsonl.
[changed]File permission checks follow in-path symlinks — native Read/Edit/Grep deny and ask resolve the target; an allow that matches only the resolved path does not allow the original tool argument. An unresolvable in-path symlink prompts when any deny or ask file rule applies. Shell-touched paths use the same normalization and symlink follow for deny/ask.
[changed]Prompt suggestions — unset models.prompt_suggestion falls through remote, then the session model (not a fixed client default). New knobs: prompt_suggestions.max_output_tokens (16–256, default 64), prompt_suggestions.temperature (default 0.2), and prompt_suggestions.reasoning_effort (none / minimal / low / medium / high). ui.prompt_suggestions can be disabled fleet-wide by a remote kill-switch.
[new]features.repo_status_in_system_prompt — enable or disable repo status in the system prompt (default true). Also GROK_REPO_STATUS_IN_SYSTEM_PROMPT.
Under the hood
Managed configuration is split into store and supervisor paths, with deployment-config refresh via GROK_DEPLOYMENT_CONFIG_REFRESH_INTERVAL_SECS.
Settings cache (GROK_SETTINGS_CACHE), model startup prefetch, and prompt-suggestion resolution support faster/more consistent startup and ghost-text behavior.
Workspace filesystem monitoring and process helpers land alongside memory archive/upload work and a pager usage command path for the new CLI.
Embedded search tooling replaces a large set of previously vendored ripgrep-oriented crates inside the binary.
Optional UI dock work (GROK_DOCK_V2) and XAI_DESCRIBE_TYPE_TIMEOUT_MS for describe-type timeouts.
Upgrade notes
If you have PostToolUse hooks that exit with the checker’s status (exit $?), switch silent loggers to exit 0. Exit 2 now sends stderr to the model.
PostToolUse output replacement for built-in tools must echo Grok’s tagged toolResult shape; mismatched replacements are ignored (hook run recorded as failed).
Profiles or automation that assumed strict could write anywhere under ~/.grok should target ~/.grok/sessions (and temp) only; hook sources stay write-protected.
Prefer grok usage over reading session files for token/cost totals; /usage in the TUI remains the interactive billing surface.