@codizelabs/agent-rewake 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -27
- package/dist/agent-rewake.js +13124 -7070
- package/dist/hosts/claude-code/.claude-plugin/plugin.json +1 -1
- package/dist/hosts/claude-code/hooks/logic.js +268 -0
- package/dist/hosts/claude-code/hooks/register.js +206 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Auto-resume your AI coding agent when its usage limit resets.** Same session, same context, same thread.
|
|
8
8
|
|
|
9
|
-
Works where you already use your agent: Claude Code in a terminal or in its VS Code and Cursor panel, Codex, GitHub Copilot CLI, Gemini CLI, Grok Build and Antigravity CLI in a terminal, and every external agent in [Zed](https://zed.dev). Everything outside Zed is a preview.
|
|
9
|
+
Works where you already use your agent: Claude Code in a terminal or in its VS Code and Cursor panel, Cursor's own agent, Codex, GitHub Copilot CLI, Gemini CLI, Grok Build, Qwen Code, OpenCode and Antigravity CLI in a terminal, and every external agent in [Zed](https://zed.dev). Everything outside Zed is a preview.
|
|
10
10
|
|
|
11
11
|
[](https://www.npmjs.com/package/@codizelabs/agent-rewake)
|
|
12
12
|
[](LICENSE)
|
|
@@ -33,10 +33,12 @@ Coding agents stop at their usage limit: Claude's 5-hour session limit, Codex's
|
|
|
33
33
|
|
|
34
34
|
<img src="site/public/images/rewake-demo.gif" alt="A Zed agent thread: the agent stops at its usage limit, Rewake asks whether to resume, and at 5:01 PM the thread continues on its own" width="100%">
|
|
35
35
|
|
|
36
|
-
- **Resumes after a usage limit.** When the agent stops, Rewake asks once whether to continue (or does it on its own, if you turned that on). At the reset, plus a minute, it sends a message that resumes the same session, and the agent carries on. If the agent is still limited, Rewake waits for the new reset time.
|
|
37
|
-
- **Automatic, if you want.** Choose *from now on* when Rewake asks (Claude Code), turn on auto-resume in Zed's **Rewake** menu, or run `agent-rewake continue --always` (Copilot CLI, Gemini CLI, Grok Build, Antigravity CLI), and Rewake resumes without asking. It asks first when a limit resets more than a day away, never resumes credit or billing limits (and says so), and never approves permission prompts for you.
|
|
36
|
+
- **Resumes after a usage limit.** When the agent stops, Rewake asks once whether to continue (or does it on its own, if you turned that on). At the reset, plus a minute, it sends a message that resumes the same session, and the agent carries on. If the agent is still limited, Rewake waits for the new reset time (outside Zed it tries again up to four times, then tells you).
|
|
37
|
+
- **Automatic, if you want.** Choose *from now on* when Rewake asks (Claude Code), turn on auto-resume in Zed's **Rewake** menu, or run `agent-rewake continue --always` (Copilot CLI, Gemini CLI, Grok Build, Qwen Code, OpenCode, Antigravity CLI), and Rewake resumes without asking. It asks first when a limit resets more than a day away, never resumes credit or billing limits (and says so), and never approves permission prompts for you.
|
|
38
38
|
- **Sends messages later.** `/rewake in 1h Run the tests` schedules a message into the session (Zed and Claude Code; in Zed also on a repeat, such as every weekday at 9).
|
|
39
|
-
- **Keeps the computer awake, if it can.** On macOS, while a resume is due within six hours, Rewake stops the computer from idling to sleep (while plugged in, by default). Closing the lid still puts it to sleep. `agent-rewake doctor` tells you if your computer's own sleep settings would let it sleep, and [which settings to change](https://codizelabs.github.io/agent-rewake/docs/#keep-your-computer-awake).
|
|
39
|
+
- **Keeps the computer awake, if it can.** On macOS, and on Linux (with systemd) and Windows, while a resume is due within six hours, Rewake stops the computer from idling to sleep (while plugged in, by default). Only macOS has been tried by hand. Closing the lid still puts it to sleep. `agent-rewake doctor` tells you if your computer's own sleep settings would let it sleep, and [which settings to change](https://codizelabs.github.io/agent-rewake/docs/#keep-your-computer-awake).
|
|
40
|
+
- **Warns you before a usage limit (Claude Code).** The plugin tells you when a usage window passes 80% and 95%, and when your pace over the last hour would reach the limit within about 45 minutes (as a range, "in about 20 to 40 minutes"). It uses only the usage figures Claude Code already gives it: no network, no sign-in. It only tells you; at 80% it mentions `/compact` (which uses some quota itself), at 95% it says it is a good moment to wrap up. It never types or compacts for you. Turn it off with `agent-rewake settings usage-warnings off`. Not built for Codex and the other agents.
|
|
41
|
+
- **Tells you when the project changed while it waited.** Outside Zed, if the session's folder is a git folder and its latest commit or tracked files differ by the time Rewake sends, it tells you, and sends the message as it was. You can instead have it add one fixed line asking the agent to re-read files (`agent-rewake settings workspace-changed note`), or send nothing and ask you first (`hold`). It reads only the commit id and the names-and-status summary from `git status --porcelain --untracked-files=no`, never file contents, and only on your computer.
|
|
40
42
|
- **Same agent, same session.** No new agent to pick: Rewake works inside or in front of the agents you already use, so your sessions and threads keep going where they stopped.
|
|
41
43
|
|
|
42
44
|
## Where you work
|
|
@@ -45,19 +47,21 @@ Install once with `npx @codizelabs/agent-rewake install`: it finds what's on you
|
|
|
45
47
|
|
|
46
48
|
| Where | Agents | What Rewake does there | Status |
|
|
47
49
|
|---|---|---|---|
|
|
48
|
-
| **A terminal** | Claude Code | Asks once at the limit, then continues the same session. `/rewake` sends messages later | Preview, tried on a Mac |
|
|
50
|
+
| **A terminal** | Claude Code | Asks once at the limit, then continues the same session. `/rewake` sends messages later. If you close it at the limit first, `agent-rewake continue` continues the closed session (macOS, Linux) | Preview, tried on a Mac; the closed-session part isn't tried against a real limit |
|
|
49
51
|
| | Codex | Type `rewake` at the limit; the thread continues after the reset | Preview, limit not tried by hand yet |
|
|
50
|
-
| |
|
|
51
|
-
| |
|
|
52
|
+
| | Gemini CLI, Grok Build | Type `/rewake` at the limit; the session continues once closed (or `agent-rewake continue`) | Preview, tried on a Mac |
|
|
53
|
+
| | GitHub Copilot CLI | Continues a closed session after the reset (`agent-rewake continue`, or on its own) | Preview, tried on a Mac |
|
|
54
|
+
| | Antigravity CLI, OpenCode | The same | Preview, not tried yet |
|
|
55
|
+
| | Qwen Code | Type `/rewake` at the limit; the session continues once closed | Preview, not tried yet |
|
|
52
56
|
| **VS Code, Cursor** | Claude Code's panel | The same as in a terminal: the same plugin loads there | Preview, tried on a Mac |
|
|
53
57
|
| | Codex's extension | Rewake's hooks show up there, waiting to be trusted; the rest isn't tried yet | Not tried yet |
|
|
54
|
-
| | Cursor's own agent |
|
|
58
|
+
| | Cursor's own agent | Type `/rewake` at a usage limit to continue the chat at the time you choose (within 4 hours), while its window stays open | Preview, limit not tried yet |
|
|
55
59
|
| **Zed** | Claude Agent, Codex, Gemini CLI, GitHub Copilot, OpenCode, goose and every other external agent | Resumes the thread at the reset; a **Rewake** menu, scheduled and repeating messages, a schedules page | In daily use |
|
|
56
60
|
| **JetBrains IDEs, Devin Desktop** | Claude Agent, Codex (picked in AI Assistant or the agent selector) | Resumes after a limit while the IDE stays open, through the same add-on as in Zed | Preview, not tried yet |
|
|
57
61
|
|
|
58
|
-
Not supported yet: GitHub Copilot's own chat in VS Code
|
|
62
|
+
Not supported yet: GitHub Copilot's own chat in VS Code. The Claude desktop app's Code tab: Rewake's plugin has code for it (it always asks first), but it hasn't been tried. Out of reach: claude.ai, the Claude desktop app's chat and Zed's own built-in agent, which let no add-on in.
|
|
59
63
|
|
|
60
|
-
Guides for each: [Claude Code](https://codizelabs.github.io/agent-rewake/docs/#claude-code) · [Codex](https://codizelabs.github.io/agent-rewake/docs/#codex) · [Copilot CLI](https://codizelabs.github.io/agent-rewake/docs/#github-copilot-cli) · [Gemini CLI](https://codizelabs.github.io/agent-rewake/docs/#gemini-cli) · [Grok Build](https://codizelabs.github.io/agent-rewake/docs/#grok-build) · [Antigravity CLI](https://codizelabs.github.io/agent-rewake/docs/#antigravity-cli) · [Cursor](https://codizelabs.github.io/agent-rewake/docs/#cursor) · [Zed](https://codizelabs.github.io/agent-rewake/docs/#zed)
|
|
64
|
+
Guides for each: [Claude Code](https://codizelabs.github.io/agent-rewake/docs/#claude-code) · [Codex](https://codizelabs.github.io/agent-rewake/docs/#codex) · [Copilot CLI](https://codizelabs.github.io/agent-rewake/docs/#github-copilot-cli) · [Gemini CLI](https://codizelabs.github.io/agent-rewake/docs/#gemini-cli) · [Grok Build](https://codizelabs.github.io/agent-rewake/docs/#grok-build) · [Qwen Code](https://codizelabs.github.io/agent-rewake/docs/#qwen-code) · [OpenCode](https://codizelabs.github.io/agent-rewake/docs/#opencode) · [Antigravity CLI](https://codizelabs.github.io/agent-rewake/docs/#antigravity-cli) · [Cursor](https://codizelabs.github.io/agent-rewake/docs/#cursor) · [Zed](https://codizelabs.github.io/agent-rewake/docs/#zed)
|
|
61
65
|
|
|
62
66
|
## Quick start
|
|
63
67
|
|
|
@@ -69,7 +73,7 @@ npx @codizelabs/agent-rewake install
|
|
|
69
73
|
|
|
70
74
|
- **Claude Code** (terminal, VS Code, Cursor): start a new session.
|
|
71
75
|
- **Codex**: open it once and trust Rewake's hooks when it says "Hooks need review".
|
|
72
|
-
- **Copilot CLI, Gemini CLI, Grok Build, Antigravity CLI**: start a new session.
|
|
76
|
+
- **Copilot CLI, Gemini CLI, Grok Build, Qwen Code, OpenCode, Antigravity CLI**: start a new session.
|
|
73
77
|
- **Zed, JetBrains, Devin Desktop**: restart the app (below for Zed).
|
|
74
78
|
|
|
75
79
|
**In Zed,** `install` lists the agents it will add Rewake to. Each settings file is backed up first, and your comments and settings are kept. Then **quit Zed completely and open it again** (⌘Q on macOS, Ctrl+Q on Linux; on Windows, close every Zed window), open the **Agent Panel**, and open or start a thread with one of your agents. Zed starts Rewake with that thread, not when Zed itself starts. A **Rewake** menu now sits under the message box, next to the model picker.
|
|
@@ -82,9 +86,11 @@ Check the setup at any time. `doctor` looks at every place you set up (Zed and i
|
|
|
82
86
|
npx @codizelabs/agent-rewake doctor
|
|
83
87
|
```
|
|
84
88
|
|
|
89
|
+
`doctor --json` prints the same findings for scripts, and `doctor --report` writes one redacted text file for a bug report (your home folder as `~`, session ids hashed, no message text; nothing is sent). `agent-rewake history` says what happened to your messages and resumes lately, `agent-rewake <command> --help` shows a command's options, and `agent-rewake completion <bash|zsh|fish>` prints a shell completion script. `doctor` also says how long ago this version was installed and how to update, without going online.
|
|
90
|
+
|
|
85
91
|
### Updating
|
|
86
92
|
|
|
87
|
-
From any version: run `npx @codizelabs/agent-rewake@latest install`. Previews use the new version from their next session; in Zed, quit Zed completely and open it again. Your sessions, scheduled messages and settings stay. Details, and any version-specific steps (none so far), are in the [docs](https://codizelabs.github.io/agent-rewake/docs/#update). To see which version you run: `agent-rewake --version` (in Zed also the **Rewake** menu).
|
|
93
|
+
From any version: run `npx @codizelabs/agent-rewake@latest install`. Previews use the new version from their next session; in Zed, choose **Reload Agent** in the Agent Panel's menu in each open thread (Zed 1.18 or newer), or quit Zed completely and open it again. Your sessions, scheduled messages and settings stay. Details, and any version-specific steps (none so far), are in the [docs](https://codizelabs.github.io/agent-rewake/docs/#update). To see which version you run: `agent-rewake --version` (in Zed also the **Rewake** menu).
|
|
88
94
|
|
|
89
95
|
### Requirements
|
|
90
96
|
|
|
@@ -97,39 +103,44 @@ From any version: run `npx @codizelabs/agent-rewake@latest install`. Previews us
|
|
|
97
103
|
|
|
98
104
|
Rewake joins each agent the way that agent allows, and always continues the same session:
|
|
99
105
|
|
|
100
|
-
- **Inside the agent**: a plugin in Claude Code's own session (terminal, VS Code, Cursor). It sees the limit, asks, and sends the resume message itself, while Claude Code stays open.
|
|
101
|
-
- **Through the agent's hooks**: Codex, Copilot CLI, Gemini CLI, Grok Build and Antigravity CLI tell Rewake about the limit (and you say when, with `rewake`, `/rewake` or `agent-rewake continue`, unless Rewake does it on its own); at the reset your system's own timer runs Rewake once, and it continues the closed session with the agent's own resume command (Codex: its own message queue).
|
|
102
|
-
- **In front of the agent**: in Zed, JetBrains and Devin Desktop, the editor talks to agents over the [Agent Client Protocol](https://agentclientprotocol.com). Rewake sits on that connection
|
|
106
|
+
- **Inside the agent**: a plugin in Claude Code's own session (terminal, VS Code, Cursor). It sees the limit, asks, and sends the resume message itself, while Claude Code stays open. If Claude Code is closed first, Rewake continues the session the way it does for the agents below, with `claude --resume`.
|
|
107
|
+
- **Through the agent's hooks**: Codex, Copilot CLI, Gemini CLI, Grok Build, Qwen Code, OpenCode (through a small plugin) and Antigravity CLI tell Rewake about the limit (and you say when, with `rewake`, `/rewake` or `agent-rewake continue`, unless Rewake does it on its own); at the reset your system's own timer runs Rewake once, and it continues the closed session with the agent's own resume command (Codex: its own message queue).
|
|
108
|
+
- **In front of the agent**: in Zed, JetBrains and Devin Desktop, the editor talks to agents over the [Agent Client Protocol](https://agentclientprotocol.com). Rewake sits on that connection and passes your messages and the agent's replies through. It adds its own menu and forms (in Zed), and sends messages into the same thread at the right time. For Claude Agent it runs its own pinned copy of the Claude adapter.
|
|
103
109
|
|
|
104
110
|
Everything runs on your computer; nothing runs in the cloud.
|
|
105
111
|
|
|
106
112
|
## Use it
|
|
107
113
|
|
|
108
|
-
In Zed, the **Rewake** menu under the message box does everything; elsewhere, type `/rewake` in the session (in Codex, `rewake` without the slash)
|
|
114
|
+
In Zed, the **Rewake** menu under the message box does everything; elsewhere, type `/rewake` in the session (in Codex, `rewake` without the slash). GitHub Copilot CLI and Antigravity CLI have no typed command: run `agent-rewake continue` in a terminal for a closed session there.
|
|
109
115
|
|
|
110
116
|
| To… | In Zed | Elsewhere |
|
|
111
117
|
|---|---|---|
|
|
112
|
-
| Resume after a limit | **Rewake → Resume after the usage limit…** (offered automatically) | Answer Rewake's question, or type `/rewake` (or `/rewake 3:30pm`); for a closed session, `agent-rewake continue` |
|
|
118
|
+
| Resume after a limit | **Rewake → Resume after the usage limit…** (offered automatically) | Answer Rewake's question, or type `/rewake` (or `/rewake 3:30pm`); for a closed session without a typed command (Copilot CLI, Antigravity CLI), `agent-rewake continue` |
|
|
113
119
|
| Resume automatically | **Rewake → Turn on auto-resume after limits…** | Choose "from now on" in Rewake's question, `/rewake auto on` (Claude Code only), or `agent-rewake continue --always` (every agent outside Zed, Claude Code included) |
|
|
114
120
|
| Schedule a message | **Rewake → Schedule a message…** | `/rewake in 3h Run the tests` (Claude Code) |
|
|
115
121
|
| Repeat a message | **Custom time…** in the schedule form, or `/rewake every weekday 09:00 Check the build` | Not yet |
|
|
116
|
-
| See or change messages | **Rewake → Schedules**, **Change a scheduled message…** | `/rewake list
|
|
117
|
-
| See what's planned | The Zed task **Agent Rewake: schedules** | `/rewake list` in the session; `agent-rewake doctor` shows the next planned resume of a closed session |
|
|
122
|
+
| See or change messages | **Rewake → Schedules**, **Change a scheduled message…** | `/rewake list` and `/rewake cancel` (Claude Code, Gemini CLI, Grok Build, Qwen Code, Cursor; in Codex without the slash). `/rewake cancel N` deletes one message: Claude Code only |
|
|
123
|
+
| See what's planned | The Zed task **Agent Rewake: schedules** | `/rewake list` in the session; `agent-rewake schedules` lists every one, marking the resumes outside Zed; `agent-rewake doctor` shows the next planned resume of a closed session |
|
|
124
|
+
| Cancel a planned resume | **Rewake → Change a scheduled message…**, or the schedules page | `/rewake cancel` in the session where it's typed, or `agent-rewake continue --cancel` to pick one or all; `agent-rewake continue --cancel <id>` cancels one by the id in square brackets in `agent-rewake schedules` |
|
|
125
|
+
| Resume now, without waiting for the reset | **Rewake → Change a scheduled message…** | `agent-rewake continue --now` picks a planned resume outside Zed and asks first; `agent-rewake continue --now <id>` names one (`--yes` without a terminal). It makes the same checks as at the reset; if the limit is still on, the session is open or changed, you typed after the limit, the agent continued, or the message can't reach the agent (signed out, session deleted or archived, folder gone), nothing is sent and the resume stays planned for its time; Ctrl+C during a run stops it and cancels the resume |
|
|
126
|
+
| Change settings | **Rewake → Settings…** | `agent-rewake settings` lists them with what each does; `agent-rewake settings change` lets you pick one, or `agent-rewake settings <name> <value>` changes it (for example `agent-rewake settings clock 24h`) |
|
|
118
127
|
|
|
119
|
-
**One command everywhere:** `/rewake` is the same in Zed, Claude Code
|
|
128
|
+
**One command everywhere:** `/rewake` is the same in Zed, Claude Code, Gemini CLI, Grok Build, Qwen Code and Cursor's own agent (in Codex, type `rewake` without the slash). At a usage limit it continues after the reset; `/rewake <time>` continues then, `/rewake cancel` cancels it, and `/rewake help` lists what else works where you are. Rewake answers it itself, without using the model. `npx`/`agent-rewake` on the command line is only for installing, uninstalling and the two agents with no typed command (GitHub Copilot CLI, Antigravity CLI).
|
|
120
129
|
|
|
121
130
|
Full guide: **[codizelabs.github.io/agent-rewake/docs](https://codizelabs.github.io/agent-rewake/docs/)**.
|
|
122
131
|
|
|
123
132
|
## Agents in Zed
|
|
124
133
|
|
|
125
|
-
In Zed, Rewake works the same way in front of every external agent: **Claude Agent, Codex, Gemini CLI, GitHub Copilot, OpenCode, goose** and the rest, npm-based or binary, plus custom agents. Rewake
|
|
134
|
+
In Zed, Rewake works the same way in front of every external agent: **Claude Agent, Codex, Gemini CLI, GitHub Copilot, OpenCode, goose** and the rest, npm-based or binary, plus custom agents. Rewake has built-in rules for how each agent it knows by name reports a limit: an error, its own error codes, or a last line such as Cursor's "Upgrade your plan to continue". When the agent says when the limit resets, in any of the formats agents use, Rewake resumes at that time; otherwise it lets you pick when. Any other agent, or a custom command, gets the general rules, and its limit may not be recognised. An agent Zed starts from neither an npm package nor a binary can't be added.
|
|
126
135
|
|
|
127
136
|
## Privacy
|
|
128
137
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
138
|
+
The whole picture, with what Rewake never does and how to undo it, is on the [privacy and security page](https://codizelabs.github.io/agent-rewake/docs/privacy-and-security/). In short:
|
|
139
|
+
|
|
140
|
+
- Runs locally. Rewake never sees your credentials: sign-in goes through each agent's own flow. Besides fetching an agent's own program (a download, or `npm install`) when Zed hasn't already done it, its only network use is error reports, which are off unless you turn them on (`agent-rewake errors on`; see the docs' [Error reports](https://codizelabs.github.io/agent-rewake/docs/#error-reports)).
|
|
141
|
+
- Sends only what you scheduled, approved, or turned on. (One fixed line, saying the project changed while it waited, is added to a resume only if you choose `note`.)
|
|
142
|
+
- Stores scheduled messages and per-thread settings in a private folder on your machine; logs hold metadata only (events, codes and program names), never message text.
|
|
143
|
+
- Keeps your message off the command line, with exceptions. When Rewake continues a closed Copilot CLI, Gemini CLI, Qwen Code or OpenCode session, it hands the message to the agent on its standard input; for Grok Build, in a file only you can read. Three cases put it on a command line, where another program on your computer can read it from the process list for as long as the command runs: **Codex** (`codex queue --message <text>`), **Antigravity CLI** (`-p <text>`), and **Gemini CLI** or **Qwen Code** when you've turned its sandbox on (they then start themselves again with the text as an argument; for Qwen Code that is read from its source, not tried). Claude Code, Cursor and Zed don't use a command line for it.
|
|
133
144
|
|
|
134
145
|
## Uninstall
|
|
135
146
|
|
|
@@ -137,11 +148,11 @@ In Zed, Rewake works the same way in front of every external agent: **Claude Age
|
|
|
137
148
|
npx @codizelabs/agent-rewake uninstall
|
|
138
149
|
```
|
|
139
150
|
|
|
140
|
-
This takes Rewake out of every place it's set up in, after showing every change and asking once. `doctor` shows the folder where Rewake keeps its data, if you want to delete that too.
|
|
151
|
+
This takes Rewake out of every place it's set up in, after showing every change and asking once. `doctor --details` shows the folder where Rewake keeps its data, if you want to delete that too.
|
|
141
152
|
|
|
142
153
|
## Status
|
|
143
154
|
|
|
144
|
-
Version 0.
|
|
155
|
+
Version 0.5. Rewake's automated tests run on macOS, Linux and Windows with Node.js 22 and 24, and the author uses it daily in Zed. The previews outside Zed are new: the docs say [what's been tried for each](https://codizelabs.github.io/agent-rewake/docs/#outside-zed-previews), and what hasn't. What changed in each release is in the [changelog](https://codizelabs.github.io/agent-rewake/changelog/). Feedback and bug reports are very welcome: [open an issue](https://github.com/codizelabs/agent-rewake/issues/new/choose). If Rewake missed a usage limit, [say how](https://codizelabs.github.io/agent-rewake/docs/#report-a-limit-rewake-missed).
|
|
145
156
|
|
|
146
157
|
## Contributing
|
|
147
158
|
|