agentpen-cli 0.0.0-stage → 0.1.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/LICENSE +27 -0
- package/README.md +279 -2
- package/cli/agentpen.js +442 -0
- package/cli/codex-app.js +338 -0
- package/cli/handoff.js +216 -0
- package/cli/install.js +127 -0
- package/cli/postinstall.js +14 -0
- package/cli/redact.js +63 -0
- package/package.json +43 -4
- package/server/agents.js +250 -0
- package/server/db.js +161 -0
- package/server/hub.js +619 -0
- package/server/index.js +744 -0
- package/server/notify.js +91 -0
- package/server/search.js +34 -0
- package/web/app.js +515 -0
- package/web/favicon.svg +1 -0
- package/web/index.html +16 -0
- package/web/session.js +447 -0
- package/web/styles.css +260 -0
- package/web/team-page.png +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agentpen contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
The .env masking approach in cli/redact.js and the join-time repaint are
|
|
26
|
+
adapted from ideas in manycode (https://github.com/unworld11/manycode),
|
|
27
|
+
Copyright (c) 2026 unworld11, MIT License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,280 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agentpen
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**The team room for your coding agents.** Run Claude Code, Codex or any terminal agent exactly as you do today. Every session shows up on a shared team page where teammates can watch, steer, or unblock it from a browser.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install -g agentpen-cli # the command is `agentpen`
|
|
7
|
+
agentpen install # or share one session: agentpen claude
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Hosted at [agentpen.app](https://agentpen.app). The npm package is `agentpen-cli` (the bare name `agentpen` belongs to an unrelated project).
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## Why a company buys this
|
|
16
|
+
|
|
17
|
+
Coding agents made every engineer a manager of long-running work, but the work is trapped in one person's terminal. When the agent stops to ask a question and its owner is in a meeting, it sits there. Nobody else can see it, help it, or learn from it.
|
|
18
|
+
|
|
19
|
+
| Problem | What Agentpen does |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| Agents wait on one person | The session turns amber ("Needs a human") on the team page and posts to Slack. Any teammate answers from a browser or phone. |
|
|
22
|
+
| Pairing on an agent needs screen share | Teammates click a session and are in the real terminal. Nothing to install, no codes, no tunnels, no VPN. |
|
|
23
|
+
| Nobody knows what agents are doing | One page: who is running what, on which repo and branch, working / idle / stuck. |
|
|
24
|
+
| Security asks "who told it to do that?" | Prompts sent by teammates are attributed and logged. Every session is recorded and replayable. Per-workspace audit trail. |
|
|
25
|
+
| Rollout friction | `npx agentpen-cli claude`, approve once in the browser. Everyone with the company email domain lands in the workspace automatically. |
|
|
26
|
+
|
|
27
|
+
## How it works
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
your laptop Agentpen teammates
|
|
31
|
+
┌──────────────────┐ outbound ┌───────────────┐ browser ┌──────────────┐
|
|
32
|
+
│ agentpen claude │────wss─────▶│ hub + API │◀────wss──────│ watch / type │
|
|
33
|
+
│ └ PTY ─ claude │ (masked) │ SQLite + casts│ │ chat / prompt│
|
|
34
|
+
└──────────────────┘ └───────────────┘ └──────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- The CLI wraps your agent in a PTY. Your terminal behaves exactly as before.
|
|
38
|
+
- It only dials **out** to the server, so it works behind corporate firewalls.
|
|
39
|
+
- Values found in `.env*` files are masked before the stream leaves the machine.
|
|
40
|
+
- The browser renders the host's exact terminal grid and scales it to fit, so viewers never resize the host's agent.
|
|
41
|
+
|
|
42
|
+
## Two ways in, one team page
|
|
43
|
+
|
|
44
|
+
Developers split between a terminal agent and a desktop app. Both land on the same workspace page, with the same people, chat, permissions, audit trail and "needs a human" signal.
|
|
45
|
+
|
|
46
|
+
| | Claude Code and other terminal agents | Codex desktop app |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| Start sharing | `agentpen claude` (or `codex`, `aider`, anything) | `agentpen codex-app`, pick a conversation |
|
|
49
|
+
| What teammates see | The live terminal, exactly as the host sees it | The conversation: messages, commands run, files edited |
|
|
50
|
+
| How teammates take part | Type in the terminal, or send an attributed prompt | Send a prompt; it is queued into the conversation under their name |
|
|
51
|
+
| "Needs a human" | Heuristic on terminal output | Exact: Codex reports when it is waiting for approval or input |
|
|
52
|
+
| After it ends | Terminal replay | Saved transcript |
|
|
53
|
+
|
|
54
|
+
The Codex bridge talks to the app's own local control socket. It reads only the conversation you picked, never shares reasoning or system instructions, and never answers a tool approval: those stay with the host in the app.
|
|
55
|
+
|
|
56
|
+
## No prefix to remember
|
|
57
|
+
|
|
58
|
+
Most developers will keep typing `claude` and keep using the Codex app. One command makes both share on their own:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
agentpen install
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- **Claude Code:** a small hook in your shell file makes plain `claude` start a shared session. It prints one quiet line with the link and otherwise behaves as before. One-off commands (`claude -p`, `claude mcp …`, `claude update`), scripts and pipes are never shared.
|
|
65
|
+
- **Codex app (macOS):** a background helper watches the app and shares a conversation while it is active, then stops once it has been quiet for 20 minutes. Only conversations inside a git repository are shared, so general chat stays out. On other systems, keep `agentpen watch` running.
|
|
66
|
+
|
|
67
|
+
It is built to stay out of the way. If the server is unreachable, you are signed out, or Agentpen is removed from the machine, `claude` simply runs as normal, after at most a couple of seconds' wait.
|
|
68
|
+
|
|
69
|
+
| To | Run |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| Stop sharing new sessions for now | `agentpen pause` (and `agentpen resume`) |
|
|
72
|
+
| Keep one session private | `AGENTPEN_OFF=1 claude` |
|
|
73
|
+
| Undo everything | `agentpen uninstall` |
|
|
74
|
+
|
|
75
|
+
Everyone in the workspace can see shared sessions, so `install` is something each developer chooses to run, and it says so when it finishes.
|
|
76
|
+
|
|
77
|
+
## Bring another agent into the session
|
|
78
|
+
|
|
79
|
+
A session does not have to depend on one model any more than on one person. An admin connects the agents the team may invite, under Settings:
|
|
80
|
+
|
|
81
|
+
| Agent | From | Needs | Invite with |
|
|
82
|
+
| --- | --- | --- | --- |
|
|
83
|
+
| Claude | Anthropic | an API key | `@claude` |
|
|
84
|
+
| Grok | xAI | an API key and a model name | `@grok` |
|
|
85
|
+
| Muse | Meta | an API key and a model name | `@muse` |
|
|
86
|
+
|
|
87
|
+
Once one is connected, anyone in a session can:
|
|
88
|
+
|
|
89
|
+
- **Ask for a second opinion.** Start a chat message with the agent's name ("@claude is this migration safe?", "@grok do you agree?"). It reads what the session shows, plus the prompts and chat so far, and answers in the chat for everyone.
|
|
90
|
+
- **Get caught up.** "Catch me up" writes a short note: the goal, what is done, where things stand, and the next step. It is kept with the session, shown to whoever opens it, and printed by `agentpen pickup`.
|
|
91
|
+
- **Hand over the wheel** (host only). Give Claude a goal and it steers your agent, one instruction at a time, for up to eight steps. Every instruction is attributed ("Claude (for Ana)") and logged. Anyone who can manage the session can take the wheel back at any moment.
|
|
92
|
+
|
|
93
|
+
The guardrail that matters: **an invited agent never answers an approval prompt.** If your agent stops to ask a human something, the invited agent says so in chat and waits; it does not even plan a next move until a person has answered. It also has no access to the machine. All it can do is type an instruction to the agent that is already running, as a teammate could.
|
|
94
|
+
|
|
95
|
+
Each of these sends the visible part of that session to the chosen agent's provider under the workspace's key, and only when a person asks. With more than one agent connected, the session page has a picker for which one to ask, hand over to, or have write the catch-up. Keys are stored encrypted and are never returned by the API. Private sessions stay with their host.
|
|
96
|
+
|
|
97
|
+
Claude goes through the Anthropic SDK. Grok and Muse both offer an OpenAI-compatible Chat Completions endpoint (`api.x.ai/v1`, `api.meta.ai/v1`) and share one adapter in `server/agents.js`; any other model with that kind of endpoint is one more entry there. For Grok and Muse you type the model name yourself, exactly as the provider lists it, because their model names change often.
|
|
98
|
+
|
|
99
|
+
## Search every session
|
|
100
|
+
|
|
101
|
+
The search box on the Sessions page looks through everything past sessions recorded: terminal output, Codex conversations, prompts teammates sent, chat, and catch-up notes. "Has anyone's agent hit this error before?" becomes a query. Sessions are indexed when they end; private ones are found only by their host.
|
|
102
|
+
|
|
103
|
+
## Who can see a session
|
|
104
|
+
|
|
105
|
+
Every session has one of three settings, and its host can change it at any moment from the session page:
|
|
106
|
+
|
|
107
|
+
| Setting | Who sees it |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| **Private** | Only the host. It is not listed, cannot be opened, and is not announced to anyone, workspace admins included. |
|
|
110
|
+
| **Teammates watch** | The workspace can see it; only the host types. |
|
|
111
|
+
| **Teammates can type** | The workspace can see it, type, and send prompts. |
|
|
112
|
+
|
|
113
|
+
Switching a live session to private shows everyone else out at once, kills any guest link, and takes down alerts the team had about it. A private session's recording, checkpoint and activity stay private after it ends, until the host makes it visible.
|
|
114
|
+
|
|
115
|
+
How a session *starts* is decided in this order: a flag on the command (`--private`, `--watch-only`), then your own default for this machine (`agentpen default private`), then the workspace's default (Settings). A workspace that wants sharing to be opt-in sets its default to "Private until shared".
|
|
116
|
+
|
|
117
|
+
## When the laptop is shut
|
|
118
|
+
|
|
119
|
+
The session with all the context is on a machine that just went to sleep, and something needs doing now. Agentpen keeps a checkpoint so that is not a dead end.
|
|
120
|
+
|
|
121
|
+
While a Claude Code session runs through Agentpen, the CLI saves two things to the workspace about every 20 seconds, and once more on exit:
|
|
122
|
+
|
|
123
|
+
- **The conversation**: Claude Code's own session file, with `.env` values masked.
|
|
124
|
+
- **The code**: everything the team's remote does not already have. Unpushed commits plus uncommitted and new files, captured as a hidden commit. The host's branch, index and stash are not touched, and ignored files (`.env`, `node_modules`) are never included.
|
|
125
|
+
|
|
126
|
+
Any workspace member can then carry on from their own clone:
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
agentpen pickup https://agentpen.yourco.com/s/k3Pq9xTz # add --worktree to use a separate folder
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
That creates a `pickup/…` branch at the host's commit, restores their uncommitted work as uncommitted work, puts the conversation where Claude Code looks for it, and starts `claude --resume` as a new shared session. The agent remembers everything up to the checkpoint. The original host is notified and the pickup is in the audit trail. The session page shows the command whenever a checkpoint exists, and says so when the host went offline mid-session.
|
|
133
|
+
|
|
134
|
+
Admins can turn checkpoints off for a workspace (Settings), and a host can skip them for one session with `--no-handoff`. Checkpoints are deleted 14 days after a session ends. On macOS the CLI also keeps an idle laptop awake while the agent is running; a closed lid still sleeps.
|
|
135
|
+
|
|
136
|
+
## Notifications and the Mac app
|
|
137
|
+
|
|
138
|
+
The server decides who hears what and writes the words, so the web app, the Mac app and anything later behave the same.
|
|
139
|
+
|
|
140
|
+
| When | Who is told |
|
|
141
|
+
| --- | --- |
|
|
142
|
+
| Your agent stops to ask something | You, immediately, with the question itself. Marked urgent. |
|
|
143
|
+
| It is still waiting a minute later | The rest of the workspace ("Ana's agent is stuck") |
|
|
144
|
+
| Someone answers it | Everyone's alert is taken down automatically |
|
|
145
|
+
| Your agent finishes a long stretch of work | You |
|
|
146
|
+
| Someone joins, prompts your agent, or messages you | You (the host is usually in a terminal and would never see chat otherwise) |
|
|
147
|
+
| A teammate goes live | Off by default |
|
|
148
|
+
|
|
149
|
+
Each kind can be switched off per person (Settings, or the Mac app). Nobody is notified about their own actions, and a client that was offline is caught up when it reconnects.
|
|
150
|
+
|
|
151
|
+
**Web:** in-app cards, plus browser notifications when the tab is in the background (turn on under Settings).
|
|
152
|
+
|
|
153
|
+
**Mac menu bar app** (`mac/`, macOS 13+): the menu bar shows how many agents are waiting on a human; the panel lists live sessions across your workspaces. Native notifications can be answered in place, so "Do you want to proceed?" gets a typed reply without leaving what you are doing. Alerts about your own agent skip the banner while your terminal or Codex is already in front.
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
cd mac && ./build-app.sh # needs the Xcode command line tools; full Xcode makes it universal
|
|
157
|
+
open dist/Agentpen.app
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
CI builds the app on every push and attaches `Agentpen.zip` to the workflow run. It is ad-hoc signed, not notarized: first launch needs right-click, Open.
|
|
161
|
+
|
|
162
|
+
## Run it locally
|
|
163
|
+
|
|
164
|
+
Needs Node 22.13+.
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
npm install
|
|
168
|
+
npm start # http://localhost:4400
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Open the page, enter an email, and click the on-screen sign-in link (shown only in local dev, when no mailer is configured). Create a workspace, then in any project directory:
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
npm link # once, to get the `agentpen` command
|
|
175
|
+
export AGENTPEN_URL=http://localhost:4400 # the CLI defaults to the hosted service
|
|
176
|
+
agentpen claude # or: agentpen codex, agentpen aider, agentpen -- npm run dev
|
|
177
|
+
agentpen codex-app # share a conversation from the Codex desktop app
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
First run prints a code and opens the browser to approve the machine. The session then appears on the workspace page.
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
agentpen [agent] [args...] share a terminal agent (default: claude)
|
|
184
|
+
agentpen codex-app share a Codex desktop app conversation
|
|
185
|
+
agentpen install | uninstall share automatically: plain `claude`, and the Codex app
|
|
186
|
+
agentpen pause | resume stop or restart automatic sharing on this machine
|
|
187
|
+
agentpen default private|watch|type|workspace how your sessions start on this machine
|
|
188
|
+
agentpen watch share active Codex app conversations (what install runs in the background)
|
|
189
|
+
agentpen pickup LINK carry on a teammate's Claude Code session here
|
|
190
|
+
--worktree pick up into a separate folder, leaving this one alone
|
|
191
|
+
--no-handoff (when sharing) do not checkpoint this session
|
|
192
|
+
--latest | --thread ID skip the picker
|
|
193
|
+
-t, --title TEXT name the session
|
|
194
|
+
-w, --workspace SLUG pick a workspace
|
|
195
|
+
--watch-only teammates can watch but not type
|
|
196
|
+
--private only you can see it until you share it
|
|
197
|
+
--share-secrets do not mask .env values
|
|
198
|
+
agentpen login | logout | whoami
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Deploy
|
|
202
|
+
|
|
203
|
+
One process, one SQLite file, one volume. The same image is the hosted product and the self-hosted enterprise install.
|
|
204
|
+
|
|
205
|
+
```sh
|
|
206
|
+
docker build -t agentpen .
|
|
207
|
+
docker run -p 8080:8080 -v agentpen-data:/data \
|
|
208
|
+
-e AGENTPEN_URL=https://agentpen.yourco.com \
|
|
209
|
+
-e RESEND_API_KEY=re_... \
|
|
210
|
+
-e AGENTPEN_MAIL_FROM="Agentpen <login@yourco.com>" \
|
|
211
|
+
agentpen
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
| Variable | Purpose |
|
|
215
|
+
| --- | --- |
|
|
216
|
+
| `AGENTPEN_URL` | Public address. Used in emails, links and cookie security. |
|
|
217
|
+
| `RESEND_API_KEY`, `AGENTPEN_MAIL_FROM` | Sends sign-in and invite emails through Resend. Without a key, links are only written to the server log. |
|
|
218
|
+
| `AGENTPEN_DATA` | Directory for the database and recordings (default `./data`). |
|
|
219
|
+
| `AGENTPEN_TRUST_PROXY=1` | Believe `X-Forwarded-For` (set when behind a load balancer). |
|
|
220
|
+
| `AGENTPEN_SECRET` | Encrypts stored provider keys. If unset, a key file is created beside the database. |
|
|
221
|
+
| `ANTHROPIC_API_KEY` | Optional, for self-hosting: one Claude credential for every workspace, instead of a key per workspace. |
|
|
222
|
+
| `AGENTPEN_UPGRADE_URL` | Where the "Upgrade" button sends admins (for example a Stripe payment link). |
|
|
223
|
+
| `PORT` | Listen port (default 4400; 8080 in the image). |
|
|
224
|
+
|
|
225
|
+
The published CLI talks to the hosted service at `https://agentpen.app`. Point it at your own deployment with `agentpen login --server https://agentpen.yourco.com`.
|
|
226
|
+
|
|
227
|
+
`render.yaml` is the Blueprint for the hosted service on Render: the same image, one persistent disk mounted at `/data`.
|
|
228
|
+
|
|
229
|
+
## Security model
|
|
230
|
+
|
|
231
|
+
- Sign-in is by single-use emailed link; sessions are httpOnly cookies. CLI machines are approved in the browser and hold a revocable token. All tokens are stored hashed.
|
|
232
|
+
- A session is visible to members of its workspace only. Guest links are view-only, unguessable, and die with the session.
|
|
233
|
+
- The host, or a workspace admin, can switch a session to watch-only or end it at any time. Removing a member closes their open connections immediately.
|
|
234
|
+
- Anyone allowed to type in a session is typing into a real terminal on the host's machine. "Teammates can type" should be read as "people I would hand my laptop to"; workspaces can default to watch-only.
|
|
235
|
+
- `.env` masking is literal byte matching. It catches a stray `cat .env`, not a secret that is encoded or split.
|
|
236
|
+
- The server can read terminal output (it records it). End-to-end encryption is not implemented.
|
|
237
|
+
|
|
238
|
+
## What is real and what is not yet
|
|
239
|
+
|
|
240
|
+
Working and covered by `npm test` (real server, real CLI, real PTY): accounts, workspaces, company-domain sign-up, email and link invites, roles, seat limits, live streaming, typing, attributed prompts, chat, watch-only, guest links, recordings and replay, audit trail, "needs a human" detection, Slack webhook, host reconnect, surviving a server restart, Codex app conversations (against a simulated Codex control socket), and checkpoint and pickup (against a stand-in for Claude Code; also run once by hand with the real one).
|
|
241
|
+
|
|
242
|
+
Not built:
|
|
243
|
+
|
|
244
|
+
- **Billing.** Plans and seat limits are enforced, but a plan is changed by editing the `plan` column. There is no Stripe integration, only an upgrade link.
|
|
245
|
+
- **SSO / SAML / SCIM.** Email links only.
|
|
246
|
+
- **Horizontal scaling.** Live sessions are held in one process. Past one node this needs a pub/sub layer and Postgres.
|
|
247
|
+
- **Codex desktop app, verified only against the Codex app-server daemon.** Listing, reading and queueing prompts were exercised against a real `codex app-server` (0.171) on Linux, without a signed-in account, so no real agent reply was seen. It has not been run against the desktop app's window on a Mac. The bridge relies on Codex's experimental app-server API, polls for changes, and depends on the app picking up queued prompts.
|
|
248
|
+
- **The Mac app has been compiled by CI but never run.** Nothing here can launch a Mac app, so sign-in, the menu bar panel and real notification banners have not been seen working. It has no app icon, is not notarized, and "time sensitive" delivery needs an Apple Developer entitlement it does not have.
|
|
249
|
+
- **Invited agents have only been run against a simulated Anthropic API.** The request the server sends was checked field by field and the flows are covered end to end, but no real reply from Claude, Grok or Muse has been seen. The Grok and Muse request shape was taken from search summaries of their docs, because those docs sites could not be opened from the build environment; xAI also describes Chat Completions as its legacy endpoint. What an invited agent reads from a terminal session is a plain-text capture of a terminal UI, and only its most recent part, so answers about long sessions can miss early context.
|
|
250
|
+
- **Search covers ended sessions only**, and terminal sessions are indexed from the same plain-text capture, so full-screen programs produce noisy matches.
|
|
251
|
+
- **Automatic sharing is tested with bash and a simulated Codex app.** The shell hook has not been run under zsh, the Mac default, and the macOS background helper (a launchd agent) has never been loaded on a real Mac. The helper finds coding conversations by whether Codex reports a git repository for them.
|
|
252
|
+
- **Pickup is Claude Code only**, and only for sessions started through Agentpen. Codex sessions are not checkpointed. It moves the work to another person's machine; it does not keep the agent running in the cloud while every laptop is shut. Up to about 20 seconds of work before the lid closed can be missing. If the original host comes back and keeps going, the two copies diverge and are reconciled with git like any two branches.
|
|
253
|
+
- **Checkpoints put source code on the Agentpen server**, unencrypted at rest. That is the trade for being able to pick up; workspaces that cannot accept it should turn the setting off.
|
|
254
|
+
- **No phone push.** Notifications reach open browser tabs and the Mac app only.
|
|
255
|
+
- **No Claude desktop app support.** Claude Code is shared from the terminal only.
|
|
256
|
+
- **"Needs a human" is a heuristic for terminal sessions**: the terminal went quiet and the last lines look like a question. Agent-native hooks would be exact.
|
|
257
|
+
- Per-session privacy within a workspace, retention policies, and E2E encryption.
|
|
258
|
+
|
|
259
|
+
## Layout
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
server/index.js HTTP API, static files, WebSocket upgrade, auth
|
|
263
|
+
server/hub.js live sessions: host <-> viewers, replay buffer, recording, status
|
|
264
|
+
server/db.js SQLite schema and helpers
|
|
265
|
+
cli/agentpen.js the `agentpen` command
|
|
266
|
+
cli/codex-app.js bridge to the Codex desktop app's control socket
|
|
267
|
+
cli/install.js `agentpen install`: the shell hook and the macOS background helper
|
|
268
|
+
cli/handoff.js checkpoints and `agentpen pickup`
|
|
269
|
+
cli/redact.js .env masking
|
|
270
|
+
server/notify.js who is notified about what; per-user stream and preferences
|
|
271
|
+
server/agents.js invited agents: Claude via the Anthropic SDK (second opinion, summary, steering)
|
|
272
|
+
server/search.js full-text search over ended sessions
|
|
273
|
+
mac/ the menu bar app (SwiftUI)
|
|
274
|
+
web/ the web app (no build step)
|
|
275
|
+
test/e2e.test.js end-to-end tests
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Credits
|
|
279
|
+
|
|
280
|
+
Inspired by [manycode](https://github.com/unworld11/manycode) (MIT), a peer-to-peer tool for sharing a live agent terminal with a short code. Agentpen is a separate codebase built around accounts, workspaces and a hosted relay; the `.env` masking approach and the join-time repaint trick are adapted from it.
|