convez.ai
AgenteAutomaçãoAvançado
elmerescandon

Greg — Orquestrador de Agentes Claude em Paralelo

elmerescandon/greg

Paraleliza teams de Claude Code com workspace compartilhada e coordenação automática

Ver no GitHub
InicialPluginScore · de 0 a 100

Agent multi-agente em Go que orquestra times de Claude Code trabalhando em paralelo em uma workspace compartilhada. Cada agente especializado executa em sessão tmux isolada, lê outputs dos colegas em tempo real, e um agente diretor coordena progresso, desbloqueia impasses e sintetiza resultados. Ideal para tarefas complexas que extrapolam limite de contexto de uma sessão única.

Instalação

$npx convez-ai elmerescandon/greg

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
2
Forks
0
Acompanhando
1
Saúde
42%
Último commit
há 4 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Relatórios de pesquisa multi-perspectiva (regulação, mercado, técnico)
  • Auditorias de codebase com especialistas em diferentes módulos
  • Migrações multi-arquivo com agentes focados em padrões específicos
  • Análise paralela de documentação complexa por domínio

Veredito

Greg resolve um problema real: sessões Claude isoladas não escalam em tarefas grandes. A arquitetura de agentes paralelos com workspace compartilhada e coordenador automático é sólida e bem pensada. Terminal-native sem dependências externas é força; falta documentação de edge cases e tuning de timeouts.

README

A tradução para o português deste README ainda está na fila.

greg

Orchestrate teams of Claude Code agents that collaborate in parallel.

The problem

A single Claude Code session hits its limits fast on big tasks — research reports, codebase audits, multi-file migrations. You run out of context, wait too long, or end up copy-pasting outputs between sessions manually. That doesn't scale.

How greg solves it

greg spawns multiple Claude Code agents that work in parallel on a shared workspace. Each agent owns a perspective, writes progressively, and can read what the others are producing in real time.

  • Parallel agents — split a task across specialists that run simultaneously, each in its own tmux session
  • Shared workspace — agents read and reference each other's outputs as they write; no copy-paste, no handoffs
  • Automatic director — a coordinator agent is injected into every task to monitor progress, unblock teammates, and produce synthesis notes
  • Monitor without interrupting — greg peek shows you what any agent (or all agents in a task) is doing right now, without attaching to their session
  • Fault tolerant — if an agent's session crashes before writing done, the coordinator moves it to review after 120 seconds so the director can verify before closing
  • Terminal-native — bash CLI + Go TUI, no external services, no API keys beyond Claude Code itself

Quick start

# Launch a 3-agent research task
greg task run \
  --goal "Research report on the state of AI regulation worldwide" \
  --agent "americas:Cover US, Canada, Brazil, and LATAM regulations. Skip Europe and Asia." \
  --agent "europe:Cover EU AI Act, UK, and European national frameworks. Skip other regions." \
  --agent "asia:Cover China, Japan, South Korea, India, and Singapore. Skip other regions."

# A director agent is added automatically to coordinate the team.
# All 4 agents start working in parallel immediately.

# Check what they're doing
greg peek mtask-xxxxxxxx

# ━━━ director (greg-a1b2c3d4) ━━━
# ⏺ Reading americas output... cross-referencing with europe findings on
#   bilateral AI safety agreements.
# ✻ Brewed for 3m 12s
#
# ━━━ americas (greg-e5f6a7b8) ━━━
# ⏺ Writing section on Brazil's AI regulatory framework...
# ✻ Crunched for 4m 5s
# ...

# When all agents finish, the director leaves synthesis notes:
cat ~/.greg/multi-tasks/mtask-xxxxxxxx/workspace/director-synthesis-notes.md

CLI reference

Sessions

greg spawn                                          # new session in $GREG_VAULT
greg spawn --name "refactor" --prompt "refactor auth module"
greg list                                           # sessions, tasks, and recent history
greg peek <session-id> [-n 50]                      # last N lines from a session (default 30)
greg attach <session-id>                            # attach to tmux session
greg kill <session-id>                              # stop and archive
greg resume <session-id>                            # resume a finished session
greg history [--limit N]                            # show last N finished sessions
greg schedule --prompt "..." --at "2026-07-01 09:00"  # one-shot scheduled task
greg cancel <task-id>                               # cancel a scheduled task

Multi-agent tasks

greg task run --goal "..." --agent "id:role" [--agent ...] [--criteria-file "id:/path/to/criteria.md" ...] [--preset coding|research] [--model alias|id]
greg task status <task-id>                # per-agent status, coordinator health, tmux state
greg task list                            # all tasks with statuses
greg peek <task-id> [-n 30]               # tail all agents at once
greg task message <task-id> "redirect X"  # send a message to the director
greg task done <task-id> <agent-id>       # force-mark an agent as done
greg task close <task-id>                 # close task (requires all agents done)
greg task resume <task-id> <agent-id>     # resume a finished agent with full context

# Agent messaging (used inside agent sessions, via skills)
greg send-msg --from <id> --to <id> --workspace <path> "message"   # send with timestamp
greg wait-msg --agent <id> --workspace <path> [--timeout <secs>]   # block until message arrives
greg check-msgs --agent <id> --workspace <path>                     # drain unread messages

Model aliases

--model accepts short aliases or full IDs:

AliasModel ID
opusclaude-opus-4-8
sonnetclaude-sonnet-4-6
haikuclaude-haiku-4-5-20251001

How multi-agent tasks work

