Grok Build tracing with Future AGI
Set up Grok Build tracing with one command. See each prompt, reconstructed model responses, token usage, tools, and subagents in Future AGI.
Trace Grok Build prompts in Future AGI with the maintained @traceai/grok-plugin package. Each prompt becomes one trace with model responses, tool calls, and nested subagents; a shared session ID groups prompts from the same conversation.
This integration uses Grok’s native plugin hooks and local transcripts. It traces the Grok Build CLI, not the Grok model inside another editor or calls from your own application to the xAI API.
What it traces
| Trace element | Captured information |
|---|---|
| Prompt | One root trace per user prompt, with input, output, timing, and completion or error status. |
| Model responses | Generations reconstructed from Grok’s transcript, with model identity and message input/output when available. These represent assistant messages, not exact provider request boundaries. |
| Tokens | Grok’s reported turn-level usage, recorded once on the root rather than duplicated across reconstructed generations. |
| Tools | Tool name, call ID, duration, input/output, and success, failure, or permission-denied status. |
| Subagents | Nested agent spans with their own tools and reconstructed responses when Grok supplies the parent/child relationship. |
| Sessions | A session ID shared across prompt traces, including resumed conversations. |
Missing provider data is not estimated. Reconstructed responses do not provide exact provider-call timing or per-call token counts. This integration does not estimate model cost.
Before you start
- Grok Build 1.0.77 or later in the 1.x series, installed as
grokon yourPATH, with a working model configuration. - Node.js 22.16 or later and npm on your
PATH. - A Future AGI account.
The setup below is for headless CLI prompts (grok -p). Interactive TUI tracing is not yet available.
Quick start
Get your Future AGI keys
Create an API key and secret key in Future AGI API keys. Keep them ready for the setup prompts; do not paste them into a Grok conversation or command arguments.
Set up tracing
Run this in your terminal:
npx @traceai/agents setup grok --project coding-agentsSetup asks for your keys with hidden input, validates the destination, saves a private configuration, and installs the native futureagi-grok plugin. Approve the prompt allowing that plugin to run tracing hooks. Start a new Grok process after setup.
Warning
Content capture is on by default: prompts, model responses, and tool input/output may include source code or files the agent reads. To keep only structure and metadata, add --no-capture-content to the setup command. See Privacy before tracing a sensitive repository.
Run the agent and open the trace
grok -p "List the files in this folder and read README.md"Open Observe in Future AGI and select the coding-agents project. Open the prompt’s trace to inspect its model responses and tool calls. A later prompt, including one in a resumed session, gets its own trace with the same session ID.
You run Grok directly after setup; no tracing wrapper or background service is required.

