待翻譯:Show HN: Scheduled Claude Code agents that cost nothing on a quiet day
AI 服務暫時不可用,以下為來源摘要,待恢復後補全翻譯:Uh oh! There was an error while loading. Please reload this page. Notifications You must be signed in to change notification settings Fork 1 Star 8 BranchesTags Open more actions menu Latest commit History 178 Commits 1…
AI 服務暫時不可用,以下為來源正文,待恢復後補全翻譯。
Uh oh! There was an error while loading. Please reload this page. Notifications You must be signed in to change notification settings Fork 1 Star 8 BranchesTags Open more actions menu Latest commit History 178 Commits 178 Commits Folders and files NameName Last commit message Last commit date .claude/skills/pr-merge .claude/skills/pr-merge .github/workflows .github/workflows context context debug debug docs docs examples examples public public src src test test .dockerignore .dockerignore .gitignore .gitignore CLAUDE.md CLAUDE.md Dockerfile Dockerfile LICENSE LICENSE README.md README.md package-lock.json package-lock.json package.json package.json tsconfig.json tsconfig.json Repository files navigation Many Claude Codes. One cockpit. And it wrote itself. Run real Claude Code sessions side by side, each in its own git worktree, on the Claude subscription you already pay for. When one of them has a question, you answer it with a click — in the browser, or from Telegram when you are not at the desk. npx shadok-ai It does not stop at one. An agent can start other agents — each with its own worktree, branch and role — and it is told when one of its own finishes, blocks on a question, or dies. Nothing else wakes it. It keeps working when you are not there. Mirror an agent to a Telegram topic and answer from your phone, one topic per agent. Put a prompt on a schedule with a guard that runs without the model: prints nothing, nothing happened, zero tokens spent. It stays on a leash. A profile is a role plus guardrails — forbid git commit and the agent cannot commit. Secrets live in a vault outside your repository and are injected only into the agents that need them. Quota gauges show the 5h and 7d windows, and can hold an agent back when it is burning faster than the window elapses. It wrote itself. shadok-ai is largely built by agents running inside shadok-ai, in their own worktrees, landed as reviewed pull requests. The section below is what that produced. Quick start npx shadok-ai It opens your browser for you once the server is listening — at the port it actually landed on, which is not always 3789 (a busy port walks to the next free one). Only on the launch you asked for: an auto-update respawn never pops a tab. Skipped where it would make no sense — in a container, over SSH, or on a Linux box with no display — and --no-open turns it off. Prerequisites: Node ≥ 20. shadok-ai drives the claude CLI on your Claude subscription — if it isn't installed, the cockpit installs it for you on the first agent launch (npm i -g @anthropic-ai/claude-code; if that can't write the global dir it tells you the one command to run). Either way you sign in to your Claude account once on first use — that step is yours and can't be skipped (see below). tmux makes agents survive the server restarting, so shadok-ai auto-installs it at boot if it's missing (brew on macOS, apt/apk/dnf/pacman on Linux — with sudo when not root). If it can't (no package manager, or a sudo password it can't provide), it falls back to node-pty and tells you the one command to run. SHADOK_TMUX=0 skips all of that. On the first run it asks once for an optional Telegram bot token (press Enter to skip; you can add it later from the web UI). Flag Effect --port, -p HTTP/WS port (default 3789; falls back to the next free one) --no-telegram web-only; don't prompt for or use a bot token --no-open don't open the browser on launch --password require this password to open the GUI (stored in config) --version, -v · --help, -h version / help What you get Channels — one claude process each, running in parallel. Renaming, grouping, and closing all sync live between the browser and Telegram: it's one list, server-owned, not two copies. Worktree isolation — spawned agents get their own git worktree and branch by default, so parallel agents never collide. Work is never auto-discarded: an empty worktree is reclaimed on close, anything with changes or commits stays (and Recover reopens it). Interactive dialogs — the TUI's permission prompts and multiple-choice questions become clickable buttons in the chat, and an inline keyboard in Telegram. Agent profiles — a named bundle of role prompt, permission guardrails (e.g. forbid git commit), model, and which secrets to inject. Applied at spawn, remembered across resume. Secret vault — stored under ~/.shadok-ai, never in your repo, injected as env vars into the agents that need them. An agent that obtains a credential (a CLI login, a key it just provisioned) can add it to the vault itself so the next agent doesn't start from nothing — write-only, the value piped in rather than typed as an argument, and never overwriting an existing name without you saying so. Scheduled prompts — give a channel a recurring prompt (every N minutes, or daily at HH:MM in a time zone you choose) for monitoring and reporting. Each schedule can carry a deterministic guard command that runs without the model: prints nothing → nothing to report, the agent is never woken and the run costs zero tokens; prints something → that output is prepended to the prompt and the agent runs. A watcher that is quiet most of the day costs nothing most of the day. Agents that report back — an agent that launches other agents is told when each one finishes, blocks on a question, or dies. It hears about its own children and nothing else, so a busy channel never wakes it. What arrives is the child's own summary plus pointers (branch, diff link) — never the diff itself, which on a large session costs far more than it is worth. The link is set automatically at spawn; you can also attach or detach an agent by hand from its ⋯ menu. Quota gauges + pace guard — 5h and 7d subscription usage, with an optional block when you're burning faster than the window elapses (any message can force through). Notifications — favicon, title badge and an optional sound when an agent needs you. It only blinks when the tab is hidden and an unmuted channel is actually waiting. Engine room — the raw TUI screen, live, with clickable keys, for anything the chat can't express. With tmux there is also an experimental real terminal (xterm.js over the pane's byte stream) when a snapshot isn't enough. Diff panel — what an agent actually changed, against its base. Context sent — a collapsed block at the head of every conversation showing what shadok added to that agent: its role, its guardrails and permission mode, the names of the variables injected (never the values), the cockpit prompt. It also lists the capabilities shadok installs — the skills that let an agent start other agents, schedule its own prompts or store a credential — by description, since that is what Claude Code actually holds in context. Captured at spawn, so it is what the running process was actually given — not a recomputation that would quietly show today's profile. Also on the ⋯ menu of each channel. It says plainly that it is shadok's half: Claude Code adds its own context, which shadok never sees. Phone layout — the cockpit is a fixed chassis that never pans sideways, sized on the visual viewport so the composer stays clear of the browser's own bar and, when the keyboard opens, sits right above it (the instrument bar folds away while you type). Fields are 16px, which is what stops Safari from zooming in on focus. The agents column is replaced by a channel selector in the channel bar. Tweak Shadok-AI — a card pinned at the bottom of the agents column. One click clones shadok-ai's own source into ~/.shadok-ai/self/shadok-ai and starts an agent on it in its own worktree; that agent delivers its change as a pull request — a fork under your GitHub account, since you need no rights on the repo. Nothing to configure and no token to paste: the clone is anonymous, so you describe an idea, watch it work and read the diff first, and it only asks for GitHub (via gh auth login, device code relayed in the chat) when there is something worth pushing. It is one channel, not a launcher: the card becomes that channel's tab, with the usual menu — mute, reload, rename, change profile, mirror to Telegram, close — and closing it brings the card back. Desktop only: the agents column is hidden on phones. Guided tour — on a browser's first visit, a welcome card explains what shadok-ai is, then a spotlight walks the real controls: the agents column, an agent's ⋯ menu, the toolbar, the quota dials. Skip and Escape end it at any point; ⋯ → Guided tour replays it. A step whose target isn't on screen is dropped rather than faked, so the phone (no agents column) and an empty cockpit (no agent tab) get a shorter tour instead of a spotlight on nothing. On a brand-new instance it comes before the sign-in card — being asked to authorise an OAuth flow before you know what the thing is takes it backwards. A lead agent from the start — an instance with no channel at all gets one: general, running the Shadok-Boss profile, in the launch directory and without a worktree. It is created at boot, or right after the first sign-in on a brand-new instance (which is signed out at boot, so there is nothing to spawn yet). The condition is "no channel", which makes it idempotent: it never appears twice. Nothing is prompted — the agent waits for you. It is the environment's home base: pinned at the top of the list, with no close button and no Close agent in its menu. You can still reload, rename, re-profile or mute it — "permanent" should not mean "stuck". A cockpit that already had a general at its launch directory adopts it on the next start, and only ever when exactly one channel matches: a wrong adoption would be irreversible from the UI, since that channel becomes the one you cannot close. Self-update — polls npm and can update and reload itself in place. Telegram (optional) Add your bot to a group with Topics enabled, make it an admin with Manage topics (and Delete messages so /secret can scrub values), then in the group: Command /setup bind this group as the board (one group per instance) /spawn [profile] new isolated agent in its own topic (also a web tab) /stop (alias /esc) interrupt the current turn — does not end the session /new · /end reset · kill the session /restart respawn the agent in place (e.g. to pick up new secrets) /profiles · /list list profiles · list bindings /cron every 30m · /cron daily 09:00 schedule a recurring prompt on this agent /cron once 2026-08-25T08:42 fire it once on that date, then the schedule is left disabled and marked (fired) /cron list · /cron on|off|del manage them ( accepts the printed 8-char prefix) /secrets · /secret KEY value · /unsecret KEY the secret vault /update fetch @latest and respawn Creating a topic by hand also spawns an agent. Anything that isn't a command is sent to that topic's agent as a prompt — including photos and files, which are downloaded and handed to Claude Code. Direct messages belong to one person. The first user to DM the bot claims it; everyone else is refused. On startup the owner is adopted from an existing DM or from the board group's creator, so an instance that already has an owner never hands itself to whoever messages next — a bot username is public, and a DM is a shell. Running in Docker The repo ships an official Dockerfile: docker build -t shadok-ai . docker run -d --name shadok-ai --restart unless-stopped \ -p 127.0.0.1:3789:3789 \ -v shadok-data:/root/.shadok-ai \ -v shadok-claude:/root/.claude \ -v shadok-workspace:/workspace \ -e SHADOK_HOST=0.0.0.0 -e SHADOK_GUI_PASSWORD=change-me \ shadok-ai The image bundles Claude Code, shadok-ai and a headless browser (Playwright Chromium, at PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers) so an agent can screenshot or drive the web with no first-run download; git, gh, tmux, jq [truncated for AI cost control]