~/.greg/multi-tasks/mtask-xxxxxxxx/
  manifest.json                    # task metadata, agent roles, session IDs
  workspace/
    director.md                    # director's coordination log
    director-synthesis-notes.md    # final consolidated output
    americas.md                    # each agent writes here progressively
    europe.md
    asia.md
  messages/
    americas→director.md           # agents message each other
    director→americas.md
  status/
    director.status                # working | waiting | needs-help | done
    americas.status                # working | waiting | needs-help | review | done
    ...
  1. greg task run spawns all agents in parallel, each in its own tmux session
  2. A director agent is auto-injected to coordinate, cross-pollinate, and synthesize
  3. Agents write to workspace/<agent-id>.md progressively — teammates can read in real time
  4. Agents communicate via greg send-msg — each message is appended with a timestamp; greg wait-msg blocks deterministically on fswatch until a reply arrives; greg check-msgs drains unread messages
  5. A background coordinator process polls status/ files every 15 seconds
  6. When a specialist finishes, it moves to review; the director verifies against <agent-id>.criteria.md and writes a verdict to <agent-id>.review.md, then moves the agent to done (or back to working with gaps)
  7. When all agents write done, the coordinator closes the task

Setup

Requirements

  • Claude Code (claude in PATH)
  • tmux
  • Go 1.22+ (for the TUI)
  • jq
  • fswatch (optional — enables event-driven wait-msg; falls back to 2s polling)

Install

git clone https://github.com/elmerescandon/greg
cd greg

# Add CLI to PATH
ln -s "$(pwd)/cli/greg" ~/.local/bin/greg

# Set your default working directory
echo 'export GREG_VAULT="/path/to/your/project"' >> ~/.zshrc
source ~/.zshrc

TUI

cd ui
go build -o greg-ui .
ln -s "$(pwd)/greg-ui" ~/.local/bin/greg-ui

The TUI is a Go/bubbletea terminal app with four views:

TabKeyDescription
ChatCtrl+1Session sidebar + Claude output panel
AgenteCtrl+2 / Ctrl+SpaceMulti-agent task browser with Command Center
MétricasCtrl+3Usage charts
ConfigCtrl+4Persistent preferences

Chat view (Ctrl+1)

The main interface. Left sidebar lists standalone sessions; right panel shows the active Claude output.

Sidebar navigation

KeyAction
Shift+↑/↓Navigate sessions
Shift+EnterOpen selected session

Chat panel

KeyAction
EnterSend message
Alt+EnterInsert newline
↑/↓Scroll output
PgUp/PgDnScroll by page
Alt+↑/↓Navigate input history
Ctrl+KPre-fill /compact
Ctrl+VPaste from clipboard

Agente view (Ctrl+2)

Task list with status, ID, creation date, and goal. Coding tasks are marked with ⌨.

KeyAction
↑/↓Navigate tasks
PgUp/PgDnScroll task list
EnterOpen Command Center for selected task
xClose task (if all agents are done)

Command Center — opened with Enter on a task:

Shows a table of all agents (status, messages in/out), workspace files, and message channels.

KeyAction
↑/↓Navigate agents / files / messages
EnterOpen selected file (glamour-rendered) or peek agent's tmux session
EscGo back

File / tmux peek sub-views

KeyAction
↑/↓, PgUp/PgDnScroll
EscGo back

Config view (Ctrl+4)

Preferences are persisted to ~/.config/greg/config.json.

SettingOptionsDefault
TemaDark mode / Light modeDark
Modelo por defectoopus / sonnet / haikusonnet-4-6
Esfuerzo por defectolow / medium / high / xhigh / maxhigh
Umbral compactación70–95%90%
Auto-compactactivado / desactivadodesactivado
Timeout idlenunca / 4h / 8h / 24hnunca

Navigate with ↑/↓, change values with ←/→.


Global keys

KeyAction
Ctrl+TNew session tab
Ctrl+WClose current tab
Ctrl+Shift+←/→Switch between tabs
Ctrl+QQuit

Presets

--preset coding

Creates an isolated git worktree at /tmp/greg-worktree-<task_id> and gives each agent role a specific skill:

  • Specialists receive coding/workflow — atomic commits with conventional format, build verification per stack, no push
  • Director receives coding/director — waits for all specialists to finish, runs integration build, resolves conflicts, does the single git push and creates the consolidated PR with gh pr create

The director is the only agent that pushes and opens a PR. Specialists only commit.

--preset research

Detects agent role by keyword (collector vs analyzer) and injects role-specific methodology:

  • Collector agents gather raw evidence only — structured output with source, date, quality flag, content, and contradictions
  • Analyzer agents work exclusively from workspace files to prevent anchoring bias; produce explicit confidence levels and bias detection checklist

Skills

greg injects prompt templates (skills) into each agent to define their behavior.

Agent templates — injected by the CLI into every task:

FilePurpose
agents/mailbox.mdWorkspace and messaging protocol — injected into every agent; exposes send-msg, wait-msg, check-msgs
agents/director.mdDirector: coordinate team, cross-pollinate findings, write synthesis
agents/teammate.mdSpecialist: progressive writing, proactive reading, status protocol

Invocable skills — used by humans via /skill-name, also injected by presets:

Skill pathInvocationPurpose
coding/workflow/SKILL.md--preset coding (specialists)Git workflow, build/test checklist, atomic commits
coding/director/SKILL.md--preset coding (director)Integration build, push, and consolidated PR
coding/issue/SKILL.md/greg-issueBuild a well-defined issue before handing work to a coding agent
research/collector/SKILL.md--preset research (collectors)Raw evidence gathering protocol
research/analyzer/SKILL.md--preset research (analyzers)Workspace-only analysis, bias detection, confidence levels
human/greg-task/SKILL.md/greg-taskDesign and launch a multi-agent task
human/greg-learn/SKILL.md/greg-learnConsolidate learnings from a conversation into persistent memory
human/greg-revise/SKILL.md/greg-reviseRevise and improve written content

Changelog

See CHANGELOG.md.

Ver o original no GitHub

Bom para

Relacionados