Receber por email
← Voltar para o catálogo

leave

Leave the Cortex agent team — removes .cortex.md, cleans CLAUDE.local.md, sets agent status to inactive in team directory.

12estrelas
Atualizado há 6 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add agentweave/cortex

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/leave/svg)](https://www.skillteca.com.br/skills/leave)
#ai

Skills relacionadas

Ver todas de Outros →

Alerta por categoria

Receba novas skills de Outros toda segunda

1 email curto, só com as skills novas de Outros. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

/leave — Leave the Cortex Agent Team

Remove this agent from Cortex by cleaning up local protocol files and updating the team directory.

Arguments

<agent-name> — the agent's name (e.g., "Billing Dev"). If not provided, ask: "What is this agent's name in Cortex?"

Steps

1. Resolve name and slug

Use the provided <agent-name>.

Derive the slug: lowercase, replace spaces with hyphens, strip any characters that are not alphanumeric or hyphens.

2. Check current state

Check if .cortex.md exists in the current working directory. Check if CLAUDE.local.md contains "## Cortex".

If neither exists, respond:

"This agent doesn't appear to be on the Cortex team. Nothing to clean up."

Stop.

3. Remove .cortex.md

If .cortex.md exists in the current working directory, delete it:

rm .cortex.md

4. Clean CLAUDE.local.md

If CLAUDE.local.md contains a ## Cortex section (the line ## Cortex through the next ## heading or end of file), remove that entire section using the Edit tool.

5. Cancel heartbeat and clean up hooks

5a. Use CronList to find any active cron whose prompt starts with Cortex (with trailing space). If found, cancel each with CronDelete. If no cron is found, skip — the agent may not have had a heartbeat running.

5b. If .claude/hooks/cortex-precheck.sh exists, delete it:

rm -f .claude/hooks/cortex-precheck.sh

5c. Read .claude/settings.json. If it contains a hook entry in the hooks.UserPromptSubmit array whose hooks array includes "command": ".claude/hooks/cortex-precheck.sh", remove that entry. Preserve all other hook entries. Write the updated JSON back.

6. Update agent note in team directory

Read ~/.cortex/config.yaml to get team_dir.

If config exists and <team_dir>/agents/<slug>/<slug>.md exists, read the agent note and check the current status field:

  • If status: active, replace with status: inactive using the Edit tool.
  • If status: inactive (already inactive), skip — no change needed.

If the config or agent note doesn't exist, skip this step (already cleaned up or never registered).

7. Confirm

Respond:

"{name} has left Cortex. .cortex.md removed, CLAUDE.local.md cleaned, team directory status set to inactive."
Compartilhar X LinkedIn