grok-files

grok-files is a command for coding agents from antonbabenko/deliberation. It costs 26 tokens per session (992 once invoked), scanned A, original, MIT.

A command for managing files uploaded to Grok, xAI's AI service, by a bridge tool. It can list files or remove old bridge-owned uploads.

In plain words
What is it for?
Use it to list uploaded files, prune files older than a chosen age, run garbage collection, or synchronize the local file cache with Grok.
Why use it?
It helps find leftover uploads and clean them up before their automatic expiry. It limits cleanup to files marked as belonging to the bridge.

Command

Part of the deliberation plugin — 8 skills, 12 commands, 7 agents, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/antonbabenko/deliberation/grok-files
Clone the repo
git clone --depth 1 https://github.com/antonbabenko/deliberation

Or install deliberation, the plugin that ships this one along with the rest of its 8 skills, 12 commands, 7 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for grok-files

README.md
[![agentmods](https://agentmods.dev/badge/commands/antonbabenko/deliberation/grok-files.svg)](https://agentmods.dev/commands/antonbabenko/deliberation/grok-files)
Your own site
<a href="https://agentmods.dev/commands/antonbabenko/deliberation/grok-files"><img src="https://agentmods.dev/badge/commands/antonbabenko/deliberation/grok-files.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 992 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00026 $0.00992
Opus 5 $0.00013 $0.00496
Sonnet 5 $0.00005 $0.00198
Haiku 4.5 $0.00003 $0.00099

Measured 3d ago against content hash a131df1a9448, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

grok-files scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/grok-files.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Grok Files (storage cleanup)

List, prune, or gc the xAI files uploaded by the Grok bridge. Uploads are tagged with the filename prefix deliberation-, so the remote-side cleanup ONLY ever targets those - your own xAI files are never touched. Uploads also carry expires_after (default 7 days) so they self-delete; this command is for pruning orphans early, auditing what exists, or syncing the local SHA-256 cache with remote state.

Input

Sub-command + flags: $ARGUMENTS (e.g. list, prune --older-than 24h, prune --older-than 7d --yes, gc, gc --all-keys --force-local-prune)

Workflow

  1. Resolve the admin script via this sequence:

    1. Glob ~/.claude/plugins/cache/*/deliberation/*/server/grok/files-admin.js; pick the highest-semver match.
    2. Fall back to ${CLAUDE_PLUGIN_ROOT}/server/grok/files-admin.js.
    3. If none exists, abort: Error: deliberation plugin cache missing. Run /plugin install deliberation.
  2. Check auth: the script needs XAI_API_KEY in the environment. If it is unset, tell the user to export XAI_API_KEY=xai-... and stop (the script will error otherwise).

  3. Run the script with the user's sub-command (default list when $ARGUMENTS is empty):

    node "<resolved files-admin.js>" $ARGUMENTS
    
    • list - prints total file count and every deliberation-* upload (id, created, expires, name).
    • prune --older-than <30m|24h|7d|seconds> - dry run by default; prints what it WOULD delete (remote files).
    • prune --older-than <...> --yes - actually deletes the matched bridge-owned remote files.
    • gc - syncs the local SHA-256 cache (~/.cache/deliberation/grok-files.json; Windows %LOCALAPPDATA%\deliberation\grok-files.json, override with DELIBERATION_CACHE) with remote state via one paginated GET /v1/files. Prunes local rows whose fileId is no longer on xAI. Default scope: current XAI_API_KEY + XAI_API_BASE rows only.
    • gc --all-keys - widens the diff to foreign rows but leaves them when remote absence is ambiguous (the current key can't always see foreign files).
    • gc --all-keys --force-local-prune - drops ambiguous foreign rows anyway. May orphan files on xAI under foreign accounts.

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 71 lines · 26 tokens per session scan A a131df1a9448

Subscribe to this mod's changes

grok-files is a command published in the GitHub repository antonbabenko/deliberation (138 stars, last pushed 6d ago), licensed MIT. It adds 26 tokens to every session and 992 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.