Deep dive into every xbot feature — tools, memory, skills, scheduling, hybrid routing, and MCP integration.
xbot chat runs one-shot agent conversations. Defaults to the current directory as workspace.
# Initialize project context (creates .xbot/ and XBOT.md)
xbot chat /init
# One-shot task in current directory
xbot chat "refactor the database layer"
# Use explicit workspace
xbot chat --workspace /path/to/project "find bugs"
# Use global workspace for non-project tasks
xbot chat --global "research quantum computing"
# Override model for this task
xbot chat --model anthropic/claude-sonnet-4-20250514 "review my code"
Rich terminal UI built with Ratatui — streamed responses, persistent sessions, subagent notifications, and runtime model switching.
xbot repl
xbot repl --workspace /path/to/project
xbot repl --global
xbot run starts the always-on AI assistant backend. It simultaneously launches the Gateway HTTP server, heartbeat service, cron scheduler, and all configured channel backends.
xbot run
xbot run --workspace /path/to/project
xbot provides 12 built-in tools that agents can invoke autonomously to complete tasks.
| Tool | Purpose | Notes |
|---|---|---|
read_file | Read file contents | Supports offset and line limit |
write_file | Create or overwrite file | Requires approval (configurable) |
edit_file | Precise string-replace edit | Approval flow with diff preview |
list_dir | List directory contents | Recursive file tree display |
grep_files | Search for patterns in files | Regex pattern support |
exec | Execute shell commands | Configurable timeout, default 120s |
web_search | Web search | DuckDuckGo default, configurable |
web_fetch | Fetch webpage content | HTML to Markdown conversion |
message | Send message to channel | Cross-channel delivery |
cron | Create scheduled jobs | One-shot, interval, or cron expr |
spawn | Spawn background subagent | Parallel subtasks, max 3 concurrent |
wait_subagents | Wait for subagents | Collect subagent results |
write_file and edit_file support an approval flow (Allow Once / Always Allow / Deny) with diff preview. Use restrictToWorkspace to sandbox file operations.
xbot supports MCP (Model Context Protocol) over stdio. Enabled tools register as native tools with mcp_<server>_<tool> naming.
{
"tools": {
"mcpServers": {
"github": {
"enabled": true,
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "ghp_..." },
"enabledTools": ["*"],
"toolTimeout": 30
},
"filesystem": {
"enabled": true,
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
}
}
}
xbot implements a dual-file persistent memory architecture ensuring important information persists across sessions.
| File | Purpose | Lifecycle |
|---|---|---|
MEMORY.md | Durable facts, user preferences, project knowledge | Permanent |
HISTORY.md | Resettable event log | Resettable |
LLM-driven consolidation auto-triggers when context usage reaches ~75%, compressing older memories. Falls back to raw archive mode after 3 LLM consolidation failures.
# In REPL or via channel
/memorize Always use tabs for indentation in this project
Skills are modular SKILL.md files in skills/<name>/SKILL.md with YAML frontmatter defining triggers and priority.
xbot skills list # List all skills
xbot skills init my-skill # Create a custom skill
| Skill | Purpose |
|---|---|
software-engineer | Code writing, debugging, refactoring |
summarize | Content summarization and report generation |
github | GitHub repository operations and CI/CD |
github-cli | gh CLI integration |
data-analyst | Data analysis and visualization |
cron | Scheduled task management |
scheduled-ops | Scheduled operations |
memory | Memory management |
memory-hygiene | Memory cleanup and organization |
memory-entry-writer | Auto-write task summaries to memory |
weather | Weather lookup |
project-init | Project initialization |
project-context | Project context understanding |
workspace-operator | Workspace operations |
delivery-rules | Message delivery rules |
tmux | tmux session management |
clawhub | ClawHub integration |
skill-creator | Create new skills |
The main agent can spawn background subagents for parallel subtask execution. Subagents default to 3 max concurrent with 100 max iterations each.
Subagents cannot use spawn, cron, or message tools. If subagents.model is empty, subagents inherit the main task model.
Main task on a remote frontier API (e.g., OpenAI GPT-4.1), subagents switch to a local model (e.g., Qwen on vLLM) for parallel work — balancing quality and cost.
{
"agents": {
"defaults": {
"model": "openai/gpt-4.1",
"provider": "openai"
},
"subagents": {
"model": "qwen2.5-coder:7b",
"provider": "local-vllm",
"apiBase": "http://127.0.0.1:8001/v1"
}
},
"providers": {
"openai": { "apiKey": "sk-..." },
"local-vllm": {
"apiKey": "",
"apiBase": "http://127.0.0.1:8001/v1"
}
}
}
xbot supports 26 LLM providers with automatic model routing — auto-detecting provider from model name prefixes, API key prefixes, or API base URLs.
| Category | Providers |
|---|---|
| Cloud APIs | OpenAI, Anthropic, DeepSeek, Groq, Gemini, Moonshot, MiniMax, Mistral, StepFun, Zhipu, DashScope, Azure OpenAI |
| Gateways | OpenRouter, AIHubMix, SiliconFlow, Volcengine, BytePlus |
| Local | Ollama, vLLM, OVMS, Custom |
| OAuth | GitHub Copilot, OpenAI Codex |
| Other | Cursor |
Three scheduling modes: one-shot (At), interval (Every), and cron expression (Cron) with timezone support. Jobs persist to .xbot/state/cron/jobs.json.
xbot jobs # List all scheduled jobs
The Gateway HTTP server started by xbot run listens on 0.0.0.0:18790 by default.
| Endpoint | Purpose |
|---|---|
GET /healthz | Health check |
GET /readyz | Readiness check |
GET /status | Runtime status JSON |
GET /metrics | Prometheus-format metrics |
GET /admin | Web admin UI |
Config file at ~/.xbot/config.json. All available settings:
| Path | Default | Description |
|---|---|---|
agents.defaults.model | openai/gpt-4.1-mini | Default LLM model |
agents.defaults.provider | auto | Provider selection |
agents.defaults.maxTokens | 16384 | Max completion tokens |
agents.defaults.contextWindowTokens | 65536 | Context window size |
agents.defaults.maxConcurrentTools | 5 | Parallel tool execution count |
agents.defaults.maxConcurrentRequests | 3 | Global request concurrency |
agents.defaults.memoryMaxBytes | 32768 | Memory file size cap |
gateway.host | 0.0.0.0 | Gateway listen host |
gateway.port | 18790 | Gateway listen port |
gateway.heartbeat.enabled | true | Heartbeat service |
gateway.heartbeat.intervalS | 1800 | Heartbeat interval (seconds) |
tools.exec.enable | true | Enable shell execution |
tools.exec.timeout | 120 | Shell timeout (seconds) |
tools.restrictToWorkspace | false | Restrict file ops to workspace |