{"slug": "turn-claude-code-into-a-24-7-claude-code-agent", "title": "Turn Claude Code into a 24/7 Claude Code Agent", "summary": "Hermit, a plugin by gtapps for Claude Code, turns a Claude Code instance into a 24/7 autonomous agent with stateful memory, proactive routines, and operator-gated self-improvement, installable via 'claude plugin marketplace add gtapps/claude-code-hermit'. It adds a persistent operating layer, including a Monitor subprocess for token-efficient heartbeats, channel-based control via Discord/Telegram, and integration with Claude Code Artifacts for live dashboards and proposals.", "body_md": "Claude Code plugin that turns a Claude Code instance into a 24/7 agent. **Stateful. Proactive. Self-improving through an operator-gated proposal system. Cost-aware. Observable. Works with your Claude Subscription**.\n\nSetup your agent in any folder, empty or existing project with `/hatch`\n\nand shape its identity, priorities, routines, knowledge, autonomy, guardrails and make it yours.\n\n```\n# Install\nclaude plugin marketplace add gtapps/claude-code-hermit\nclaude plugin install claude-code-hermit@claude-code-hermit --scope local\n\n# Boot Claude Code and run the setup wizard\n/claude-code-hermit:hatch\n\n# Go always-on\n/claude-code-hermit:docker-setup\n```\n\nHermit adds a persistent operating layer around Claude Code, a learning loop, and a quick setup to wire everything.\n\n**Stateful** live working state, archived session handoffs, runtime observations, lessons, findings, blockers, completed tasks, files created/modified/deleted.**Agent Routines** Add your own routines that run from one persistent`Monitor`\n\nsubprocess that decides eligibility outside the session, so a skipped fire costs zero tokens and co-due routines batch into one wake; a daily`CronCreate`\n\nanchor re-arms it. Falls back to per-routine`CronCreate`\n\nwhere`Monitor`\n\nis unavailable. Managed by`/hermit-routines`\n\n.**Heartbeat** polls from a persistent`Monitor`\n\nsubprocess — a filesystem-only precheck decides every tick, and the model only wakes (and only bills) when something actually changed.wraps`/watch`\n\n`Monitor`\n\nstreams that die with the session: it auto-starts from config (or plain language) and routes findings to your notifications, silent when quiet.**Channels** let you DM a session; the hermit agent acts on it (*\"accept PROP-014\"*,*\"status\"*) and**pings you first** when something needs a yes/no.**Pause it from your phone — and it actually stops.** Ask for status, pause, resume, or snooze over Discord or Telegram. The pause is enforced at the tool boundary, not merely treated as a conversational request.**Native Claude Code Artifacts integration** publishes a live Hermit Dashboard, open proposals, weekly reviews, and any compiled document you request as private, versioned[Claude Code Artifacts](https://code.claude.com/docs/en/artifacts). Pages update in place at stable URLs, with organization sharing where supported. Point`artifacts.backend`\n\nat your own MCP artifact server to publish there instead.**Auto-memory + knowledge** Two layers. Claude Code's native auto-memory holds operator facts and preferences (how to work with you); on top, the hermit adds a`raw/`\n\n→`compiled/`\n\nknowledge base — domain outputs and living topic pages updated in place — re-injected as a catalog within a context budget on fresh and resumed starts. Your Discord/Telegram DM text is also captured locally, so decisions made over chat outlive the thread:`weekly-review`\n\ndistills them into memory (opt out with`knowledge.channel_log_enabled: false`\n\n).`/recall`\n\nsearches across all of it.**Plan tracking** lives in the SHELL.md Progress Log — timestamped steps that survive compaction, restart, and every model tier.**Unattended safety** combines profile-gated deny patterns + sandbox, channel-routed asks, permission-denial alerts, and injection scans on heartbeat and startup context.**Orchestrator** instructed to delegate tasks & exploration to other agents, main context stays clean for token efficiency.\n\n**Sessions self-manage.** Daemons auto-archive at 12h idle and at midnight when you're away, so evidence reaches the learning loop without a manual close. An external watchdog restarts dead sessions, nudges wedged ones, re-arms missed schedules, clears stale context after a midnight close, and compacts long-running context so cold wakes don't re-pay the full accumulated history — recovery never depends on the session being conscious.\n\n**Context-efficient continuity.** After compaction, Hermit reloads only a bounded lifecycle/task/progress capsule instead of the full startup bundle. Structured report frontmatter lets briefs, reflections, and weekly reviews inspect history without rereading every report body.\n\n**It reaches you first.** Notifications default to a native push (headless-friendly), or a Discord/Telegram DM you can reply to if you've paired a channel.\n\n**Cost scales with events, not time.** Nothing wakes the model until something happens, so an idle hermit is effectively free.\n\nA hermit watches what keeps going wrong across sessions, proposes a fix, and asks you yes or no. It won't propose the same thing twice.\n\nAt natural pauses — session end, idle ticks, scheduled cadence — it reflects. Most reflections never reach the model: a precheck script gates whether any phase (compute, resolution check, cost spike, digest, newborn) is actually due. When one is, two subagents vet the candidate before it reaches you:\n\nconfirms the cited evidence actually exists in the session reports, so a proposal can't certify itself.`reflection-judge`\n\ndeduplicates against open proposals, cross-checks your`proposal-triage`\n\n`MEMORY.md`\n\nand`OPERATOR.md`\n\n, and applies a three-condition bar.\n\nSurvivors land as a proposal you can act on from anywhere — including a DM:\n\n```\n/claude-code-hermit:proposal-list                  # see what it found\n/claude-code-hermit:proposal-act accept PROP-003    # or just reply \"accept PROP-003\"\n```\n\nWhat it proposes: improvements, routines, new capabilities (skills, agents, heartbeat checks), guardrails (OPERATOR.md guidance you confirm), and bugs. When it catches itself repeating the same multi-step procedure across sessions, it drafts the skill and asks before installing. It improves its own skills too: when one keeps getting corrected or reworked across sessions, that graduates into a skill-improvement proposal, and on your okay it revises the skill (via `skill-creator`\n\n). Accepted proposals can carry a measurable success signal and auto-resolve when met. You're the acceptance gate for every change. Raw session journals distill into compiled artifacts that reload next session — the [raw/compiled pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) Karpathy described for his wiki-LLM.\n\nThe native Hermit Dashboard, proposals page, and weekly review stay current as Claude Code Artifacts at stable URLs — or on a self-hosted artifact server, if you configure one.\n\nOn-demand skills — pullable from the Claude app, your terminal, or a DM:\n\n— designs the Dashboard around what this hermit actually tracks; delete`/hermit-dashboard-design`\n\n`.claude-code-hermit/dashboard-render.ts`\n\nto restore the built-in page— full-text search over past sessions, compiled knowledge, proposals, and your channel DM history (\"what did I decide about X?\")`/recall`\n\n— cost trend and behavior drift over weeks`/hermit-evolution`\n\n— alerts, routines, channels, heartbeat state, plus fragile zones, stale proposals, and recent learnings`/hermit-health`\n\n— proactive install diagnostic, from hook registration to heartbeat and routine-monitor liveness; the weekly check stays silent when green and alerts only on new problems`/hermit-doctor`\n\n— structural cost audit: which token types and trigger sources drive spend`/cost-reflect`\n\n— current status and a summary of recent work`/brief`\n\nPrerequisites:[Claude Code]v2.1.172+, a Claude plan (Pro, Max, Teams, or Enterprise), and[Bun]1.3+. Linux, macOS, and Windows via WSL2 — see[FAQ].\n\n```\ncd /path/to/your/project   # or any folder — even an empty one\nclaude plugin marketplace add gtapps/claude-code-hermit\nclaude plugin install claude-code-hermit@claude-code-hermit --scope local\nclaude /claude-code-hermit:hatch\n```\n\nThe wizard sets up your agent's identity, scans your folder, generates `OPERATOR.md`\n\n, and offers Quick (4 questions) or Advanced (full wizard).\n\nJust trying it?After`hatch`\n\n, run`.claude-code-hermit/bin/hermit-start --no-tmux`\n\nfor sessions, routines, heartbeat, and the learning loop without 24/7 autonomy. Run`/claude-code-hermit:channel-setup`\n\nfirst if you want Discord or Telegram.\n\n```\n/claude-code-hermit:docker-setup\n```\n\nGenerates the Docker scaffolding, builds the image, starts the container, and walks through auth and channel pairing. The container ships with the hardening baseline (`cap_drop: ALL`\n\n, `no-new-privileges`\n\n, `pids_limit`\n\n). Want stronger isolation? Run [ /docker-security](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/docker-security.md) for opt-in LAN containment + DNS allowlist + resource bounds.\n\nSee [Always-On Setup](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/always-on.md) for the full guide. Want always-on without Docker? See [Always-On Operations](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/always-on-ops.md) for bare tmux.\n\n```\nclaude plugin update claude-code-hermit@claude-code-hermit --scope local\n/claude-code-hermit:hermit-evolve\n```\n\nOr run `.claude-code-hermit/bin/hermit-update`\n\n(local/tmux) or `.claude-code-hermit/bin/hermit-docker update`\n\n(Docker): one command that moves the pin, reloads the session, and runs `hermit-evolve`\n\nfor you.\n\nTune via `/hermit-settings`\n\n(or just by asking the hermit). Some of the settings available:\n\n| Key | Default / options (default bold) |\n|---|---|\n`agent_name` |\nyour assistant's name |\n`timezone` |\n`UTC` |\n`language` |\n`en` |\n`escalation` |\nhow much it does before asking — `conservative` / / `balanced` `autonomous` |\n`sign_off` |\noptional sign-off on channel messages |\n`model` |\nsession model — `sonnet` |\n`permission_mode` |\nhow freely the unattended agent acts — `auto` |\n`AGENT_HOOK_PROFILE` |\nguardrail profile — `minimal` / / `standard` `strict` |\n`channels` |\nDiscord / Telegram / iMessage (+ `allowed_users` ) |\n`channels.primary` |\nwhich channel gets outbound pings |\n`push_notifications` |\nnative/mobile push on alerts — `true` |\n`remote` |\nremote control via claude.ai/code — `true` |\n`ask_gate` |\nroute unattended questions to a paired channel — `true` |\n`budget` |\noptional daily / weekly / monthly caps; or binding `alert` `pause` action |\n`artifacts` |\ndashboard / proposals / weekly review — all enabled |\n`idle_behavior` |\n(proactive) / `discover` `wait` (passive) |\n`heartbeat.enabled` |\ntimed idle sweeps — `true` |\n`heartbeat.every` |\nidle sweep cadence — `2h` |\n`active_hours` |\nactive window — `08:00` –`23:00` |\n`heartbeat.stale_threshold` |\nalert if no progress for — `2h` |\n`heartbeat.waiting_timeout` |\nauto `waiting` →`idle` after — (off)`null` |\n`routines` |\npersistent routines managed via `/hermit-routines` |\n`monitors` |\npersistent background watches managed via `/watch` |\n`scheduled_checks` |\nperiodic skill invocations |\n`reflection.graduation_min_sessions` |\nproposal recurrence bar — `1` |\n`quality_gate.tier` |\npost-change cleanup spend — / `budget` `balanced` / `quality` |\n`knowledge.compiled_budget_chars` |\nfresh/resumed startup catalog budget — `2500` |\n`knowledge.raw_retention_days` |\n`raw/` retention — `14` |\n`knowledge.working_set_warn` |\nwarn above N compiled docs — `20` |\n`auto_session` |\nauto-start session on boot — `true` |\n`boot_skill` / `shutdown_skill` |\ncustom boot / teardown skill |\n`post_close_clear` |\nclear context after midnight close — `true` |\n`context_hygiene.compact` |\ncompact long-running active context — enabled, `100000` compactible tokens / `4h` cooldown |\n`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` |\nauto-compact at % of context — `65` |\n`MAX_THINKING_TOKENS` |\nthinking-token cap per turn — `10000` |\n`watchdog.enabled` |\nexternal dead-session recovery — (local/tmux); `false` `/docker-setup` enables it |\n\nFull schema in the [Config Reference](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/config-reference.md)\n\nAll live-editable with `/hermit-settings`\n\n(or just ask the hermit) — no reboot.\n\n-\n**Model & Auto mode.** Defaults to Sonnet — a good balance of reasoning and cost for an unattended session. Auto mode is generally available to all users across subscription plans and API usage; supported models and provider configuration can still vary, so if Claude reports the current selection unavailable, choose a supported model or another permission mode. Switch to`opus`\n\nfor heavier reasoning; per-routine`model: \"haiku\"`\n\nremains useful for lightweight, isolated work. -\n**Heartbeat.**`heartbeat.every`\n\nsets the idle sweep (default`2h`\n\n;`1h`\n\ntighter,`4h`\n\n+ fewer wakes);`active_hours`\n\nbounds the window (`08:00`\n\n–`23:00`\n\n).`heartbeat.enabled: false`\n\nstops timed wakes entirely — channels and routines still fire. -\n**Idle behavior.**`discover`\n\n(default) adds a priority-alignment pass against`OPERATOR.md`\n\n+ cost log;`wait`\n\nis passive (tasks/channels only). Either way the daily`reflect`\n\nroutine still runs —`wait`\n\nonly silences between-schedule discovery, not the learning loop. -\n**Routines.** Each routine takes an optional`model`\n\n: run lightweight ones on`haiku`\n\nto save cost or heavier ones on`opus`\n\nfor more reasoning, in an isolated subagent. Omit`model`\n\nto keep it inline in the main session context — use that when the routine's value is its chat/transcript output, not just a status line. In Monitor mode, exactly co-due routines batch into one wake; offset routines you want as separate turns by a few minutes to keep the prompt cache warm. CronCreate fallback always fires them separately (see[Config Reference](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/config-reference.md)for the full rule). -\n**Quiet & cheap:**`idle_behavior: \"wait\"`\n\n+ a longer`heartbeat.every`\n\n+`quality_gate.tier: \"budget\"`\n\n(the default). Idle cost is already near-zero; these trim the rest.\n\nFull reference: [Config Reference](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/config-reference.md).\n\nYou run on your own Claude subscription — no per-runtime-hour billing — and every token is logged where you can see it. Optional daily, weekly, and monthly Hermit caps can alert you or enforce a binding pause when a limit is reached.\n\n**Per-call** token usage logged to`.claude/cost-log.jsonl`\n\n(model, input/output/cache split, USD estimate, and what triggered the turn —`heartbeat`\n\n,`routine:<id>`\n\n,`routine:multi`\n\n,`channel:<name>`\n\n, or interactive/unattributed`other`\n\n).**Per-session** running total in`.status.json`\n\n; carried into archived session reports as frontmatter`cost_usd`\n\n.**Per-day** rollup in`cost-summary.md`\n\n, regenerated on every cost-tracker tick.**On demand** through`/cost-reflect`\n\n,`/hermit-doctor`\n\n, and the dashboard, plus a one-line spend summary in the weekly review. Routine briefs and status replies stay outcome-only; spend interrupts them only when a cap is approached or breached.\n\nBecause idle always-on cost is effectively zero, one Claude subscription can run several hermits at once.\n\nExtension plugins you stack on top of any hermit you've hatched.\n\n—`dev-hermit`\n\n*For software builders.*Safety layer for code-writing agents: push guard, branch discipline, gated PRs.—`homeassistant-hermit`\n\n*For Home Assistant users.*HA skills, safety hook, automation builder, zero-dependency CLI.—`fitness-hermit`\n\n*Fitness focused.*Strava MCP wiring, activity deep-dives, weekly-load routines.—`feed-hermit`\n\n*For feed-to-brief pipelines.*Curated source registry, fetch/score/write pipeline, weekly synthesis, source-health analytics.—`laravel-forge-hermit`\n\n*For Laravel Forge operators.*Deploy, logs, and server/site skills over the official Forge PHP SDK.—`hermit-scribe`\n\n*For maintainers.*Files GitHub issues and comments from proposals via a bot identity.\n\nMany operators run several hermits in parallel — one per domain. Each one is a `/hatch`\n\naway. They share nothing but the protocol; their memory, cost history, and routines are independent, and a single Claude subscription covers them all. See [Creating Your Own Hermit](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/creating-your-own-hermit.md).\n\nJoin the [ claude-code-hermit Discord community](https://discord.gg/54sJqAxhUh) for install help, always-on ops, plugin authoring, bug triage, and proposal/design discussion. Confirmed bugs and roadmap decisions should still move back to GitHub so they remain searchable and reviewable.\n\n[Artifacts](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/artifacts.md)[Always-On Operations](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/always-on-ops.md)[Always-On Setup](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/always-on.md)[Architecture](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/architecture.md)[Config Reference](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/config-reference.md)[Community Discord](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/community-discord.md)[Creating Your Own Hermit](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/creating-your-own-hermit.md)[Docker Security](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/docker-security.md)[FAQ](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/faq.md)[Getting Started](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/how-to-use.md)[Owner's Guide](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/owners-guide.md)[Plugin Hermit Storage](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/plugin-hermit-storage.md)[Recommended Plugins](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/recommended-plugins.md)[Routine Authoring](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/routine-authoring.md)[Security](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/security.md)[Testing](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/testing.md)[Troubleshooting](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/troubleshooting.md)[Upgrading](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/upgrading.md)[What Your Assistant Can and Can't Do](/gtapps/claude-code-hermit/blob/main/plugins/claude-code-hermit/docs/what-your-assistant-can-do.md)\n\n— Inspiration for the raw/compiled knowledge system[Andrej Karpathy](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)", "url": "https://wpnews.pro/news/turn-claude-code-into-a-24-7-claude-code-agent", "canonical_source": "https://github.com/gtapps/claude-code-hermit/", "published_at": "2026-08-21 23:03:11+00:00", "updated_at": "2026-08-21 23:14:42.531739+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools", "ai-products"], "entities": ["gtapps", "Claude Code", "Hermit", "Discord", "Telegram", "Claude Code Artifacts"], "alternates": {"html": "https://wpnews.pro/news/turn-claude-code-into-a-24-7-claude-code-agent", "markdown": "https://wpnews.pro/news/turn-claude-code-into-a-24-7-claude-code-agent.md", "text": "https://wpnews.pro/news/turn-claude-code-into-a-24-7-claude-code-agent.txt", "jsonld": "https://wpnews.pro/news/turn-claude-code-into-a-24-7-claude-code-agent.jsonld"}}