/claude-sentinel:deploy-sentinelfrom claude-sentinel
Deploy Claude Sentinel on a VPS — install the persistent Telegram gateway, set up systemd services, configure cron jobs for memory compaction, create the bot identity, and build the required directory structure. Use when the user asks to "install sentinel", "deploy telegram gateway", "set up persistent sessions", "install claude-sentinel", "configure telegram bot on VPS", "set up crons for telegram", "create bot identity", or wants to make their Claude Code Telegram bot persistent.
Ships in claude-sentinel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Installs the Claude Sentinel persistent gateway on the current machine. Creates all required directories, configuration files, systemd services, cron jobs, and bot identity.
Prerequisites (verify before proceeding):
claude auth status → loggedIn: true)bun --version)loginctl show-user $(whoami) | grep Linger)If any prerequisite is missing, direct the user to run /sentinel:vps-setup first.
Arguments passed: $ARGUMENTS
Walk through all steps below in order. Verify each step before moving on. Ask the user for required input (tokens, bot name, etc.) when needed.
status — check deployment healthls ~/.claude/channels/telegram/gateway.tssystemctl --user is-active telegram-gateway.servicesystemctl --user list-timers | grep compactls ~/.claude/channels/telegram/identity.mdls ~/.claude/channels/telegram/session-compact.mdsqlite3 ~/.claude/channels/telegram/history.db "SELECT COUNT(*) FROM messages"restart — restart the gatewaysystemctl --user restart telegram-gateway.service
journalctl --user -u telegram-gateway.service --no-pager -n 10
compact — run memory compaction nowsystemctl --user start telegram-compact.service
journalctl --user -u telegram-compact.service --no-pager -n 20
logs — show recent gateway logsjournalctl --user -u telegram-gateway.service --no-pager -n 30
mkdir -p ~/.claude/channels/telegram/inbox
mkdir -p ~/.claude/channels/telegram/approved
mkdir -p ~/.claude/channels/telegram/crons
mkdir -p ~/.config/systemd/user
git clone https://github.com/southlab-ai/claude-sentinel.git /tmp/claude-sentinel
cp /tmp/claude-sentinel/src/gateway.ts ~/.claude/channels/telegram/gateway.ts
cp /tmp/claude-sentinel/src/compact-job.ts ~/.claude/channels/telegram/compact-job.ts
If git is not available or the clone fails, offer to create the files directly by writing their contents (read from the plugin's bundled copies if available, or direct the user to download manually).
Ask the user for their Telegram bot token. If they already ran
/sentinel:configure <token>, read it from .env instead of asking again.
Create both env files:
~/.claude/channels/telegram/.env:
TELEGRAM_BOT_TOKEN=<token>
~/.claude/channels/telegram/gateway.env:
TELEGRAM_BOT_TOKEN=<token>
Ask if they have an OpenAI API key for voice message transcription (optional).
If yes, add OPENAI_API_KEY=<key> to .env.
Set permissions:
chmod 600 ~/.claude/channels/telegram/.env
chmod 600 ~/.claude/channels/telegram/gateway.env
Ask the user for their Telegram user ID. If they don't know it, tell them to message @userinfobot on Telegram.
Create ~/.claude/channels/telegram/access.json:
{
"dmPolicy": "allowlist",
"allowFrom": ["<user_telegram_id>"],
"groups": {},
"pending": {}
}
Note: Use allowlist by default (not pairing) since we're setting up from
scratch and know the user's ID. This is the secure default.
Ask the user:
Create ~/.claude/channels/telegram/identity.md with their choices:
# Identity
I am a personal assistant running inside Claude Code on my user's VPS.
**Name:** <bot_name>
**Emoji:** <emoji>
## Operating principles
- **Act, don't delegate.** When a dedicated tool exists for an action, use it
directly instead of asking the user to run commands. If I can do it, I do it.
- **Subagents for complex tasks.** For tasks requiring depth or professional
quality, use subagents with Opus model. The base model (Sonnet) is for quick
responses and simple tasks.
Explain to the user: this file is injected as a system prompt on every session start. They can edit it anytime to change the bot's behavior.
Download and install the three service files:
~/.config/systemd/user/telegram-gateway.service:
[Unit]
Description=Claude Telegram Gateway
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/home/<user>
ExecStart=/usr/local/bin/bun run /home/<user>/.claude/channels/telegram/gateway.ts
Restart=always
RestartSec=5
KillMode=control-group
KillSignal=SIGTERM
TimeoutStopSec=10
Environment=HOME=/home/<user>
Environment=PATH=/usr/local/bin:/home/<user>/.local/bin:/home/<user>/.bun/bin:/usr/bin:/bin
EnvironmentFile=/home/<user>/.claude/channels/telegram/gateway.env
[Install]
WantedBy=default.target
~/.config/systemd/user/telegram-compact.service:
[Unit]
Description=Claude Telegram Memory Compact
[Service]
Type=oneshot
WorkingDirectory=/home/<user>
ExecStart=/usr/local/bin/bun run /home/<user>/.claude/channels/telegram/compact-job.ts
Environment=HOME=/home/<user>
Environment=PATH=/usr/local/bin:/home/<user>/.local/bin:/home/<user>/.bun/bin:/usr/bin:/bin
~/.config/systemd/user/telegram-compact.timer:
[Unit]
Description=Compact Telegram memory twice daily
[Timer]
OnCalendar=*-*-* 08,20:00:00
Persistent=true
[Install]
WantedBy=timers.target
Replace <user> with the actual username (result of whoami).
Ask the user if they want to customize the compact schedule (default: 8am and 8pm UTC).
systemctl --user daemon-reload
systemctl --user enable --now telegram-gateway.service
systemctl --user enable --now telegram-compact.timer
Run these checks and report results:
Gateway running:
systemctl --user is-active telegram-gateway.service
Gateway logs:
journalctl --user -u telegram-gateway.service --no-pager -n 5
Should show: [gateway] Telegram Gateway started (persistent mode)
Compact timer scheduled:
systemctl --user list-timers | grep compact
All files in place:
ls -la ~/.claude/channels/telegram/gateway.ts
ls -la ~/.claude/channels/telegram/compact-job.ts
ls -la ~/.claude/channels/telegram/.env
ls -la ~/.claude/channels/telegram/identity.md
ls -la ~/.claude/channels/telegram/access.json
Tell the user: "Send a message to your bot on Telegram. You should see it in the logs within a few seconds."
After successful deployment, tell the user:
Quick reference:
/sentinel:deploy status/sentinel:deploy logs/sentinel:deploy restart/sentinel:deploy compactnano ~/.claude/channels/telegram/identity.md (takes effect on next session)/sentinel:access to manage who can reach the botHow the memory system works:
history.dbsession-compact.md~/.claude/projects/-home-claude/memory/How the persistent session works:
--resume + full context--fallback-model automatically tries an alternate$(whoami) or $HOME to determine paths — don't assume username is claudeWhat SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/accessManage Telegram channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Telegram channel.
/configureSet up the Telegram channel for Claude Sentinel — save the bot token, review access policy, and prepare the gateway environment. Use when the user pastes a Telegram bot token, asks to configure Telegram, asks "how do I set this up", or wants to check channel status. VPS-aware version with headless guidance.
/vps-setupGuided step-by-step setup of Claude Code on a VPS via SSH. Use when the user asks to "set up Claude Code on my VPS", "install claude on server", "configure VPS for claude", "SSH setup for claude code", "install claude on remote server", "set up headless claude", or wants to prepare a VPS to run Claude Code with Telegram.
Other plugins' skills for the same job
npx claudepluginhub southlab-ai/claude-plugin-marketplace --plugin claude-sentinel