kage is an ultra-lightweight, OS-native execution layer for AI agents. By leveraging standard schedulers like cron and launchd , it runs official AI CLIs ( antigravity , gemini , claude , codex , opencode , copilot , etc.) in headless mode with zero background overhead. You can install it on your work PC, define tasks in Markdown inside your project repository, and leave it running overnight. By morning, your AI agent has finished the work for you, delivering documented results while you were away.
Go to sleep. Wake up to results. — kage runs your AI agents overnight, so you start every morning with answers, not questions.
Go to sleep. Wake up to results. — kage runs your AI agents overnight, so you start every morning with answers, not questions.
kage is built to be a thin, transparent, and resource-efficient execution layer.
OS Native : Does not run a persistent background daemon. It leverages cron (Linux) and launchd (macOS) to wake up, execute tasks, and exit. Zero memory footprint when idle.
Headless CLI Mode : Directly integrates with official AI CLIs (like antigravity , gemini , claude , opencode , copilot , etc.) in their standard mode. It doesn't rely on unofficial or unstable internal APIs.
Stateless & Transparent : Every execution is logged, and states are managed simply via SQLite and Markdown files.
Autonomous Agent Logic : Automatically decomposes tasks into GFM checklists and tracks progress.
Persistent Memory : Stores task state in .kage/memory/ to maintain context across runs.
Lightweight Execution : Leverages OS-native schedulers. Zero background overhead.
Flexible Execution : Supports AI prompt execution, shell commands, and custom scripts.
Compiled Task Overrides : kage compile can materialize a prompt task into a sibling .lock.sh script with a stored prompt_hash , and kage will only execute that lock script while it matches the current prompt body.
Advanced Workflow Controls : Execution Modes : continuous , once , autostop . Concurrency Policy : allow , forbid (skip if running), replace (kill old). Time Windows : Restrict execution using allowed_hours: "9-17" or denied_hours: "12" .
Execution Modes : continuous , once , autostop .
Concurrency Policy : allow , forbid (skip if running), replace (kill old).
Time Windows : Restrict execution using allowed_hours: "9-17" or denied_hours: "12" .
Markdown-First : Define tasks using simple Markdown files with YAML front matter.
Layered Configuration : .kage/config.local.toml > .kage/config.toml > ~/.kage/config.toml > defaults.
Connectors : Integrate with Discord/Slack/Telegram. Task notifications are always enabled; bi-directional chat uses poll = true (1-minute polling) or Discord realtime = true (instant WebSocket replies with typing indicator) (⚠️ grants channel members AI access to your PC).
Thinking Process Isolation : AI workers automatically wrap reasoning in tags. Notifications, summaries, and cleaned outputs hide them, while kage logs keeps the raw stream available for debugging.
Web Dashboard : Execution history, task management, and AI chat — all in one place.
Connector-aware runs export KAGE_ARTIFACT_DIR as a workspace-local staging directory (for example .kage/tmp/connector-artifacts/ ). Incoming connector attachments are downloaded to KAGE_ARTIFACT_DIR/incoming for that same run and called out in the prompt so the provider can decide whether to inspect them. Discord, Slack, and Telegram still upload every top-level file left in KAGE_ARTIFACT_DIR alongside the text output, so tasks should keep only the intended final deliverables there and delete unwanted Markdown/Marp/HTML, downloaded images, and other intermediate assets before finishing.
Default built-in AI providers: codex , claude , gemini , antigravity , opencode , copilot , aider .
Use provider: antigravity to target Antigravity CLI. The built-in command template prefers the official agy binary and automatically falls back to antigravity when that is the executable name exposed on your PATH. For connector chat replies, kage uses a concise final-answer prompt and keeps Antigravity model arguments before --print so the user message is handled as the prompt instead of CLI session metadata.
Check out the Technical Architecture for more details.
The installer automatically runs pending install-time migrations after upgrading kage .
You can also add this repository's skills with:
Typer-based completion is enabled for kage .
Preview or generate the script manually:
You can also use Typer's built-in option for current shell detection:
Reload your shell after installation ( exec $SHELL -l ).
Shell completion also suggests task names and recent run IDs for positional arguments like kage run , kage compile , kage logs [ ] , kage task run , kage task suspend , kage task resume , and kage runs show . kage doctor also reports whether bash/zsh completion scripts are installed.
🌙 Overnight Tech Evaluation (OCR Model Benchmark)
The killer use case: go to sleep, wake up with a complete technology evaluation report.
Create a single task that, on every cron run, picks the untested OCR model, implements it, runs it against your test PDFs, and records the accuracy. By morning, you have a ranked comparison.
.kage/tasks/ocr_benchmark.md :
working_dir is optional. Absolute paths are used as-is; relative paths are resolved from the task file directory ( .kage/tasks/ ).
To pause a task without disabling it, use suspension metadata or the CLI:
kage task suspend --for 2w --reason "Vacation" writes those fields for you. --for accepts one token with m , h , d , or w ; --until accepts an ISO date or datetime. Date-only values resume at midnight in the task timezone. Suspended tasks are skipped by cron and by manual kage run ; use kage run --force or kage task run --force to run one intentionally.
🔍 Overnight Codebase Audit
.kage/tasks/audit.md :
🧪 Overnight PoC Builder
.kage/tasks/poc_builder.md :
AI Task — hourly health check:
The same task can use Antigravity CLI with:
Shell-Command Task — nightly log cleanup:
Connectors integrate with external chat services (Discord, Slack, Telegram). Task notifications via notify_connectors are always enabled as long as credentials are configured.
kage exec -p "Explain this repository" runs synchronously in the current directory without creating a task file or registering a project. It uses the existing project-agent resolution (falling back to the default agent, then built-in kage ) and provider settings. The answer goes to stdout; the run ID and diagnostics go to stderr. Runs and raw logs are available through kage runs and kage logs --run . Failures exit nonzero; Ctrl+C stops the provider process group and exits 130. Run this command from a human shell; execution from inside an agent run is rejected. JSON output and stdin input are not added by this command.
For lengthy one-off work requested in connector chat, use kage dispatch --name --prompt . It creates a new detached run, returns its run ID immediately, and automatically sends the eventual result back to the source connector. No task Markdown is required. The command accepts no agent or connector option: both are derived from the source KAGE_RUN_ID , the child run keeps the same immutable agent binding, and cross-agent connector delivery is rejected. The worker uses a machine-readable COMPLETE / CONTINUE / BLOCKED contract. Pending remote work continues in the same run for up to three provider turns, reusing operation identifiers from prior output. A completion claim that still describes pending or missing work is rejected; exhausted continuations and abandoned background tasks end as errors instead of false successes. Antigravity structured print_timeout failures (exit 3) also continue within that three-turn limit. Workers save operation IDs and completed steps in .kage/tmp/dispatch- .md , use foreground polls of at most 30 seconds, and are instructed to return a checkpoint before ten minutes so they can resume before the built-in 15-minute print timeout. Other provider failures remain terminal.
Outside a dispatch worker, detached work that finishes after its parent run must send its own completion message. The child process inherits KAGE_RUN_ID , KAGE_AGENT_NAME , and KAGE_ARTIFACT_DIR , so it can run:
Inside an agent run, the DB-anchored agent for KAGE_RUN_ID must match the connector's bound agent ; cross-agent sends are rejected. Agent-run attachments are restricted to top-level files in that run's KAGE_ARTIFACT_DIR . A human shell without agent environment variables remains an administrative context and may send through any configured connector.
For bi-directional chat, choose one mode per connector:
poll = true — fetch messages every minute via cron/launchd. Telegram shows a typing indicator while generating a .
realtime = true — Discord-only long-lived Gateway WebSocket listener with instant replies and a typing indicator.
If you already have kage cron run in your crontab, realtime listeners are managed automatically: set realtime = true and the listener starts within one minute; remove it and the listener stops on the cron tick. You can also manage them manually:
Realtime logs are written to ~/.kage/logs/connector-realtime- .log and rotated on each start; old rotated logs are kept for 7 days (max 5 files).
⚠️ Security Warning : poll = true or realtime = true allows anyone in the channel to interact with the AI, which has full access to your PC's file system and tools . Only enable one chat mode, and only in private/trusted channels.
⚠️ Security Warning : poll = true or realtime = true allows anyone in the channel to interact with the AI, which has full access to your PC's file system and tools . Only enable one chat mode, and only in private/trusted channels.
Telegram replies include recent messages from the same chat and bound agent across polls. Use the connector’s history_limit to set the maximum number of messages.
kage can infer an interest from a recent conversation, finish the relevant research, and send useful developments back to the same chat. For example, if a vacuum cleaner you discussed drops into your price range, kage can compare it with a newer model before advising you.
Follow-up is off by default. Add the following table to an existing connector to enable it for that connector's bound agent:
Follow-up uses conversations received after opt-in. The existing kage cron run dispatches due research after six hours of user inactivity. Rechecks are spaced one, three, seven, fourteen, then thirty days apart, repeating every thirty days. Renewed interest restarts the cadence for that topic, and resolved topics close. Each connector can send at most one proactive message per twenty-four hours. Research appears in kage runs .
Agents & Multi-tenant Isolation
An Agent is a top-level concept that owns projects, connectors, memory, and a system prompt. The built-in agent kage always exists and cannot be removed; connectors and projects with no explicit agent fall back to it. Define your own agents to give connectors distinct personas and to prevent context from leaking between them — for example a private Discord channel can be bound to agent private while a public channel is bound to public , and conversations never cross over.
When kage spawns the AI provider, it injects two environment variables:
KAGE_RUN_ID — the authoritative execution id. The CLI looks up executions.agent_name in the SQLite database to decide which agent you run as. This column is protected by a SQLite trigger and cannot be updated or deleted.
KAGE_AGENT_NAME — display hint only. Tampering with it has no effect: the database always wins.
From inside the spawned shell, kage * commands are scoped to the agent. You cannot list, show, or operate on connectors, tasks, or memory bound to another agent. Human shells (no KAGE_RUN_ID set) act as superusers and bypass the scope filter — use kage doctor to see the warning if you accidentally left these set in your shell environment.
Each agent owns a topic-keyed memory space at ~/.kage/agents/ /memory/ .md . At the start of every run kage injects the list of available memories into the system prompt using an block (one entry per memory, with , , and — file paths are intentionally hidden). When the AI needs the body of a memory it calls the CLI:
Memory is scoped per agent (not per task), overwrite-style (latest state only, updated_at is refreshed), and kage memory commands are themselves scoped to the current agent when run from within an agent context. The per-task memory system ( .kage/memory/ /YYYY-MM-DD.json and task.json ) has been removed; the install migration backs up and replaces legacy system_prompt.md files and archives legacy memory directories.
macOS launchd Specific Settings
On macOS, kage uses launchd instead of cron . You can further customize its behavior in config.toml :
darwin_launchd_interval_seconds : Set the launch interval in seconds (minimum 15 ).
darwin_launchd_keep_alive : Set to true to keep the process running (not recommended for simple polling).
kage runs is the run-history view. By default it shows a compact table with relative timestamps like 4h ago ; add --absolute-time to show detailed local timestamps again. kage logs is the raw-output viewer backed by per-run log files ( stdout.log , stderr.log , events.jsonl ). kage logs opens the latest run for one task, while bare kage logs merges all task logs in chronological order. Use --follow or -f to keep tailing appended output.
If a prompt task has a sibling compiled lock such as .kage/tasks/nightly.lock.sh , kage executes that lock instead of the prompt body only while its stored prompt_hash still matches the current prompt body. When the prompt changes, the lock becomes stale and you need to run kage compile again. kage doctor , kage task list , and the UI task cards all show whether a lock is fresh, stale, or missing. kage task show also prints the current prompt hash so you can inspect what the lock should match.
kage task list shortens the project column to the leaf directory name, shows prompt tasks as Prompt or Prompt (Compiled) , and resolves inherited providers as values like gemini (Inherited) so you can see what will actually run. Built-in codex runs now use codex exec --yolo ... in the default command template.
Suspension is separate from active : active: false disables a task, while suspended_until only blocks new starts until the deadline expires. Invalid suspended_until values fail closed, so the task is skipped until you fix the value or run kage task resume .
Connector polling replies are recorded in the same run history. Use kage runs --source connector_poll to isolate them, then inspect the raw AI CLI output with kage logs --run .
Install-time migrations are discovered automatically from src/kage/migrations/install/ . New migration modules added there are picked up by both kage migrate install and install.sh .
kage tui provides a terminal dashboard powered by Textual. It has four tabs: Logs, Tasks, Connector, and Settings. The Logs tab filters runs and rendered logs from a task/run sidebar, the Tasks tab shows task details, the Connector tab shows connector history, and the Settings tab shows the global config snapshot.
Provider-specific model selection can be layered in the same files. You can set a single model or a fallback list with models :
When models is set, kage tries each model in order and falls back to the one only when the hits a rate or usage limit. If all models fail, the run fails.
Built-in providers use --model by default. You can also set nested keys via CLI:
Release files for kage-ai 0.15.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation .
Source distribution (sdist)
Built distribution (wheel)
Total release size: 2.6 MB
Release files / kage_ai-0.15.14.tar.gz
Release files / kage_ai-0.15.14-py3-none-any.whl
Security for kage-ai 0.15.14
Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
Release history Release notifications | RSS feed
Nov 28, 2026 2 release files No provenance
Nov 28, 2026 2 release files No provenance
Nov 28, 2026 2 release files No provenance
Nov 5, 2026 2 release files No provenance
Sep 20, 2026 2 release files No provenance
Sep 20, 2026 2 release files No provenance
Sep 20, 2026 2 release files No provenance
Sep 19, 2026 2 release files No provenance
Jul 10, 2026 2 release files No provenance
Jul 8, 2026 2 release files No provenance
Jul 6, 2026 2 release files No provenance
Jul 6, 2026 2 release files No provenance
Jul 5, 2026 2 release files No provenance
Jun 12, 2026 2 release files No provenance
Jun 12, 2026 2 release files No provenance
Jun 12, 2026 2 release files No provenance
Apr 25, 2026 2 release files No provenance
Apr 3, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 28, 2026 2 release files No provenance
Mar 15, 2026 2 release files No provenance
Mar 14, 2026 2 release files No provenance
Mar 14, 2026 2 release files No provenance
Mar 14, 2026 2 release files No provenance
Mar 14, 2026 2 release files No provenance
Mar 14, 2026 2 release files No provenance
Mar 14, 2026 2 release files No provenance
Mar 8, 2026 2 release files No provenance
Mar 8, 2026 2 release files No provenance
Mar 7, 2026 2 release files No provenance
Mar 4, 2026 2 release files No provenance
Mar 3, 2026 2 release files No provenance
Mar 3, 2026 2 release files No provenance
Mar 3, 2026 2 release files No provenance
Mar 2, 2026 2 release files No provenance
Mar 1, 2026 2 release files No provenance
Mar 1, 2026 2 release files No provenance
Mar 1, 2026 2 release files No provenance
Mar 1, 2026 2 release files No provenance
Mar 1, 2026 2 release files No provenance
Mar 1, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 28, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 25, 2026 2 release files No provenance
Feb 25, 2026 2 release files No provenance
Feb 25, 2026 2 release files No provenance
Feb 25, 2026 2 release files No provenance
Feb 25, 2026 2 release files No provenance
Feb 24, 2026 2 release files No provenance
Feb 23, 2026 2 release files No provenance
Feb 23, 2026 2 release files No provenance
Feb 23, 2026 2 release files No provenance
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
