devduck
Minimalist AI agent that fixes itself when things break.
Install / Use
claude mcp add cagataycali -- npx -y github:cagataycali/devduckIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Skill content
View source on GitHub🦆 DevDuck
One file. Self-healing. Builds itself as it runs.
An AI agent that hot-reloads its own code, fixes itself when things break, and expands capabilities at runtime. Terminal, browser, cloud — or all at once.
pipx install devduck && devduck
<p align="center">
<img src="devduck-launcher.jpg" alt="DevDuck Launcher" width="700">
</p>
<p align="center">
<video src="https://github.com/cagataycali/devduck/raw/main/devduck-intro.mp4" width="700" controls autoplay muted>
<a href="https://redduck.dev/videos/devduck-intro.mp4">Watch the intro</a>
</video>
</p>
What It Does
- Hot-reloads — edit source, agent restarts instantly
- Self-heals — errors trigger automatic recovery
- 60+ tools — shell, GitHub, browser control, speech, scheduler, ML, messaging
- Multi-protocol — CLI, TUI, WebSocket, TCP, MCP, IPC, Zenoh P2P
- Unified mesh — terminal + browser + cloud agents in one network
- Deploys anywhere —
devduck deploy --launch→ AWS AgentCore - Self-replicates —
devduck service install --ssh hostpersists itself or spawns copies on any host (systemd/launchd)
Requirements: Python 3.10–3.13 + any model provider (AWS, Anthropic, OpenAI, Ollama, Gemini, etc.)
Quick Start
devduck # interactive REPL
devduck --tui # multi-conversation terminal UI
devduck "create a REST API" # one-shot
devduck --record # record session for replay
devduck --resume session.zip # resume from snapshot
devduck deploy --launch # ship to AgentCore
import devduck
devduck("analyze this code")
Power User Setup
A real-world .zshrc config for daily driving DevDuck with all the bells and whistles:
# Model — Claude Opus via Bedrock bearer token (fastest auth, no STS calls)
export AWS_BEARER_TOKEN_BEDROCK="ABSK..."
export STRANDS_MODEL_ID="global.anthropic.claude-opus-4-6-v1"
export STRANDS_MAX_TOKENS="64000"
# Tools — curated toolset (loads faster than all 60+)
export DEVDUCK_TOOLS="devduck.tools:use_github,editor,system_prompt,store_in_kb,manage_tools,websocket,zenoh_peer,agentcore_proxy,manage_messages,sqlite_memory,dialog,listen,use_computer,tasks,scheduler,telegram;strands_tools:retrieve,shell,file_read,file_write,use_agent"
# Knowledge Base — automatic RAG (stores & retrieves every conversation)
export STRANDS_KNOWLEDGE_BASE_ID="YOUR_KB_ID"
# MCP — auto-load Strands docs server
export MCP_SERVERS='{"mcpServers":{"strands-docs":{"command":"uvx","args":["strands-agents-mcp-server"]}}}'
# Messaging — Telegram & Slack bots
export TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
export SLACK_BOT_TOKEN="xoxb-your-slack-bot-token"
export SLACK_APP_TOKEN="xapp-your-slack-app-token"
# Spotify control
export SPOTIFY_CLIENT_ID="your-client-id"
export SPOTIFY_CLIENT_SECRET="your-client-secret"
export SPOTIFY_REDIRECT_URI="http://127.0.0.1:8888/callback"
# Gemini as fallback/sub-agent model
export GEMINI_API_KEY="your-gemini-key"
This gives you:
- 🧠 Opus on Bedrock as primary model with bearer token (zero-latency auth)
- 📚 Auto-RAG — every conversation stored in Knowledge Base, context retrieved before each query
- 📖 Strands docs available as MCP tools (search + fetch)
- 📱 Telegram + Slack + WhatsApp — three messaging channels ready
- Telegram & Slack: set tokens above, then
telegram(action="start_listener") - WhatsApp: no token needed — uses local
waclipairing, justwhatsapp(action="start_listener")
- Telegram & Slack: set tokens above, then
- 🎵 Spotify control via
use_spotify - 🔗 Zenoh P2P + mesh auto-enabled (multi-terminal awareness)
- 💬 26 tools loaded on startup, expandable to 60+ on demand via
manage_tools
Model Detection
Set your key. DevDuck figures out the rest.
export ANTHROPIC_API_KEY=sk-ant-... # → uses Anthropic
export OPENAI_API_KEY=sk-... # → uses OpenAI
export GOOGLE_API_KEY=... # → uses Gemini
# or just have AWS credentials # → uses Bedrock
# or nothing at all # → uses Ollama
Priority: Bedrock → Anthropic → OpenAI → GitHub → Gemini → Cohere → Writer → Mistral → LiteLLM → LlamaAPI → MLX → Ollama
Override: MODEL_PROVIDER=bedrock STRANDS_MODEL_ID=us.anthropic.claude-sonnet-4-20250514-v1:0 devduck
Tools
Runtime — no restart needed
manage_tools(action="add", tools="strands_fun_tools.cursor")
manage_tools(action="create", code='...')
manage_tools(action="fetch", url="https://github.com/user/repo/blob/main/tool.py")
Hot-reload from disk
Drop a .py file in ./tools/ → it's available immediately.
# ./tools/weather.py
from strands import tool
import requests
@tool
def weather(city: str) -> str:
"""Get weather for a city."""
return requests.get(f"https://wttr.in/{city}?format=%C+%t").text
Static config
export DEVDUCK_TOOLS="strands_tools:shell,editor;devduck.tools:use_github,scheduler"
🔍 Code Inspection
Built-in inspect tool (powered by strands-inspect) — turn any Python package into an interactive tool.
inspect(action="scan", target="json") # deep-scan package API
inspect(action="call", target="json.dumps", args='[{"hi": 1}]') # call anything
inspect(action="search", target="pathlib", query="read file")
inspect(action="generate", target="requests.post") # working code example
inspect(action="profile", target="myfunc") # memory + CPU timeline
inspect(action="graph", target="mypkg") # call-graph + hotspots
No wrappers, no stubs — point it at any installed package and start calling.
Architecture
devduck/
├── __init__.py # the whole agent — single file
├── tui.py # multi-conversation Textual UI
├── tools/ # 60+ built-in tools (hot-reloadable)
└── agentcore_handler.py # AWS AgentCore deployment handler
graph LR
User([👤 User]) --> Interface
subgraph Interface[" "]
CLI["CLI / REPL"]
TUI["TUI"]
WS["WebSocket"]
TCP["TCP"]
MCP["MCP"]
end
Interface --> Core["🦆 DevDuck Core"]
Core --> Tools["🔧 Tools"]
Core <--> Zenoh["🔗 Zenoh P2P"]
Core <--> KB["📚 Knowledge Base"]
Core <--> Mesh["🌐 Unified Mesh"]
Mesh --> Browser["🖥️ Browser"]
Mesh --> Cloud["☁️ AgentCore"]
style Core fill:#f5a623,stroke:#333,color:#000
style Mesh fill:#4a90d9,stroke:#333,color:#fff
style Zenoh fill:#7ed321,stroke:#333,color:#000
style KB fill:#9b59b6,stroke:#333,color:#fff
Ports: 10000 (mesh relay) · 10001 (WebSocket) · 10002 (TCP) · 10003 (MCP)
TUI Concurrency Model
The TUI (devduck --tui) supports true concurrent conversations with shared awareness:
graph TB
subgraph SharedMessages["📋 SharedMessages (thread-safe)"]
msgs["msg1, msg2, msg3, msg4, ..."]
end
SharedMessages --> A1
SharedMessages --> A2
SharedMessages --> A3
subgraph A1["🟦 Agent #1"]
cb1["callback → panel #1"]
end
subgraph A2["🟩 Agent #2"]
cb2["callback → panel #2"]
end
subgraph A3["🟨 Agent #3"]
cb3["callback → panel #3"]
end
style SharedMessages fill:#e74c3c,stroke:#333,color:#fff
style A1 fill:#3498db,stroke:#333,color:#fff
style A2 fill:#2ecc71,stroke:#333,color:#fff
style A3 fill:#f1c40f,stroke:#333,color:#000
Each conversation creates a fresh Agent (like TCP/Telegram tools do), but all agents point their .messages at a single SharedMessages instance — a thread-safe list subclass that serializes all reads and writes via a lock. This gives you:
- True concurrency — separate Agent instances with separate callback handlers, no conflicts
- Real-time shared awareness — when Agent #1 appends a message, Agent #2 sees it immediately on its next loop iteration
- Correct ordering — the lock ensures messages are appended in the order they're produced
- Isolated rendering — each agent's callback handler routes streaming output to its own color-coded TUI panel
The shared history is capped at 100 messages (configurable via DEVDUCK_TUI_MAX_SHARED_MESSAGES) and auto-clears on context window overflow.
Comparison across interfaces:
| Interface | Agent per request | Shared messages | Use case |
|-----------|:-:|:-:|---|
| CLI | No (reuse one) | N/A (single-threaded) | Sequential interactive REPL |
| TUI | Yes (fresh Agent) | Yes (SharedMessages) | Concurrent conversations with shared context |
| TCP | Yes (fresh DevDuck) | No (fully isolated) | External network clients |
| Telegram | Yes (fresh DevDuck) | No (fully isolated) | Chat bot, each user isolated |
| WebSocket | Yes (fresh DevDuck) | No (fully isolated) | Browser clients |
Multi-Agent Networking
Zenoh P2P — zero config
# Terminal 1
devduck # → Zenoh peer: hostname-abc123
# Terminal 2
devduck # auto-discovers Terminal 1
zenoh_peer(action="broadcast", message="git pull && npm test") # all peers
zenoh_peer(action="send", peer_id="hostname-abc123", message="status?") # one peer
Cross-network: ZENOH_CONNECT=tcp/remote:7447 devduck
Unified Mesh — everything connected
The mesh is DevDuck's shared nervous system. Every agent — regardless of where it runs — sees what others are doing via a ring context (a shared circular buffer of recent activity).
graph TB
subgraph Mesh["🌐 Unified Mesh (port 10000)"]
direction TB
T1["🖥️ Terminal DevDuck<br/>(Zenoh)"]
T2["🖥️ Terminal DevDuck<br/>(Zenoh)"]
B1["🌍 Browser Tab<br/>(WebSocket)"]
AC["☁️ AgentCore<br/>(AWS Cloud)"]
GH["🐙 GitHub Actions<br/>(HTTPS)"]
Ring[("🔄 Ring Context<br/>shared memory<br/>last 100 msgs")]
T1 <--> Ring
T2 <--> Ring
B1 <--> Ring
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
84.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
73.4kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.0k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
career-ops
72.3kOpen-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)
