hajimi-claw
v0.1.4
Published
Single-user Telegram-first ops agent in Rust
Readme
hajimi-claw
Single-user Telegram/Feishu-first ops agent in Rust.
Current scope
- Telegram channel -> gateway -> runtime command flow
- Feishu webhook channel -> gateway -> runtime command flow
- Telegram long polling command surface
- Single active task gate
- Structured tools for file access, Docker, and systemd
- Guarded local command execution with approval mode, short-lived elevated mode, and full elevated mode
- SQLite audit/task/session persistence
- Windows-safe execution mode with allowlist checks and Job Object cleanup
- Channel-aware onboarding for Telegram or Feishu plus provider/model setup
- Configurable multi-agent orchestration with coordinator/worker/integrator flow
- Executable skills registered as first-class tools with shared approval, audit, and persistence
- Capability inventory and MCP server status surfaced in chat via
/capabilities,/skills, and/mcp
Running
- Run
cargo run -- onboardorhajimi onboard. hajimi onboardlets you choosetelegram,feishu, orskip, verifies the channel credentials when configured, and then interactively guides provider model selection.- Start the daemon with
cargo runorhajimi. - In Telegram, use
/menufor the main quick-action panel, or just send plain text and let hajimi reply in natural language. - In Feishu mode, configure the app's event subscription URL to point at
http(s)://<your-host><event_path>for the local webhook listener.
Set HAJIMI_CLAW_CONFIG if you want to load a different config path.
For background use without keeping a terminal open:
hajimi launchhajimi statushajimi stop
Install
Windows
- Build and install to a user directory in
PATH:powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 - System-wide install:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -System
The installer copies hajimi-claw.exe, creates the hajimi.exe alias, copies config.example.toml, and updates PATH.
Linux
- User install:
sh ./scripts/install.sh - System-wide install:
sudo sh ./scripts/install.sh --system - System-wide install with systemd unit:
sudo sh ./scripts/install.sh --system --install-service
The Linux installer copies the binary to PREFIX/bin/hajimi-claw, creates the PREFIX/bin/hajimi alias, and copies config.example.toml to PREFIX/share/hajimi-claw.
npm
- Global install from the package:
npm install -g hajimi-claw - Global install from the repo:
npm install -g .
The npm package exposes both hajimi and hajimi-claw, but it no longer compiles Rust during
install. Instead:
- The root package is a small launcher package
- Platform-specific binaries are published as optional npm packages
npm install -g hajimi-clawinstalls the matching prebuilt binary package when one is available
Supported prebuilt package names:
hajimi-claw-win32-x64-msvchajimi-claw-win32-arm64-msvchajimi-claw-linux-x64-gnuhajimi-claw-linux-arm64-gnu
For local testing from the repo, stage a binary into the local platform package first:
cargo build --release
npm run stage:binary
npm install -g .For CI or release staging, you can target a specific package explicitly:
node scripts/stage-prebuilt.js win32-x64-msvc path/to/hajimi-claw.exe
node scripts/stage-prebuilt.js linux-x64-gnu path/to/hajimi-clawRecommended publish order:
- Build each platform binary in CI
- Stage it into the matching
npm/platforms/<target>/bin/ - Publish each platform package
- Publish the root
hajimi-clawpackage last
Current GitHub Actions automation is wired for:
hajimi-claw-win32-x64-msvchajimi-claw-linux-x64-gnu
The arm64 package skeletons are present in the repo, but they are not yet part of the automated publish matrix.
npm Versioning
For npm releases, the root package.json is the single version source.
When you change package.json.version, run:
npm run sync:npm-versionsThat script updates:
- the root package
optionalDependencies - every platform package version under
npm/platforms/*/package.json
The release workflow also runs this sync step automatically, so you do not need to edit platform package versions by hand.
Channels
telegramfeishu
hajimi onboard now lets you pick the primary channel:
telegram: verifies the bot token and can auto-pair the admin user/chatfeishu: asks forapp_idandapp_secret, verifies them by requesting a tenant access token, and supports bothwebhookandlong-connectionmodesskip: leaves channel setup empty for now so you can finish provider/model setup first
Current Feishu limitations:
- In
webhookmode, you still need to configure the Feishu event subscription URL manually in the Feishu developer console - In
long-connectionmode, message receive events can come through the WebSocket connection, but card button callbacks still need the lightweight HTTP callback path - Feishu card support currently targets
menu/provider/modelstyle button flows; it is not a full parity implementation of Telegram inline interactions
CLI
hajimihajimi ask <prompt>hajimi taskshajimi approvalshajimi approve <request-id>hajimi shell open [name]hajimi shell status <session-id>hajimi shell exec <session-id> <command>hajimi shell close <session-id>hajimi profile showhajimi profile use <ops-safe|dev-agent|computer-use>hajimi daemonhajimi launchhajimi stophajimi statushajimi onboardhajimi providershajimi provider currenthajimi provider use <provider-id>hajimi provider models [provider-id]hajimi provider set-model <provider-id> <model>hajimi model currenthajimi model use [model]hajimi models [provider-id]hajimi restarthajimi help
hajimi ask now records task state and tool invocations in SQLite. If a guarded command blocks on
approval, hajimi approve <request-id> resumes the blocked task instead of asking you to rerun it.
Skills and MCP
Hajimi now treats native tools, executable skills, and MCP-discovered tools as one capability surface.
- Native tools keep their existing names such as
read_fileorexec_once - When
[telegram].bot_tokenis configured, a nativetelegram_apitool is also registered - Executable skills are configured in
[skills]and are registered as tool names likeskill.deploy - MCP tools will be exposed as namespaced tool names like
mcp.<server>.<tool> - All three flow through the same runtime path for approval, audit logging, task persistence, and model tool-calling
skills.md remains prompt guidance only. Use it for playbooks, habits, and routing hints. It is
not the executable source of truth for runnable skills.
Config
config.example.toml now includes these sections:
[skills]
enabled = true
directory = "./skills"
manifest_paths = []
entries = []
[mcp]
enabled = true
servers = []Skill manifests and inline entries deserialize into ExecutableSkillConfig, including name,
description, command, args, cwd, env_allowlist, requires_approval, timeout_secs,
max_output_bytes, and input_schema.
Relative paths in skill manifests, skills.directory, skills.manifest_paths, and MCP server
cwd values resolve relative to the config file.
Telegram capability commands
/capabilities— list the effective native tools, executable skills, and MCP tools/skills— list executable skills only/skill run <name> <json-or-text>— explicitly invoke one configured skill through the runtime/mcp— show configured MCP server status/mcp tools [server]— list discovered MCP tools, optionally filtered by server
Natural-language requests stay primary. Once a skill or MCP tool is registered in the runtime, the
model can choose it during normal /ask or plain-text requests just like built-in tools.
telegram_api calls the configured Telegram Bot API token directly from the native tool layer. A
typical invocation looks like:
{
"method": "sendMessage",
"params": {
"text": "deploy finished"
},
"use_default_chat_id": true
}Multi-Agent
hajimi can split one natural-language request into multiple sub-agents. This is configured in
config.toml under [multi_agent]:
[multi_agent]
enabled = true
auto_delegate = false
default_workers = 3
max_workers = 8
worker_timeout_secs = 90
max_context_chars_per_worker = 24000Natural-language triggers:
use 4 agents to analyze this开 6 个 agent 帮我排查please use sub agents for this
Behavior:
- If the prompt explicitly asks for
N agentsorN workers, hajimi uses that count up tomax_workers - If the prompt says
sub agent/multi agent, hajimi usesdefault_workers auto_delegate = trueenables light automatic delegation for obviously parallel analysis tasks- Worker agents only perform parallel reasoning in v1; local command execution still stays behind the existing single runtime/policy path
- Session-level controls are available in chat:
/agents on/agents off/agents auto/agents status
- When a natural-language task is about to run in multi-agent mode, Telegram now shows a temporary progress card and Feishu sends a status card before the final reply
Persona Files
hajimi onboard seeds persona files in ~/.hajimi/:
identity.mdsoul.mdagents.mdtools.mdskills.mdheartbeat.md
hajimi reloads persona prompt files on each request, so edits take effect on the next /ask.
Layered prompt order:
- base system prompt
identity.mdsoul.mdagents.md/AGENTS.md/tools.md/skills.md- runtime overlays such as shell-session metadata and multi-agent role instructions
Auto-discovery behavior:
- Auto-discovered files:
identity.md,soul.md,agents.md,AGENTS.md,tools.md,skills.md - Search roots and precedence:
persona.directory-> config directory -> current working directory identity.mdandsoul.mdsupport optional front matter, but plain markdown still works- Structured
identity.md/soul.mdfields override by precedence while freeform notes accumulate - Extension files stay additive in precedence order
heartbeat.mdis runtime config only and is never appended into the prompt- Optional explicit list: set
[persona].prompt_filesinconfig.toml
Use these files for:
identity.md: user profile, owned systems, environments, durable preferences, and hard constraintssoul.md: Hajimi's stable role, tone, style, and behavioral stanceagents.mdorAGENTS.md: repo or operator instructionstools.md: tool-use policy and operational preferencesskills.md: extra habits, playbooks, and skill-selection hints for the prompt layer onlyheartbeat.md: daemon heartbeat runtime config
Telegram commands
/onboard/onboard cancel/provider list/provider add/provider current/provider use <id>/provider bind <id>/provider test [id]/provider models [id]/provider set-model <provider-id> <model>/model current/model use [model]/persona list/persona guide/persona read <identity|heartbeat|soul|agents|tools|skills>/persona write <file> <content>/persona append <file> <content>/ask <text>/capabilities/skills/skill run <name> <json-or-text>/mcp/mcp tools [server]/shell open [name]/shell exec <cmd>/shell close/status/menu/elevated on/elevated off/elevated ask/elevated full
Plain Telegram text now defaults to a natural-language task, so /ask is optional for normal requests. hajimi sends a Telegram typing action, posts a short placeholder, and then edits that message with the final answer.
The bot also registers Telegram slash commands with setMyCommands on startup and exposes an inline quick-action menu via /menu and /help. /provider current and /model current now return inline buttons so you can switch provider/model directly from Telegram without typing full commands.
Provider And Model Switching
- Add a new provider:
hajimi onboardor Telegram/provider add - List configured providers:
hajimi providersor Telegram/provider list - Switch the default provider:
hajimi provider use <provider-id>or Telegram/provider use <id> - See the current model:
hajimi model currentor Telegram/model current - Switch the current model on the active provider:
hajimi model use [model]or Telegram/model use [model] - Open the model picker with inline buttons:
hajimi model useor Telegram/model use - Switch a specific provider to a specific model:
hajimi provider set-model <provider-id> <model>or Telegram/provider set-model <provider-id> <model> hajimi onboardnow supports optional fallback models per provider; if the primary model fails, hajimi will retry the provider using the configured fallback models in order
