文档Docs
长程任务:说一次,以后自己跑"Long tasks: say it once, it runs on its own"
说一句「做每周竞品简报」,Agent 先自查会什么,缺的集中到一张开工卡,你确认一次,以后按时自己跑、自己交付。Say "set up a weekly competitor brief" — your Agent checks what it can do, puts what is missing on one start card, you confirm once, and it runs and delivers on schedule.
有些事不是一次性的:每周看一遍竞品、每天整理一份资料、每月对一次账。在 Agent J 里,你只要用一句话说出来,比如「做每周竞品简报」。剩下的由你的 Agent 来办:先查它现在会什么、还缺什么,把真正需要你决定的事集中到一张开工卡上;你确认一次,它就按时自己跑、自己交付。
这里没有新按钮。所有事都从聊天里一句话开始。
一次完整的过程
- 你说一句话。 例如「每周一早上 9 点,帮我做一份三家竞品的公开资料简报」。
- Agent 自查。 它会看这台Agent J 主机上已经装好的能力:能不能读公开网页、能不能把文件存到Agent J 主机上、你的手机有没有配好,还有已经有哪些工作流。能自己检查的,它都先查一遍,不来问你。
- 一张开工卡。 真正要你决定的事(比如关注哪三家、谁来接收)最多五项,放在同一张卡上。卡上还写着这次要做什么、交付到哪里、什么时候自动运行。
- 你点「确认并开始」。 如果是新工作流,或者要每周自动运行,这一下同时确认任务书并启用定时。
- 以后按时自己跑。 每次运行完,负责这个工作流的 CEO 会写一份报告。Agent 读过报告、核对过产物,才会告诉你已经完成。
后台、一次性和手动任务完成后,先由主 Agent 核对报告,再向你汇报,不直接把结果推到手机。你从已配对手机或账户页启用的定时任务,打开通知后会按界面语言发一句状态;来源不明的结果留在本机待查,不反复提醒你核对。
开工卡上有什么
- 这次要做什么:目标、交付物(比如
reports/weekly.md)、多久运行一次。 - 需要你选:最多五项。可以是选项,也可以写一句话。选过的内容以后每次沿用。
- 还要配置的:例如还没登录的网站、还没存的服务。这些不在卡上填:要密钥时,手机会另外弹出专用的密钥卡,Agent 看不到密钥本身。
- 可选项:没有也能完成,比如付费调研服务。缺了也不会挡住任务,Agent 会改用免费的公开资料。
- 点「确认并开始」等于同意什么:按这份任务书新建工作流、按时运行、沿用你的选择。
确认不等于同意付款、删除、对外发送、改密钥或改价。这五类事以后每次都会单独在手机上问你。把结果推到你自己已配对的手机上,不算「对外发送」。
点「返回修改」就不会开工。直接在聊天里说想改什么就行。卡片大约 30 分钟内有效,过期后什么都不会发生。
「你会什么」
在聊天里问一句「你会什么」,手机上会弹出能力页:哪些已就绪、哪些需要配置,可以筛选,点一项能看说明。能力会定期自动复验,比如网页读取每 15 分钟、工具每 7 天。这只是检查,不会因此再来问你。
清单还会列出专用浏览器、已配置的网站和 Google 工具。网站登录检查超过 15 分钟就过期,浏览器停止时相关能力不可用。装好 Google 工具不等于完成接口授权;每个 Google 用途要连接并测通后才算就绪。
什么时候它还会来问你
- 五类高风险操作:付款、删除、对外发送、改密钥、改价,每次都单独问。
- 真正缺少你的决定或授权,比如某个网站要你本人登录。这时只停下依赖它的那部分,别的照常继续,事后把缺口集中告诉你。
- 你改了目标、交付或定时。小的措辞调整不会重新问你。
决策流水:第二天也看得懂它是怎么做的
Agent 干长活时,会把每个阶段的关键决定记下来:决定了什么、为什么、证据在哪。第二天早上,主 Agent 能一步步告诉你当时是怎么做的,而不只给你一个结果;上下文压缩或程序崩溃之后,也从这份流水接着做。
- 主对话记在工作根目录下的
.agentj/decisions/<日期>.jsonl,一天一个文件;工作流 CEO 记在工作流目录的reports/decisions.jsonl。都是普通文件,只存在这台 Agent J 主机上。 - 证据只写位置(文件和行号、提交、日志路径),不抄内容。看起来像密码或密钥的文字会被拒绝,不会写进去。
- 每个阶段记一行,不是每条命令记一行。一行最多 1 KB,哪一项太长就会被拒绝:写短一点,细节放进证据文件。
Agent 用这两条命令记和看,你也可以在 Agent J 主机的终端里自己查看:
agentj decide "先做一篇,确认格式再做其余的" --why "几十篇格式相同,先验一篇最省事" --evidence reports/first.md --phase 实现
agentj decide list --since 12h
不写 --since 就列出今天的;加 --dir <工作流目录> 看某个工作流的流水,加 --json 输出 JSON。
主 Agent 怎么派活、怎么验收
主 Agent 和各工作流的 CEO 派活、收活时守这些规矩:
- 派活先说清怎样算做完。 每次派出去,都写明要交回什么证据,比如哪份报告、哪些检查要通过。
- 一批同类的活,先做通一个。 读过它的报告再铺开做其余的;空出一个位置就马上补上,不攒着一起派。
- 范围变了就另派。 要做的事变了,就带上完整背景重新派一个任务,不往正在干活的 Agent 身上加新活。同一件事的补充说明照常追加。
- 登记过的后台活你看得见。 它放到后台的活要通过
agentj busy run启动;这样登记过的,手机上才会出现对应的后台小机器人,没登记的不显示。从 0.26.1 起改为自动登记。 - 边做边记关键决定,记进上面的决策流水。
- 验收看产物,不看总结。 它会打开产物逐项核对,能重跑的检查自己再跑一遍。
- 按证据分派。 报错或请求指向哪个工作流,就交给哪个;哪个都对不上,就直说不清楚,再去查,不乱猜。
- 问你时带上建议。 每个要你拍板的问题,都附上它推荐哪个、依据是什么、有什么风险。你没回答不算同意。
- 你让它先停一下,它就停在安全的地方。 做完或撤回手上这一步,不再开新的,停掉自己启动的后台任务,保存进度,写好以后怎么接着做。你让它继续,它就接着干。
定期报告和邮件:用固定模板
直接说出来就行,比如:每天早上给我发一封市场调研邮件;每周一把周报发我邮箱。Agent 把内容填进固定模板,先按模板的规则检查一遍,过了才发。所以每天的邮件长得一样;缺标题、链接写错的报告不会发出去,Agent 会先改好。
- 选样式:在报告模板画廊里挑一个告诉 Agent,比如说用 R14。不选就用 R15 Agent J Noir。R15、R02、R14 能发邮件,其余只出网页。
- 发给自己在审批卡上点一下同意就行。发给别人要在手机上用审批通行密钥确认。见用邮件指挥 Agent J。
- 模板来自广场包 web-page-report。Agent J 主机上还没装,Agent 会先问你。
- 工作流按固定名单发素材邮件:第一次要你在遥控器的批准卡上确认,这张卡 30 分钟内有效。之后普通发信、发信次数变化都不会让授权失效;收件人地址、账号或工作流本身变了,下一次运行会重新发一张卡并写明原因。没处理的卡过期后,最多每 6 小时再发一次。
Agent 用内置的 agentj-report 技能来做:
agentj report example R15 > report.json 看要填哪些字段
agentj report validate report.json 退出码 2 = 哪些字段不对
agentj report send report.json --to-owner 检查、生成邮件、发给你
需要知道的限制
- Agent J 主机要开着、联网。 Agent J 主机休眠时任务不会跑,Agent 不会假装云端还在继续。参见让Agent J 主机保持唤醒。
- 连接器(MCP)只列出,不会自动试运行:启动第三方程序去测试本身就是一种操作,所以它们显示为「待检查」。
- 旧版手机页面看不到开工卡,只会收到一行提示,刷新页面即可。
主机重启后
主机服务重启后,未完成的工作流显示中断状态,已有报告保留,不会自动重放或复用旧审批。若无法确认旧执行是否结束,先核对报告和发送、发布等外部操作,再由主人重新启用该工作流;手动重跑会得到新的运行编号。停机期间错过的定时任务仍不补跑。
分步自动化:从失败的那一步继续
一个自动化可以拆成几步(task.json 里的 "steps",2 到 12 步)。每一步单独运行,做完一步 Agent J 就记下一步。某一步失败时,后面的步骤不会开始;失败消息会说清是哪一步、为什么,并告诉你怎么继续:让 Agent 从失败处继续,或者在 Agent J 主机上运行 agentj automation resume <运行编号>。
- 做完的步骤不再重跑。 它们的结果直接复用,交给后面的步骤。
- 前面有东西变了,比如前面某一步生成的文件被删了、被改了,或者它的说明改了,Agent J 会从那一步重新开始,并告诉你原因。
- 不能重复做的步骤会先问你。 上次可能已经发出、发布或付过款的步骤,要你在手机上确认(或在你自己的终端加
--yes)才会再跑。标成"idempotent": true的步骤(跑两遍对外面没有影响)不问你直接继续,失败了还可以自己重试("retry",最多 3 次)。 - 一次运行只能续跑一次。进度记录坏了就不猜:请整条重新运行。
你自己的自动化往手机发消息
你自己写的脚本、定时器(systemd、cron、launchd)可以往手机发一条消息,还能带图片和文件。手机上会出现一页消息,标题是「来自你的自动化:」加上它的名字;图片、PDF、文本文件显示成文件卡片,可以预览、下载。同一条消息也会交给 Agent 看一眼。Agent 只把它当作脚本发来的资料,不当成你的指令:没什么要补充的就不出声;需要你注意时另起一页告诉你,和手上的工作有关就接着做。
- 建自动化时打开一次开关。 在这台 Agent J 主机的终端运行
agentj notify --allow <名字>,或者在手机设置里的「自动化消息」里打开。每个自动化默认都是关的;运行时手机上不会弹窗问你。 - 在脚本里这样调用:
agentj notify --from wechat-login-push --title "视频号掉线,请扫码登录" --text "23:30 自动检查发现登录已失效" --file ~/qr.png
agentj notify --list查看登记了哪些;--deny <名字>关掉,--forget <名字>删除登记。agentj config set notify.enabled false关掉全部自动化消息。也可以在手机设置里的「自动化消息」里管:最上面是总开关,下面列出每个自动化和每个长程任务,各有一个开关。- 限制:文字 4000 字以内,标题 64 字以内;最多 4 个文件,每个不超过 20 MB(png、jpg、gif、webp、pdf、txt、md);每个自动化每分钟最多 6 条。凭据文件和含密钥的文本会被拒绝,不会发出。
- 手机都不在线时,消息留在历史里,并给你发一条通知。
- 只有你自己的脚本能用。Agent 永远不能往这里发,开关打开了也不行。
- Agent 帮你建的长程任务在创建时就定好(任务的
task.json里写"notify_webapp": true,默认关)。打开后,每次运行存进reports/文件夹的图片和文件会出现在它的结果页上。每个任务也能在同一个手机设置里单独改。
隐私
能力清单、任务书、你的选择、报告都只存在这台Agent J 主机上,不会进账号后台,也不会进运营方的数据库。手机和Agent J 主机之间全程端到端加密,中继服务器只能看到密文。
给你的 Agent 看(命令参考)
这些命令由主 Agent 通过内置的 agentj-capability 技能调用,你不需要自己敲:
agentj capability list|sync|check [--json] 能力清单 / 发现并检查 / 复验
agentj capability show 把「我的 Agent 会什么」发到主人手机
agentj capability digest --dir <工作流> 任务书摘要与问题检查
agentj capability prepare --workflow <id> [--asks <文件>] 开工卡(≤5 项)
agentj capability result <卡片 id> [--wait]
agentj capability dispatch --workflow <id> 派给工作流 CEO(已在跑就不重复)
agentj capability report-check --dir <工作流> --verdict <ok|attention|fail>
agentj automation status <自动化或运行编号> 每一步的状态(分步自动化)
agentj automation resume <自动化或运行编号> 从失败的那一步继续(不能重复的步骤先发确认卡)
任务书是工作流目录里的 brief.json(字段固定),CEO 的报告是 reports/report.json。没有报告、验收没通过或产物读不到,都不算完成。
已有的定时任务改用系统定时
反复运行的事,现在默认交给 Agent J 主机自带的定时器(见用 Agent J 主机自带的定时器)。以前在 Agent J 里启用的定时任务,可以一次搬过去:到点由系统直接启动你的 AI 编程工具,你不在手机旁也不会卡在审批上。
- 升级后手机上弹一张主机审批卡,第一行是「Agent J 主机 · 定时任务改用系统定时」。卡上列出要搬的任务,并写明:搬过去以后按时自己跑,不经手机审批;普通工具按底层 AI 编程工具的权限运行,清单命令仍须主人当场验证;开着隔离时,Agent J 的状态和密钥对它们仍不可见;全部停下能停住它们。这张卡不用 Face ID,只有已配对的遥控器能回答,每次回答都留记录。批准后,Agent J 现在就把这些任务搬好,再发一条结果;点「拒绝」就不搬,也不再自动弹卡,任务照旧在 Agent J 里跑。卡片没人回答,6 小时后再问,每个版本最多问三次。
- 每个任务马上试跑一次。 试跑报告最后一行不是
VERDICT: PASS,就自动退回原样。搬好后旧任务停用,不删除。只读的研究任务搬过去还是只读,也不能联网。用 Codex 的只读任务不读你的config.toml,自定义服务商只设在那里的,试跑会失败并自动退回。 - 也可以在 Agent J 主机的终端里搬。 先加
--dry-run看每个任务会怎么搬、哪些不搬及原因,这一步不动任何东西:
agentj tasks migrate <任务名> --dry-run
agentj tasks migrate <任务名>
agentj tasks migrate --all
真搬一定要你在手机卡上批准。在终端运行 agentj tasks migrate,不管是你还是 Agent 运行,都只是把这张卡发到你手机上;Agent J 没在运行或者没有在线的手机,就不搬。手机上拒绝过以后,24 小时内最多再发一张;终端发出的卡不写「以后别问」。用 agentj wizard add-template 新建任务、用 agentj tasks enable 打开任务时,终端都会提示可以改用系统定时。agentj tasks list 会在搬过的任务后面写「→ 已迁到系统定时」。
- 看结果:每次运行完,手机上收到一条通知,写明这次(系统定时)通过还是没有通过,后面是报告最后一行的说明。完整报告在 Agent J 的状态目录
~/.local/state/agentj/sysmigrate/<任务名>/runs/里,在你自己的终端打开;开着隔离时,Agent 看不到这个目录。工作流目录里不会多出文件。 - 在手机上管理搬过的任务。 手机「定时任务」页里,搬过的任务标着「已迁到系统定时」,下面有「退回」按钮;任务改了以后还会出现「重新迁移」。
- 改了任务要重新搬。 搬过去以后又改了任务的
task.json或说明,到点就不再运行,手机上收到通知,「定时任务」页里这个任务标着「任务改了,没有运行」。点「重新迁移」并确认,Agent J 按新内容重新搬好,马上试跑一次。 - 全部停下也停它们。 点了全部停下,正在跑的那一次马上停下,到点的运行直接跳过,等你恢复再照常跑。关着隔离时,在 macOS 和 Windows 上,AI 工具完全脱离出去的进程可能还在跑。
- 关机时错过的不补跑,等下一次到点。macOS 例外:Mac 睡眠时错过的,醒来后 launchd 会补跑一次。
- 想退回:在手机「定时任务」页点这个任务的「退回」并确认,系统定时关掉,任务回到 Agent J,保持停用;要它照旧在 Agent J 里跑,再点「启用」。在网页终端或 Agent J 主机的终端里,也可以运行
agentj tasks unmigrate <任务名>,再运行agentj tasks enable <任务名>;agentj tasks migrate <任务名>就是重新迁移。用agentj tasks disable或手机上点「停用」,也会撤下系统定时,任务保持停用。 - 卸载服务会撤下它们。
agentj service uninstall会撤下所有搬过的任务,任务保持停用,你在卡上的选择也会忘掉。装回来以后,先用agentj tasks enable <任务名>打开,再运行agentj tasks migrate <任务名>。 - 这些任务不搬,照旧在 Agent J 里跑,并写明原因:多步任务(进度记在 Agent J 里);带任务书
brief.json的;说明里像有密钥的;系统定时里已经有别人建的同名任务;正在运行的;Agent 隔离起不来的;用 OpenCode 的只读任务;用 Kimi Code 或 dsh 的任务;时间表换算不成系统定时的。 - WSL2 没开 systemd 时,什么都不搬。手机上会收到一条说明;点提示下方的「帮我开启 WSL 的 systemd」(也可以直接回复这句话),Agent 会替你开好,开好以后手机上再弹迁移卡。其他没有 systemd 用户服务的 Linux,什么都不搬,也不弹卡。
- 没登录时:Linux 上
Linger=no的话,搬过去的任务只在你登录时运行,和原来一样。
后台任务提示来源被拒绝
已启用的定时任务和手动运行的任务由主人委托执行。在「中等」和「安全」档,低风险读取和普通文件写入按现有安全规则处理,需要确认的动作在已配对遥控器上发卡。启用任务不等于批准对外发送、使用秘密或不可逆操作,这些仍逐次确认。
定时任务、工作流、心跳、主机通知、交接恢复和后台完成回合里的普通工具,都跟随底层 AI 编程工具的权限,不因回合标签额外拒绝或要求指纹;心跳回合有一处例外:扣款和不可逆命令会要求主人当场验证指纹。只有 agentj uv list 明确列出的命令及对应手机操作,仍须主人当场验证;无人验证时不执行该步,独立工作可以继续。好友访客隔离不变,外部正文不能代替主人验证。
需要卡的那一步碰上没有遥控器在线:卡片照常发出,20 秒后还没人上线,这一步先挂起,Agent 去做不依赖它的活;接了 Telegram 或邮件通道的,还会收到一条提醒(见没有遥控器在线时)。这不是你点了拒绝。30 分钟内你批准了,Agent 原样重试这一步就会执行。改 Agent J 自己设置的卡不挂起,一直等你处理。
有些唤醒在任何档位都不能请求审批:Claude Code 自己安排的唤醒(比如 /loop、它自己建的定时);用 agentj busy run 或 agentj busy start 启动的任务做完时;Agent J 没看到是你那一轮派出去的后台任务;群聊或访客邮件引出的任务。来源已核验的回合可以读报告;来源不明的回合先等你核对,不能请求审批。要审批的活,交给 Agent J 的心跳或定时任务来做。Claude Code 的循环唤醒(/loop、它自己建的定时)碰上要审批的步骤被拒时,手机上会提示改用定时任务:点提示下方的「把这个循环改成定时任务」(也可以直接回复这句话),它就帮你建好定时任务。
来源检查拒绝不代表你点了拒绝。来源不明、被拒或超时的动作只保留在本机清单,Agent J 继续不依赖它的工作,不主动提醒你核对。需要查看时,从已配对遥控器发送 /recover-background 查看清单,再发 /recover-background <编号> 核对一份固定的本地报告。这只读取一次未改动的已登记报告,不另弹审批卡。报告不安全、读不到或已改动时,记录仍保留在清单中。
核对不会重试原操作,也不证明原操作成功。发送等动作可能已执行时,先对账。群聊、访客邮件和已知第三方任务不能借此取得你的权限。要提交官方反馈,在你自己的对话里明确说出要提交的内容;仍按现有脱敏和发送规则处理。
让主对话保持可用
Code 模式下,主对话在计入预算的工具调用达到 8 次或经过 180 秒后,把较长的工作交给后台;豁免的只读和状态检查不计入次数。这不代表一定在 30 秒内收到回复。已收到只表示消息已受理,不表示 Agent 已回答。
打断当前工作适用于已精确绑定当前回合的 Codex,以及由本主机启动并持有的 Claude Code 进程。OpenCode 和外部启动的 Claude Code 暂不支持这种打断,页面会说明不可用。原有停止按钮仍按各自范围工作。
Long tasks: say it once, it runs on its own
Some work repeats: a weekly look at competitors, a daily digest, a monthly reconciliation. With Agent J you say it once in chat — for example "set up a weekly competitor brief". Your Agent checks what it can already do, asks everything that is genuinely yours to decide on one start card, and after a single confirmation it runs and delivers on schedule.
There is no new button. Everything starts with a sentence in chat.
How it goes
- You say it. "Every Monday at 9:00, a brief on three competitors from public sources."
- Your Agent checks itself. Can it read public web pages, save files on the Agent J host, reach your paired phone, which workflows exist already? Whatever it can check, it checks — without asking you.
- One start card. At most five things that only you can decide (which three competitors, who receives it), on one card, together with what will be done, where it is delivered and when it runs.
- You tap Confirm and start. For a new workflow or a weekly schedule, this one tap confirms the brief and turns the schedule on.
- It runs on its own. After every run the workflow's CEO writes a report. Your Agent reads the report and checks the results before it tells you "done".
Background, one-off and manual task results go to the main Agent for review before it reports to you. They do not go straight to your phone. A schedule you enable from a paired phone or account page can send one status sentence in the interface language when notifications are on. Unknown-source results stay in the local records without repeated reminders.
What the start card shows
- What this does: the goal, the deliverable (for example
reports/weekly.md) and how often it runs. - Your choices: at most five — options to tap or a short answer. They are reused every time.
- Still to set up: a site you have not signed in to, a service not saved yet. Nothing to type on the card: a key opens the dedicated secret card, and your Agent never sees the value.
- Optional: things the task works without, such as a paid research service. Missing ones never block — your Agent uses free public sources instead.
- What Confirm and start means: create the workflow from this brief, run it on schedule, reuse your choices.
Confirming does not approve paying, deleting, sending anything outside, changing keys or changing prices: those still ask you on the phone, one by one. Sending the result to your own paired phone does not count as sending anything outside.
Change something sends the card back and nothing starts — just say in chat what to change. A card is valid for about 30 minutes; when it expires nothing happens.
"What can you do"
Ask "what can you do" in chat and a capability page opens on your phone: what is ready, what needs setup, filterable, tap an item for details. Capabilities are re-checked automatically (web reading every 15 minutes, tools every 7 days) — a re-check never becomes a new question for you.
The list also includes the dedicated browser and its configured sites, plus the Google tool. Site sign-ins expire after 15 minutes and a stopped browser is unavailable. Installing the Google tool does not authorize Google APIs; each Google purpose is ready only after it was connected and checked.
When it still asks you
- The five high-risk actions: paying, deleting, sending outside, key changes and price changes — every time, separately.
- A decision or authorization that is genuinely missing, such as a site only you can sign in to. Only the part that depends on it waits; everything else continues, and the gap is reported in one go.
- You changed the goal, deliverable or schedule. A small wording change does not ask again.
The decision log: see how it got there the next day
On long work your Agent writes down the key decision of each stage: what it decided, why, and where the evidence is. The next morning the main Agent can walk you through how it got there, step by step, instead of handing you only the result. After a compaction or a crash, this log is where the work picks up again.
- The main conversation writes to
.agentj/decisions/<date>.jsonlunder the working root, one file a day; a workflow CEO writes toreports/decisions.jsonlin its workflow folder. They are plain files and stay on this Agent J host. - Evidence is a pointer (a file and line, a commit, a log path), never a copy. Text that looks like a password or a key is refused and never written.
- One line per stage, not per command. A line is at most 1 KB, and a field that is too long is refused: shorten it and put the detail in the evidence file.
Your Agent records and reads the log with these two commands; you can read it yourself in a terminal on the Agent J host too:
agentj decide "Do one article first, check the format, then the rest" --why "Dozens share one format, so checking one first is cheapest" --evidence reports/first.md --phase build
agentj decide list --since 12h
Without --since it lists today's decisions. Add --dir <workflow folder> for one workflow's log, or --json for JSON.
How the main Agent hands out and checks work
The main Agent and every workflow CEO keep to the same rules when they hand out work and take it back:
- Every job says what counts as done: which report, which checks have to pass.
- A batch of similar jobs starts with one. It reads that one's report before fanning out, and fills a free slot as soon as it opens instead of saving jobs up for a batch.
- New scope, new job. When what needs doing changes, it sends a fresh job with the full background instead of piling more onto an Agent that is already running. More detail about the same job is still passed along.
- Registered background work is visible. It is meant to start background work through
agentj busy run; only work started that way shows a background robot on your phone, anything else does not. From 0.26.1 this registration is automatic. - Key decisions go into the decision log above as the work goes.
- Acceptance reads the results, not the summary. It opens what was produced, checks it item by item, and reruns the checks itself when it can.
- Routing follows the evidence. An error or a request goes to the workflow it points at; if nothing matches, it says so and looks into it rather than guessing.
- Questions come with a recommendation. Everything you are asked to decide carries what it recommends, why, and the risk. No answer is not a yes.
- Tell it to stop for now and it stops at a safe point. It finishes or undoes the current step, starts nothing new, stops the background jobs it started, saves its progress and writes down how to resume. Tell it to carry on and it picks up again.
Recurring reports by e-mail: a fixed template
Just say it, for example send me a market-research e-mail every morning or e-mail me the weekly report every Monday. Your Agent fills the facts into a fixed template, checks them against the template's rules, and only then mails the result. So the mail looks the same every day, and a report with a missing title or a broken link is not sent — the Agent fixes it first.
- Pick a look in the report template gallery and tell your Agent, for example use R14. Without a choice it uses R15 Agent J Noir. R15, R02 and R14 come as e-mail; the others are web pages only.
- Mail to yourself needs one tap on the approval card. Mail to anyone else needs your approval passkey on the phone. See Command Agent J by e-mail.
- The templates come with the plaza package web-page-report. If it is not installed, your Agent asks you first.
- Workflows that mail artifacts to a fixed list ask once on an approval card on your remote; the card stays valid for 30 minutes. Ordinary sends and changing send counts no longer void the grant. If a recipient address, the account or the workflow itself changes, the next run posts one new card that says why; an unanswered card is posted again at most every 6 hours.
Your Agent runs it with its built-in agentj-report skill:
agentj report example R15 > report.json the fields to fill
agentj report validate report.json exit 2 = which fields are wrong
agentj report send report.json --to-owner check, build the e-mail, send it to you
Limits worth knowing
- the Agent J host must be on and online. A sleeping computer runs nothing, and your Agent will not pretend the cloud carries on. See Keep the Agent J host awake.
- Connectors (MCP) are listed but never test-started: starting a third-party program to test it is itself an action, so they show as "To check".
- An older phone page cannot show the start card; it gets one line asking you to reload the page.
After a host restart
After a host restart, unfinished workflows show as interrupted and existing reports remain. Old runs and approvals are never replayed. If the old execution may still be active, check its reports and external effects, then have the owner enable the workflow again; a manual rerun gets a new run ID. Missed schedules still have no catch-up.
Multi-step automations: continue from the failed step
An automation can be split into steps ("steps" in its task.json, 2 to 12). Each step runs on its own and Agent J
records every step as it finishes. If a step fails, the later steps do not start, and the failure message says which step
failed and why, with a way to continue: ask your Agent to continue it from where it failed, or run
agentj automation resume <run id> on the Agent J host.
- Finished steps are not run again. Their results are reused and handed to the next steps.
- If something earlier changed, for example a file an earlier step made was deleted or edited, or its instructions changed, Agent J starts again from that earlier step and tells you why.
- Steps that are not safe to repeat ask you first. A step that may already have sent, posted or paid something last
time runs again only after you confirm on the phone (or with
--yesin your own terminal). Steps marked"idempotent": true(running twice changes nothing outside) continue without asking, and may retry by themselves ("retry", up to 3 times). - One run is continued once. If its progress record is damaged, nothing is guessed: run the whole automation again.
Messages from your own automations
Your own scripts and timers (systemd, cron, launchd) can post a message to your phone, with images or files attached. The phone shows one page titled "From your automation: …" with its name; images, PDFs and text files open as file cards you can preview or download. Your Agent also gets a copy. It treats it as information from a script, not as your instruction: with nothing to add it stays quiet; if something needs your attention it tells you on a page of its own, and if it concerns work in hand it carries on.
- Turn it on once, when you make the automation. In a terminal on this Agent J host, run
agentj notify --allow <name>, or switch it on in the phone's Settings under Automation messages. Every automation is off until you turn it on; nothing pops up on the phone while it runs. - Call it from the script:
agentj notify --from wechat-login-push --title "Channel signed out, scan to sign in" --text "The 23:30 check found the sign-in expired" --file ~/qr.png
- See what is registered with
agentj notify --list; switch one off with--deny <name>, remove it with--forget <name>.agentj config set notify.enabled falseturns all automation messages off. The phone's Settings → Automation messages does the same: a master switch at the top, then every automation and every long task with its own switch. - Limits: text up to 4000 characters, title up to 64, at most 4 files of up to 20 MB each (png, jpg, gif, webp, pdf, txt, md), 6 messages a minute per automation. Credential files and text containing a key are refused, never sent.
- If no phone is online, the message waits in the history and you get a notification.
- Only your own scripts can use this. An Agent can never post here, even with the switch on.
- Long tasks made by your Agent decide this when they are created (
"notify_webapp": truein the task'stask.json, default off). When on, the images and files a run saves to itsreports/folder appear on its result page. You can change it for each task in the same phone settings.
Privacy
The capability list, briefs, your choices and reports stay on the Agent J host only — not in the account dashboard, not in the operator's database. Phone and computer talk end to end encrypted; the relay sees ciphertext only.
For your Agent (command reference)
The main Agent runs these through its built-in agentj-capability skill; you never type them:
agentj capability list|sync|check [--json] inventory / discover and check / re-check
agentj capability show put "What my Agent can do" on the owner's phone
agentj capability digest --dir <workflow> brief digests and problems
agentj capability prepare --workflow <id> [--asks <file>] the start card (≤ 5 items)
agentj capability result <card id> [--wait]
agentj capability dispatch --workflow <id> hand it to the workflow CEO (never twice)
agentj capability report-check --dir <workflow> --verdict <ok|attention|fail>
agentj automation status <automation or run id> each step of a run (multi-step automations)
agentj automation resume <automation or run id> continue from the failed step (a card for steps not safe to repeat)
The brief is brief.json in the workflow folder (fixed fields); the CEO's report is reports/report.json. No report,
unverified acceptance or an unreadable result is not done.
Move existing scheduled tasks to the system scheduler
Recurring work now goes to the Agent J host's own scheduler by default (see Use the Agent J host's own scheduler). Scheduled tasks you enabled in Agent J earlier can move there in one go: at the set time the system starts your AI coding tool itself, so a run never waits on an approval while you are away from the phone.
- After an update your phone shows one host approval card. Its first line is "Agent J host · Move to the system scheduler". It lists the tasks and says that once moved they run on time without approvals on the phone: ordinary tools follow the AI coding tool permissions, while listed commands still require in-person owner verification; with isolation on, Agent J's state and keys stay hidden from them; Stop everything still stops them. This card needs no Face ID; only a paired remote can answer it, and every answer is logged. Approve it and Agent J moves them now, then sends one result. Tap "Deny" and nothing moves and the card doesn't come back by itself; the tasks keep running in Agent J. A card nobody answers comes back after 6 hours, at most three times per version.
- Each task runs once right away as a test. If the test report's last line is not
VERDICT: PASS, the task goes back as it was. A moved task's old entry is switched off, not deleted. A read-only research task stays read-only and cannot go online. Read-only tasks on Codex don't read yourconfig.toml: if a custom provider is set only there, the test run fails and the task goes back. - You can also move tasks in the Agent J host's terminal. Add
--dry-runfirst: it shows how each task would move, and which won't and why, without changing anything:
agentj tasks migrate <task> --dry-run
agentj tasks migrate <task>
agentj tasks migrate --all
The real move always needs your approval on the phone card. Running agentj tasks migrate in a terminal, by you or by your Agent, only sends that card to your phone; if Agent J is not running or no phone is online, nothing moves. After a Deny on the phone it sends at most one card per 24 hours, and a card sent this way doesn't say "don't ask again". When you create a task with agentj wizard add-template or switch one on with agentj tasks enable, the terminal suggests moving it. agentj tasks list marks a moved task "→ moved to the system scheduler".
- Results: after each run your phone gets a notice saying whether this run (system scheduler) passed or did not pass, followed by the note on the report's last line. The full reports are in Agent J's state directory,
~/.local/state/agentj/sysmigrate/<task>/runs/; open them in your own terminal. With isolation on, your Agent can't see that folder. Nothing is added to the workflow folder. - Manage moved tasks on the phone. On the phone's "Scheduled tasks" page a moved task is marked "Moved to the system scheduler", with "Move back" below it. If the task has changed, "Move again" also appears.
- Edit a task, move it again. If you change a moved task's
task.jsonor instructions, it no longer runs, your phone gets a notice, and the "Scheduled tasks" page marks it "Task changed — not running". Tap "Move again" and confirm: Agent J moves it with the new content and runs it once as a test. - Stop everything stops them too. Stop everything ends a run in progress, and while everything is stopped their runs are skipped; after you resume they run on schedule again. With isolation off, on macOS and Windows a process the AI tool fully detached may keep running.
- A time missed while the Agent J host was off is not run later; the task waits for its next time. One exception: on macOS, launchd runs one time missed during sleep when the Mac wakes up.
- To go back: on the phone's "Scheduled tasks" page tap "Move back" on the task and confirm. The system timer is switched off and the task comes back to Agent J switched off; to run it in Agent J again, tap "Turn on". In the web terminal or the Agent J host's terminal you can also run
agentj tasks unmigrate <task>, thenagentj tasks enable <task>;agentj tasks migrate <task>moves it again.agentj tasks disableor "Turn off" on the phone also removes the system timer, and the task stays off. - Uninstalling the service removes them.
agentj service uninstallremoves every moved task; the tasks stay off, and your answer on the card is forgotten. After you install it again, switch a task on withagentj tasks enable <task>, then runagentj tasks migrate <task>. - These tasks are not moved and keep running in Agent J, with the reason shown: multi-step tasks (their progress is kept in Agent J); tasks with a brief (
brief.json); instructions that look like they hold a secret; a scheduler entry with the same name that someone else made; a task running right now; a task whose Agent isolation does not start; read-only tasks on OpenCode; tasks on Kimi Code or dsh; a schedule the system scheduler can't express exactly. - WSL2 without systemd: nothing moves. Your phone gets one note explaining it; tap "turn on systemd in WSL" below the notice (or reply with those words) and your Agent sets it up, then the move card comes. Other Linux systems without a systemd user manager: nothing moves and no card is shown.
- While logged out: on Linux with
Linger=no, a moved task runs only while you are logged in, the same as before.
A background task was refused because of its source
Enabled schedules and manually started tasks run as work delegated by the owner. At Standard and Safe, low-risk reads and ordinary file writes follow the existing safety rules; actions needing confirmation open a card on a paired remote. Enabling a task does not approve external sending, secret use or irreversible actions. Those still need confirmation for each action.
Ordinary tools in scheduled tasks, workflows, heartbeats, host notices, handoff recovery and background-completion turns follow the AI coding tool permissions. A turn label adds no refusal or fingerprint check, with one exception: in a heartbeat turn, charge and irreversible commands ask for the owner's fingerprint check in person. Only commands and matching phone operations explicitly listed by agentj uv list require in-person owner verification; without it that step does not run, while independent work can continue. Friend and visitor isolation remains, and external text never replaces owner verification.
If a step that needs a card meets no remote online, the card goes out as usual. After 20 seconds with nobody online the step is put on hold and the Agent moves on to work that doesn't depend on it; with Telegram or the e-mail channel set up you also get a reminder (see When no remote is online). This is not you tapping Reject. Approve within 30 minutes and the Agent's retry of that exact step runs. Cards that change Agent J's own settings are not put on hold; they wait for you.
Some wake-ups can never ask for approval, at any level: Claude Code's own scheduled wake-ups (such as /loop or schedules it creates itself); the end of a job started with agentj busy run or agentj busy start; background work Agent J did not see your own turn send off; work that came from a group chat or guest e-mail. A turn with verified authority can read its reports; a turn whose source is unknown waits for your verification instead. It cannot ask for approval. Give work that needs approvals to the Agent J heartbeat or a scheduled task. When a Claude Code loop wake-up (/loop, a schedule it creates itself) hits a step that needs approval and is refused, your phone suggests a scheduled task instead: tap "turn this loop into a scheduled task" below the notice (or reply with those words), and it sets one up.
A source check refusal is not you tapping Reject. Uncertain completions, refused actions and timeouts stay in the local list while Agent J continues unrelated work, without proactive verification reminders. When you want to check, send /recover-background from a paired remote to list the records, then /recover-background <id> to check one fixed local report. This reads an unchanged registered report once, without an extra approval card. If the report is unsafe, unavailable or changed, the record stays in the list.
This check never retries the old action or proves it succeeded. If a send or other action may already have happened, reconcile its effects first. Group messages, guest email and known third-party work cannot use this to gain your authority. To submit official feedback, give a fresh explicit instruction with the content in your own conversation; the normal redaction and sending rules still apply.
Keep the main conversation available
In Code mode, the main conversation delegates longer work after 8 counted tool calls or 180 seconds; exempt reads and status checks do not spend that budget. This limit does not guarantee a reply within 30 seconds. A receipt means the message was accepted, not that the Agent has answered.
Interrupting a running native turn is available for Codex with an exact current turn binding, and for a Claude Code process started and owned by this host. It is not available for OpenCode or an external Claude Code process; the page explains when interruption is unavailable. Existing Stop controls keep their own scope.