| name | gigabrain |
| description | Ask 1-3 independent AI models for counsel, classify consensus and disagreement, and debate contested points before you answer or implement. Use when the user invokes /gigabrain, asks for a second opinion, a model council or debate, or multi-model review of a plan, diff, or decision. |
gigabrain
gigabrain is a local CLI council for model-assisted decisions. It never edits
files or runs commands itself. It asks one to three model seats for independent
counsel, builds a consensus map, and can run scoped debate rounds only where
the seats split.
Use it when a decision benefits from independent review: plans, architecture,
code review, risky edits, ambiguous product calls, or small self-contained
implementation alternatives.
Invocation
When invoked as /gigabrain <request> (or asked to "use gigabrain"), parse
the request first:
- If it begins with a mode word —
advise, council, or debate — use that
mode and drop the word from the prompt.
- If it is
escalate (or asks to debate the prior result), resume the most
recent gigabrain session from this conversation with --mode debate.
- Otherwise choose the mode yourself using the decision rule below.
Mode Ladder
Start with the cheapest mode that fits the risk:
advise: one model, one pass. Use at turn boundaries for a second opinion or
to emulate an advisor loop in the background before finalizing your own
answer.
council: two or three models, one independent pass. Use for real decisions
where disagreement is useful signal. This never cross-pollinates seats.
debate: two or three models, with scoped revision rounds. Use when a
council result has contested or majority items that matter.
Decision rule: quick low-stakes gut check → advise; anything the caller
will act on (plans, reviews, architecture) → council; never start at
debate — run a council and escalate its session only when the map shows
contested or majority items that matter.
Recommended default for agents:
gigabrain --mode council \
--models opus-4.8,gpt-5.5,glm-5.2 \
--output candidates --format json \
--repo . \
--prompt "..."
Seat selection: if the user set default models in
~/.gigabrain/config.json, omit --models and inherit their panel and
efforts. gigabrain config alone prints current defaults with resolved seat
efforts. Otherwise run gigabrain models once, pick 2-3 connected seats from
different model families, and suggest persisting them:
gigabrain config --models gpt-5.5:xhigh,opus-4.8:high.
Use --output candidates when you are the acting agent. Read every candidate
and the consensus map, then synthesize the final action yourself. Do not hide
the map from the human when it contains material disagreement.
Runs at high efforts can take several minutes with no stdout until done. If
your shell enforces command timeouts, start with --detach and poll
gigabrain status/gigabrain result instead of killing a live run. Add
--max-cost <usd> when the user has a budget expectation.
Escalating Council Results
If a prior council session ended with majority or contested items, escalate
it with debate instead of rerunning the full first round:
gigabrain resume --session-id "$SESSION" --mode debate --prompt "escalate"
Equivalent sentinel prompts include debate, escalate to debate,
debate this, debate the council result, debate the prior result, and
continue as debate.
For this specific path, --prompt may be omitted:
gigabrain resume --session-id "$SESSION" --mode debate
The CLI writes a stderr notice so you can tell which path ran:
notice: escalating prior council result means stored candidates seeded the
debate and round 2 starts immediately.
notice: starting a new debate turn means your substantive follow-up prompt
did not seed prior candidates and a fresh independent round 1 ran.
Debate sessions that end still contested are not re-escalated automatically.
Resume them with a new prompt only when you intentionally want another turn.
Planning And Review Patterns
Use blind variants when you want independent ideas before anchoring:
gigabrain --mode council --output candidates --format json --repo . --prompt '
Read the task and propose an implementation plan. Work independently.
Surface risks, missing tests, and any spec ambiguity.
'
Use critique variants when there is already a draft:
gigabrain --mode council --output candidates --format json --repo . --prompt '
Review this plan/diff/spec. Prioritize correctness bugs, security risks,
behavioral regressions, and missing tests. Return concrete findings first.
'
For code review, pass the diff or file paths in the prompt and include
--repo . so seats can verify claims against source. Treat the result as
counsel. You still own the final judgment.
Implement Sandwich
For risky implementation:
- Run a blind plan council before coding.
- Implement the chosen plan yourself.
- Run a diff-review council after coding.
- If the map has material contested items, escalate with
resume --mode debate
before finalizing.
This keeps planning independent from implementation while still giving the
final diff its own review pass.
Candidates As Code
For small, self-contained units, ask seats to write alternatives:
gigabrain --mode council --output candidates --format json --repo . --prompt '
Write the replacement implementation for function X only. Keep it compatible
with the existing tests and public API. Explain tradeoffs after the code.
'
Compare the candidate code, use the consensus map to identify disagreements,
then apply or adapt the best candidate yourself. Do not paste code blindly if
the map reports blockers or contested correctness claims.
Sessions
Persist the session_id from JSON output or the session: ... stderr line.
Use the same session for follow-up turns so each seat keeps its own transcript:
gigabrain resume --session-id "$SESSION" --prompt "Now account for the API limit."
Config resolution is flag > session carryover > config file > default. Override
models, mode, repo, output, or format explicitly when a follow-up needs a
different contract.
For long runs:
SESSION=$(gigabrain --detach --mode debate --models opus-4.8,gpt-5.5 \
--prompt "Review this migration plan")
gigabrain status "$SESSION"
gigabrain result "$SESSION" --format json
Detached stdout is only the session id. Progress and errors go to
~/.gigabrain/sessions/<session-id>.out.
Caller-Owned Tool Delegation
Use --tools <manifest.json> only when the acting agent can safely service
caller-owned tools. A manifest is a JSON object with a tools array. Each tool
needs name, description, and a JSON Schema parameters object:
{
"tools": [
{
"name": "run_tests",
"description": "Run the requested project test command.",
"parameters": {
"type": "object",
"properties": {
"command": { "type": "string" }
},
"required": ["command"]
}
}
]
}
If a seat requests delegated tools, the CLI writes a single JSON batch to
stdout and exits 10. Progress remains on stderr.
{
"session_id": "planning-council",
"requests": [
{
"call_id": "call-1",
"seat": "A",
"tool": "run_tests",
"args": { "command": "pnpm test" }
}
]
}
Service only the calls you trust, then resume with:
gigabrain tool-result --session-id planning-council --results '{
"session_id": "planning-council",
"results": [{ "call_id": "call-1", "result": "tests passed" }]
}'
gigabrain tool-result --results - reads the batch from stdin. Result entries
may use result, content, or text; set is_error: true for failed tool
calls. Successful delegated results are cached by tool name and arguments for
the resumed run, and delegated calls share the same per-seat iteration cap as
repo tools.
MCP callers pass tools as a manifest path, manifest object, or raw tools
array. MCP run and resume return structured { paused: true, tool_request: ... } content; resume with the tool_result MCP tool. Library
callers catch ToolRequestPause and resume with submitToolResults().
Grounding And Safety
Use --repo . only when repo contents may be sent to the selected providers.
gigabrain provides read-only read, grep, glob, and ls tools inside the
repo jail. It cannot write, execute, or access the network.
Repo content is untrusted input to seats. A hostile repository can still attempt
prompt injection, so verify high-impact claims yourself. Delegated tool names
and arguments are also model-provided input. Validate paths, schemas, commands,
side effects, and intent before executing anything outside gigabrain.
Output Discipline For Agents
When using JSON, stdout is a single document. Progress, warnings, notices, and
usage summaries are on stderr. The important fields are:
final: synthesized answer, or null with --output candidates.
candidates: anonymized seat outputs plus model metadata for you.
map.consensus: points all seats agree on.
map.majority and map.contested: items to review before acting.
warnings: degraded paths, missing pricing, skipped classification, and
related caveats.
When reporting back to a human, include material consensus-map items instead of
only your merged answer.