# Claude To Deerflow > Interactúa con la plataforma de agentes DeerFlow vía su API HTTP: envía mensajes, inicia threads, revisa estado, lista modelos/skills/agentes, gestiona memoria y sube archivos, o delega tareas de investigación. Fuente: https://skillsagentes.com/skills/bytedance/deer-flow/claude-to-deerflow Markdown: https://skillsagentes.com/skills/bytedance/deer-flow/claude-to-deerflow.md Repositorio: https://github.com/bytedance/deer-flow Autor: bytedance Licencia: MIT Actualizado: hace 3 meses Coste de contexto: 125 tok instalada, 1.7k tok al activarse, 4.6k tok con todos los archivos del bundle Bundle: 3 archivos, 18 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add bytedance/deer-flow --skill claude-to-deerflow --agent claude-code # Cursor npx -y skills add bytedance/deer-flow --skill claude-to-deerflow --agent cursor # Codex npx -y skills add bytedance/deer-flow --skill claude-to-deerflow --agent codex # Gemini CLI npx -y skills add bytedance/deer-flow --skill claude-to-deerflow --agent gemini # Windsurf npx -y skills add bytedance/deer-flow --skill claude-to-deerflow --agent windsurf # Cline npx -y skills add bytedance/deer-flow --skill claude-to-deerflow --agent cline ``` ## Qué hace - Crea threads y transmite ejecuciones (streaming SSE) a una instancia de DeerFlow vía su API HTTP/LangGraph - Lista modelos, skills y agentes disponibles, y activa/desactiva un skill específico - Sube archivos (PDF, PPTX, XLSX, DOCX) a un thread y consulta su historial y memoria - Ofrece un script auxiliar (chat.sh) que envía un mensaje y recoge la respuesta final de la IA ## Cuándo usarla - Se quiere enviar mensajes o preguntas a DeerFlow para investigación/análisis - Se necesita iniciar un thread, revisar el estado de salud, o listar modelos/skills/agentes de DeerFlow - Se quiere delegar una tarea de investigación profunda a DeerFlow ## Qué la activa - "Envía esta pregunta a DeerFlow en modo ultra" - "Revisa el estado de salud de mi instancia de DeerFlow" - "Sube este PDF al thread y pregúntale sobre su contenido" ## Antes de instalar - Requiere una instancia de DeerFlow corriendo, accesible vía DEERFLOW_URL (por defecto http://localhost:2026). - Necesita en el PATH: curl, python3 - Variables de entorno: BODY, CONTEXT, DEERFLOW_GATEWAY_URL, DEERFLOW_LANGGRAPH_URL, DEERFLOW_URL, ESCAPED_MSG, GATEWAY_URL, HTTP_CODE, LANGGRAPH_URL, MESSAGE, MODE, THREAD_ID, THREAD_RESP, TMPFILE - makes network requests - reads environment config ## Archivos - SKILL.md — 7 KB - scripts/chat.sh — 8 KB - scripts/status.sh — 3 KB ## SKILL.md Reproducido tal cual desde bytedance/deer-flow bajo MIT. Esta sección es el documento original y está en inglés. # DeerFlow Skill Communicate with a running DeerFlow instance via its HTTP API. DeerFlow is an AI agent platform built on LangGraph that orchestrates sub-agents for research, code execution, web browsing, and more. ## Architecture DeerFlow exposes two API surfaces behind an Nginx reverse proxy: | Service | Direct Port | Via Proxy | Purpose | |----------------|-------------|----------------------------------|----------------------------------| | Gateway API | 8001 | `$DEERFLOW_GATEWAY_URL` | REST endpoints and embedded agent runtime | | LangGraph-compatible API | 8001 | `$DEERFLOW_LANGGRAPH_URL` | Agent threads, runs, streaming | ## Environment Variables All URLs are configurable via environment variables. **Read these env vars before making any request.** | Variable | Default | Description | |-------------------------|------------------------------------------|------------------------------------| | `DEERFLOW_URL` | `http://localhost:2026` | Unified proxy base URL | | `DEERFLOW_GATEWAY_URL` | `${DEERFLOW_URL}` | Gateway API base (models, skills, memory, uploads) | | `DEERFLOW_LANGGRAPH_URL`| `${DEERFLOW_URL}/api/langgraph` | LangGraph API base (threads, runs) | When making curl calls, always resolve the URL like this: ```bash # Resolve base URLs from env (do this FIRST before any API call) DEERFLOW_URL="${DEERFLOW_URL:-http://localhost:2026}" DEERFLOW_GATEWAY_URL="${DEERFLOW_GATEWAY_URL:-$DEERFLOW_URL}" DEERFLOW_LANGGRAPH_URL="${DEERFLOW_LANGGRAPH_URL:-$DEERFLOW_URL/api/langgraph}" ``` ## Available Operations ### 1. Health Check Verify DeerFlow is running: ```bash curl -s "$DEERFLOW_GATEWAY_URL/health" ``` ### 2. Send a Message (Streaming) This is the primary operation. It creates a thread and streams the agent's response. **Step 1: Create a thread** ```bash curl -s -X POST "$DEERFLOW_LANGGRAPH_URL/threads" \ -H "Content-Type: application/json" \ -d '{}' ``` Response: `{"thread_id": "", ...}` **Step 2: Stream a run** ```bash curl -s -N -X POST "$DEERFLOW_LANGGRAPH_URL/threads//runs/stream" \ -H "Content-Type: application/json" \ -d '{ "assistant_id": "lead_agent", "input": { "messages": [ { "type": "human", "content": [{"type": "text", "text": "YOUR MESSAGE HERE"}] } ] }, "stream_mode": ["values", "messages-tuple"], "stream_subgraphs": true, "config": { "recursion_limit": 1000 }, "context": { "thinking_enabled": true, "is_plan_mode": true, "subagent_enabled": true, "thread_id": "" } }' ``` The response is an SSE stream. Each event has the format: ``` event: data: ``` Key event types: - `metadata` — run metadata including `run_id` - `values` — full state snapshot with `messages` array - `messages-tuple` — incremental message updates (AI text chunks, tool calls, tool results) - `end` — stream is complete **Context modes** (set via `context`): - Flash mode: `thinking_enabled: false, is_plan_mode: false, subagent_enabled: false` - Standard mode: `thinking_enabled: true, is_plan_mode: false, subagent_enabled: false` - Pro mode: `thinking_enabled: true, is_plan_mode: true, subagent_enabled: false` - Ultra mode: `thinking_enabled: true, is_plan_mode: true, subagent_enabled: true` ### 3. Continue a Conversation To send follow-up messages, reuse the same `thread_id` from step 2 and POST another run with the new message. ### 4. List Models ```bash curl -s "$DEERFLOW_GATEWAY_URL/api/models" ``` Returns: `{"models": [{"name": "...", "provider": "...", ...}, ...]}` ### 5. List Skills ```bash curl -s "$DEERFLOW_GATEWAY_URL/api/skills" ``` Returns: `{"skills": [{"name": "...", "enabled": true, ...}, ...]}` ### 6. Enable/Disable a Skill ```bash curl -s -X PUT "$DEERFLOW_GATEWAY_URL/api/skills/" \ -H "Content-Type: application/json" \ -d '{"enabled": true}' ``` ### 7. List Agents ```bash curl -s "$DEERFLOW_GATEWAY_URL/api/agents" ``` Returns: `{"agents": [{"name": "...", ...}, ...]}` ### 8. Get Memory ```bash curl -s "$DEERFLOW_GATEWAY_URL/api/memory" ``` Returns user context, facts, and conversation history summaries. ### 9. Upload Files to a Thread ```bash curl -s -X POST "$DEERFLOW_GATEWAY_URL/api/threads//uploads" \ -F "files=@/path/to/file.pdf" ``` Supports PDF, PPTX, XLSX, DOCX — automatically converts to Markdown. ### 10. List Uploaded Files ```bash curl -s "$DEERFLOW_GATEWAY_URL/api/threads//uploads/list" ``` ### 11. Get Thread History ```bash curl -s "$DEERFLOW_LANGGRAPH_URL/threads//history" ``` ### 12. List Threads ```bash curl -s -X POST "$DEERFLOW_LANGGRAPH_URL/threads/search" \ -H "Content-Type: application/json" \ -d '{"limit": 20, "sort_by": "updated_at", "sort_order": "desc"}' ``` ## Usage Script For sending messages and collecting the full response, use the helper script: ```bash bash /path/to/skills/claude-to-deerflow/scripts/chat.sh "Your question here" ``` See `scripts/chat.sh` for the implementation. The script: 1. Checks health 2. Creates a thread 3. Streams the run and collects the final AI response 4. Prints the result ## Parsing SSE Output The stream returns SSE events. To extract the final AI response from a `values` event: - Look for the last `event: values` block - Parse its `data` JSON - The `messages` array contains all messages; the last one with `type: "ai"` is the response - The `content` field of that message is the AI's text reply ## Error Handling - If health check fails, DeerFlow is not running. Inform the user they need to start it. - If the stream returns an error event, extract and display the error message. - Common issues: port not open, services still starting up, config errors. ## Tips - For quick questions, use flash mode (fastest, no planning). - For research tasks, use pro or ultra mode (enables planning and sub-agents). - You can upload files first, then reference them in your message. - Thread IDs persist — you can return to a conversation later. ## Dónde encaja - Categoría: [Desarrollo de APIs](https://skillsagentes.com/categorias/desarrollo-apis.md) — Diseña, prueba y documenta APIs HTTP y GraphQL. - Creador: [bytedance](https://skillsagentes.com/creators/bytedance.md) — 27 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Engineer System Change](https://skillsagentes.com/skills/bytedance/deer-flow/engineer-system-change.md): Evalúa y ejecuta cambios de sistema no triviales desde primeros principios: RFCs, features, refactors, migraciones o nuevas APIs, exigiendo consumidores concretos, la solución mínima suficiente y evidencia proporcional al riesgo. - [Skill Reviewer](https://skillsagentes.com/skills/bytedance/deer-flow/skill-reviewer.md): Revisa paquetes de skills de DeerFlow: preparación para publicar, triggers, límites de seguridad, recursos y evidencia. Úsala cuando pidan auditar, calificar o validar para producción una skill. - [Smoke Test](https://skillsagentes.com/skills/bytedance/deer-flow/smoke-test.md): Skill de smoke test de extremo a extremo para DeerFlow: actualiza el código, despliega en local o Docker, verifica disponibilidad de servicios, hace health check y genera el reporte final. - [Skill Creator](https://skillsagentes.com/skills/bytedance/deer-flow/skill-creator.md): Crea skills nuevas, modifica y mejora skills existentes, y mide su rendimiento. Úsala para crear una skill, editarla, correr evals, hacer benchmark con análisis de varianza, u optimizar su descripción. - [Deerflow Maintainer Orchestrator](https://skillsagentes.com/skills/bytedance/deer-flow/deerflow-maintainer-orchestrator.md): Manejo de issues y PRs de GitHub solo por comentarios para mantenedores de DeerFlow: resuelve alcance con gh, analiza, publica o redacta comentarios de issues y revisiones de PR, y compara PRs en competencia. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)