08. Extending Matcha

Goals, workflows, and deep research

These commands coordinate long-running work on this machine: an autonomous goal, a saved Rhai workflow, or the built-in deep-research run. They are **session-gated**. If the matching tool is not registered, the slash entry is hidden — treat the command as unavailable for that session.

When they appear

CommandGate in this session
/goalGoal mode is on **and** the goal tool is registered (update_goal, or the workflow-engine host driver)
/workflow, /deep-researchThe workflow tool is registered
/workflow pause|resume|stop|saveSame, **or** this session already has workflow runs
/workflowsPager command; **fullscreen only** (not /minimal)

Defaults in config resolve **on** unless a kill-switch (GROK_GOAL=0, GROK_WORKFLOWS=0, or remote false) turns them off. Those names are compatibility environment variables, not a Grok product path.

`/goal` — one objective, many rounds

If /goal is in the slash menu:

/goal Migrate the auth module to the new API
/goal Migrate the auth module --budget 200000
/goal status
/goal pause
/goal resume
/goal clear

Arguments are <objective> [--budget <tokens>], or status / pause / resume / clear. --budget must be a trailing, standalone flag with a positive integer. That budget is **tokens** for the goal run, not the assistant-count budget workflows use.

Matcha CLI keeps the goal active until an independent evidence review can reproduce the claim. If the review cannot, the goal stays active or pauses with gaps. /goal with no text (or status) reports the current goal.

Which driver runs it depends on background workflows: with them on, the host evaluates rounds and verifies completion candidates; with them off, the model-facing update_goal path reports progress.

If / hides goal, /goal is unavailable in this session.

`/workflow` — launch or manage a named run

If the workflow tool is registered, saved scripts live in:

  • Project: <repo>/.matcha/workflows/*.rhai (legacy .grok/workflows/ is still scanned)
  • User: ~/.matcha/workflows/*.rhai

The filename stem must match meta.name. Project workflows follow folder trust (same store as hooks).

/workflow review-changes {"target":"origin/main...HEAD"}
/workflow pause review-changes
/workflow resume review-changes
/workflow stop review-changes-2
/workflow save review-changes

Launch the same definition twice and display names number (review-changes, review-changes-2). Use that name, not an internal run ID.

A same-process pause/resume continues the original script, args, and agent_budget from committed host-call results. A **budget-limited** run cannot bare-resume with /workflow resume <name> — the cap has to be raised through a model/tool resume. Runs interrupted by a process restart are not resumed. Resume is not exactly-once: an effect whose result was not committed can run again.

/workflow save writes a project copy. Save is disabled for known built-ins and numbered duplicate handles — pick a new unique meta.name.

`/workflows` — the run dashboard

/workflows

Fullscreen only. This is the **live run** list (phase, assistants, progress), not a catalog of .rhai files. In a run's detail view: p pause, r resume (ordinary pauses), x stop, s save (when allowed).

If you are in /minimal, Matcha CLI tells you to /fullscreen first.

`/deep-research` — bounded research workflow

If /deep-research is in the menu:

/deep-research Compare the migration risks of PostgreSQL 17 and MySQL 9

This launches the **built-in** deep-research workflow. The command returns immediately. Watch /workflows; the report lands in the conversation. Claims that survive an independent verifier are cited; failed shards and dropped claims mark the report **Partial**.

Named slash launches use the default assistant budget (128 logical child calls, host concurrency cap typically 32). That is not /goal --budget.

If /deep-research is not in the menu, the workflow tool is not registered for this session — the command is unavailable.

What you should see

You ranResult
/ shows goalGoal tool is live; /goal … is a procedure
/ hides goalUnavailable in this session
/workflow <name> …Background run; follow in /workflows — or hidden if ungated
/deep-research <query>Built-in research run, or hidden if ungated
/workflows in minimalError pointing at /fullscreen