Select a tool call, then the final model call, to see inputs, outputs and token usage
Configuration
Content capture is on by default: prompts, model responses and tool input/output can include source code and secrets the agent reads. Add --no-capture-content to setup to save a content-off preference, or set FI_AGENT_CAPTURE_CONTENT=false in the agent’s launch environment for a process-level opt-out. Structure and available usage remain visible.
| Setting | Purpose |
|---|---|
FI_API_KEY, FI_SECRET_KEY | Override saved credentials as a complete pair. Use hidden setup prompts or secret-manager environment injection, never command arguments. |
FI_PROJECT_NAME | Future AGI project receiving traces. Rerun setup to approve a changed project when using saved credentials. |
FI_AGENT_CAPTURE_CONTENT=false | Turn off prompt, response and tool-content capture for the process. Content capture is on by default. |
FI_AGENT_ENABLED=false | Disable tracing for the process. |
FI_USER_ID | Set an explicit user identifier; otherwise setup creates an opaque local ID. |
FI_BASE_URL | Self-hosted API origin. Approve it through setup with --base-url <origin>. |
FI_OTLP_ENDPOINT | Exact OTLP/HTTP traces URL; takes precedence over FI_BASE_URL. Saved credentials still require destination approval. |
FI_AGENT_CONFIG_DIR | Override the shared protected configuration directory, normally ${XDG_CONFIG_HOME:-$HOME/.config}/futureagi/agents. |
Environment variables take precedence over saved settings. Pass the variables to the shell that launches Grok; variables set in a different terminal do not affect an already-running process.
Agent-specific settings
| Setting | Purpose |
|---|---|
~/.grok/futureagi.json | User-level tracing settings. |
~/.config/futureagi/agents/credentials.json | Owner-only credential profiles, saved with file mode 0600. XDG_CONFIG_HOME or FI_AGENT_CONFIG_DIR can relocate the shared configuration directory. |
<repository>/.grok/futureagi.json | Optional repository settings discovered from Grok’s working directory. Keep credentials out of this file and out of source control. |
User and project scope
--project coding-agents names the Future AGI project; it does not select a repository-level plugin installation. Grok plugin installation is user-scoped. Project-scoped plugin installation with --scope project is not yet available.
CLI commands inspect the current repository’s settings by default. Add --user-only to inspect or configure just the user layer, or --project-dir /path/to/repository to inspect a different repository. --user-only applies to that CLI command; Grok hooks still discover settings from the repository where Grok runs.
Repository settings cannot silently redirect saved credentials to another destination. Run setup in the intended repository and approve the displayed project and destination when prompted. Repository settings also cannot re-enable content capture disabled by your user settings.
Manage tracing
npx @traceai/agents status grok --check
npx @traceai/agents doctor grok
npx @traceai/agents disable grok
npx @traceai/agents enable grok
npx @traceai/agents update grok
npx @traceai/agents uninstall grok
Use status grok --json for machine-readable output. Registration and activation are separate: run a prompt before expecting activation or export evidence. An accepted export confirms delivery to the collector, not that you have opened the trace in Observe.
Uninstall preserves credential profiles and plugin data; it does not remove unrelated Grok plugins or delete traces already stored in Future AGI.
Troubleshooting
Setup reports TRUST_REQUIRED. The plugin is installed locally but has not been approved to execute. Rerun setup in an interactive terminal and approve the specific Future AGI plugin. Non-interactive setup does not grant plugin execution trust; complete approval in a terminal before running Grok. Do not disable trust checks globally.
No trace appears. Run npx @traceai/agents doctor grok from the same repository, then grok inspect to check that futureagi-grok is enabled. Start a fresh Grok process and run a headless prompt to completion. Check the project and destination shown by status, and look for a recent accepted export. If authentication is rejected, rerun setup with --replace-credentials and enter the new pair at the hidden prompts.
Status reports a missing runtime. If Node or the installed plugin runtime moved, rerun setup using your current Node installation, then start a new Grok process.
You previously installed the hook-to-OTLP integration. Remove only its legacy ~/.grok/hooks/futureagi.json hook file before enabling the new plugin, to avoid duplicate traces. Keep unrelated hooks and permission guards. The new package uses ~/.grok/futureagi.json for settings; that is a different file.
An interrupted prompt has no complete trace. A forced exit or Ctrl+C can prevent Grok from writing terminal transcript records. The integration does not invent a successful completion or a cancellation outcome when those records are missing; the trace may be incomplete or absent.
Model responses have no individual token count. Grok reports usage for the turn, so look at the root trace’s token totals. Do not add those totals again for each reconstructed response.
Privacy
With content capture on, prompts, model responses, and tool input/output can leave your machine, including file contents read by Grok. The package bounds captured fields and redacts common secret patterns, but redaction is not a guarantee that all sensitive content is removed.
To run without content capture:
FI_AGENT_CAPTURE_CONTENT=false grok -p "List the files in this folder"
For a saved preference, rerun setup with --no-capture-content. Structure, model metadata, token usage, timing, tool names, and statuses remain available. Turning capture off does not delete earlier exports or Grok’s own local transcripts.
The plugin reads the local transcripts associated with Grok hook events to reconstruct responses and usage. Its additional on-disk state stores structural event anchors, not copies of prompts, responses, or tool bodies. Export failures do not block your Grok prompt.
Questions & Discussion