Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5ac00c1
feat(summary): run Claude or Codex headless for summaries
MilosMosovsky Nov 6, 2026
e4b0fd7
feat(summary): collect the day's sessions with their sub-agents
MilosMosovsky Nov 6, 2026
a0f55d0
feat(summary): write session notes and file them into topics
MilosMosovsky Nov 6, 2026
e570a76
feat(summary): run summaries each morning and keep a dated history
MilosMosovsky Nov 6, 2026
abfea17
refactor(summary): one owner for session keys, lighter transcript reads
MilosMosovsky Nov 6, 2026
8a24b97
fix(summary): no Codex tools, and a run with no notes is a failure
MilosMosovsky Nov 6, 2026
acbcfd5
fix(summary): find nested idle Codex parents; sync state files
MilosMosovsky Nov 6, 2026
ec08343
test(summary): compare reloaded history as saved JSON
MilosMosovsky Nov 6, 2026
fd11b67
feat(install): ask once before turning on morning summaries (U7)
MilosMosovsky Nov 6, 2026
5ff31d5
refactor(summary): one owner for the summary state folder
MilosMosovsky Nov 6, 2026
e28a3b5
feat(mcp): read and start session summaries from the AI client (U9)
MilosMosovsky Nov 6, 2026
2bbae4b
feat(summary): Summary page with saved runs and a Summarize button (U6)
MilosMosovsky Nov 6, 2026
95ecf1c
feat(summary): newest work first, with when each session was touched
MilosMosovsky Nov 6, 2026
3b3745a
docs: session summaries, their privacy model and how to turn them on …
MilosMosovsky Nov 6, 2026
bd5e40a
fix(summary): put what needs you first on the Summary page
MilosMosovsky Nov 6, 2026
e158b43
refactor(summary): one owner for the dashboard's write guard and stat…
MilosMosovsky Nov 6, 2026
7b57cb3
fix(summary): review fixes for the page, install and MCP tools
MilosMosovsky Nov 6, 2026
e75246d
test(install): skip the summary-time check off macOS, like the other …
MilosMosovsky Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ homebrew_casks:
trash:
- ~/Library/LaunchAgents/com.github.milosmosovsky.agentyard.plist
- ~/Library/Caches/agentyard
- ~/Library/Application Support/agentyard/summary
- ~/Library/Logs/agentyard.log
caveats: |
Start agentyard in the background (asks before changing anything):
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ All notable changes are documented here. The format follows

## [Unreleased]

### Added

- **Session summaries, off by default.** A Summary page says where each Claude Code and Codex session
got to, what it is waiting on you for or blocked on, and what comes next. A summary runs every
morning (07:00 by default, after wake if the Mac was asleep) and **Summarize** runs one for the last
24 hours. Work is grouped by repository (worktrees count as their repository), then topic, then
session, newest first, with how long ago each session was touched, its branch and PR, sub-agents and
Copy resume. Topics carry over with how long they have been open, stay visible 7 days after their
last activity and leave after 14. Every run is saved, failed ones included, and reopens from a dated
picker; a failed run shows the previous good summary under its error.
- One provider writes the summaries, Claude (`haiku`) or Codex (`gpt-6-luna`), through your own CLI
login, and it never switches to the other. Each run sends clipped transcript excerpts to that
provider's company. The CLI runs in an empty folder with its tools, MCP servers and session
persistence off, the prompt on stdin, and its answer is checked against a schema. Nothing runs and
no model is called while summaries are off. State is kept private in
`~/Library/Application Support/agentyard/summary`.
- `agentyard install` asks once whether to turn summaries on, naming the company that would receive
excerpts; `--yes` keeps the previous choice or leaves them off. New flags: `--summary
off|auto|claude|codex`, `--summary-at HH:MM` and `--summary-model` on `install`, and `-summary`,
`-summary-at` and `-summary-model` on `serve`.
- MCP tools `list_summaries` and `get_summary` (read saved runs, no model call) and `summarize` (starts
a last-24-hours run and sends excerpts to your provider).
- `POST /api/summary` starts a run and answers this Mac only; a browser request needs the page token
and its own `Origin`. `GET /api/summary/status` and the Summary page follow the Sessions tab's
rule (this Mac, unless `--sessions-lan`).
- `brew uninstall --zap` also removes the saved summaries.

## [0.10.0] - 2026-10-12

### Added
Expand Down
76 changes: 71 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,33 @@ Agent icons identify Claude Code and Codex. Use the agent icons for quick filter
> contain tokens and customer data, so other devices see a notice instead. See
> [Privacy and security](#privacy-and-security).

### Summary

<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/screenshots/summary-dark.png">
<img alt="The Summary page: a repository, its topics, and for each session where it got to, what it waits on, what comes next, its branch and PR, and Copy resume." src="docs/screenshots/summary-light.png" width="100%">
</picture>

What each session got to, so you can start the day without rereading transcripts. A summary runs
every morning (07:00 by default, and right after your Mac wakes if it was asleep then), and
**Summarize** runs one for the last 24 hours whenever you want it. It is off until you turn it on.

Work is grouped by repository (a worktree counts as its repository), then by topic, then by session,
with the newest work first and how long ago each session was touched. For each session:

- where it got to, what it is waiting on you for or blocked on, and what comes next;
- its branch and PR, any sub-agents with a line each, and **Copy resume**.

Topics carry over from one summary to the next and say how long they have been open ("open since
Mon, Nov 2 · 4 days"). A topic with no activity stays visible for 7 days and leaves the list after
14. Every run is saved, including failed ones, and you can reopen any of the last 30 from the dated
picker. A failed run keeps showing the previous good summary beneath its error.

One provider writes the summaries, the one you choose: your own Claude Code or Codex CLI, with its
login. It never switches to the other. Each run sends excerpts of your transcripts to that provider;
see [Privacy and security](#privacy-and-security). Turn it on with
[`agentyard install`](#run-in-the-background).

### On your phone

With [LAN mode](#on-your-local-network) on, the same page works on a phone: tables become cards, and
Expand Down Expand Up @@ -462,9 +489,19 @@ $ agentyard uninstall # stop it and remove the LaunchAgent
`uninstall` asks `Remove the background agent? [y/N]`, then tells you what it left behind: the cache
in `~/Library/Caches/agentyard` and the log.

`install` asks one more thing the first time: whether to summarize your sessions each morning. The
question names the provider it found (Claude, then Codex) and the company that would receive
excerpts of your transcripts, Anthropic or OpenAI, through your own CLI login. The default is no.
Later installs keep your answer, and `--yes` keeps the previous choice or leaves summaries off. To
decide without being asked, pass `--summary off|auto|claude|codex`; `auto` picks `claude` if it is on
your PATH, else `codex`. The agent's `PATH` includes the folders of `gh`, `git`, `claude` and `codex`,
since launchd does not read your shell profile. Summaries, their saved runs and their notes live in
`~/Library/Application Support/agentyard/summary`; `agentyard uninstall` leaves them, and
`brew uninstall --zap agentyard` removes them.

Removing a Homebrew install? Stop the agent first, or launchd keeps trying to start a binary that is
gone: `agentyard uninstall && brew uninstall agentyard`. `brew uninstall --zap agentyard` also
removes the agent, the cache and the log.
removes the agent, the cache, the saved summaries and the log.

## Let your AI clean up

Expand Down Expand Up @@ -496,6 +533,9 @@ anything.
| `merge_train` | Ranked open PRs, one next step, all lane counts, local validation and linked worktrees. Optional exact `repo` (`owner/name`) and `lane`; `stale_days` defaults to 14 and `limit` to 50 (maximum 500). Counts cover the repository scope before lane filtering and limiting. |
| `get_pr` | A PR's train step and local evidence, plus its description and changed files via the agent. Requires `repo` and `number`; returns the snapshot with an unavailable-detail notice when offline. |
| `remove_worktrees` | Removes the given worktrees if they are still reclaimable; `dry_run` reports what would go. |
| `list_summaries` | Saved [summary](#summary) runs, newest first, failures included: time, window, scheduled or on demand, provider and counts. Reads local files; calls no model. `limit` defaults to 14. |
| `get_summary` | The latest successful summary, or the run at an `at` timestamp from `list_summaries`, optionally for one `project`: progress, next steps, what each session waits on, resume commands and sub-agents. Calls no model. |
| `summarize` | Starts (or joins) a summary of the last 24 hours through the background agent and waits for it. It sends transcript excerpts to your chosen provider, and only works when summaries are on. |
| `sync_worktrees` | Asks the background agent to rescan now, refresh PRs and their local validation, and waits for it, up to a few minutes. |

An MCP server keeps running the code it started with, so after `brew upgrade` the AI may be talking
Expand All @@ -504,6 +544,10 @@ elsewhere, or the background agent reports another version, every tool result ca
and `remove_worktrees` refuses (dry runs too): older code may lack checks the installed version has.
Reconnect it (`/mcp` in Claude Code) or start a new session.

`list_summaries` and `get_summary` read the saved runs directly, so they work without the background
agent. `summarize` is the only summary tool that sends anything off this Mac, and the AI client sees
a clear message instead if summaries are off.

Start a PR session with `merge_train`, then use `get_pr` to read each candidate. Both tools are
read-only. They read `/api/prs.json`, falling back to the saved `prs.json` snapshot, and report the
source and age. `agentyard mcp -demo` includes every merge train lane and synthetic PR details.
Expand Down Expand Up @@ -605,6 +649,9 @@ Flags take one dash or two (`-root` and `--root` are the same).
| `--name NAME` | `agentyard` | with `--lan`: the `.local` name to publish |
| `--port N` | `4777`, or `80` with `--lan` | port to listen on |
| `--sessions-lan` | off | with `--lan`: show the Sessions tab to other devices too |
| `--summary off\|auto\|claude\|codex` | the previous install's, else ask once (no on `--yes` or without a terminal) | who writes the daily summary; `off` runs and sends nothing |
| `--summary-at HH:MM` | `07:00`, or the previous install's | local time of the daily summary |
| `--summary-model MODEL` | `haiku` for Claude, `gpt-6-luna` for Codex | model passed to the provider's CLI |
| `--yes` | | don't ask; install with these settings |
| `--dry-run` | | show the checks, the plan and the plist; change nothing |

Expand All @@ -628,7 +675,10 @@ manager.
| `-size-ttl D` | `30m` | how long a measured worktree size is reused |
| `-claude-dir DIR` | `~/.claude` | Claude Code config folder (holds `projects/` and live `sessions/`) |
| `-codex-dir DIR` | `~/.codex` | Codex home folder (holds `sessions/`) |
| `-sessions-lan` | off | serve the Sessions tab to other devices too |
| `-sessions-lan` | off | serve the Sessions and Summary tabs to other devices too |
| `-summary` | `off` | summary provider: `off`, `auto`, `claude` or `codex` |
| `-summary-at HH:MM` | `07:00` | local time of the daily summary |
| `-summary-model MODEL` | `haiku` for Claude, `gpt-6-luna` for Codex | model passed to the provider's CLI |
| `-once` | | scan once, print the worktree JSON to stdout and exit |

#### `agentyard mcp`
Expand All @@ -646,11 +696,14 @@ manager.

The page's data is also served as JSON: `/api.json` (worktrees), `/api/prs.json` (pull requests),
`/api/pr-history.json` (cached 30-day opened/merged PR history),
`/api/pr-detail?repo=OWNER/REPO&number=123` (description and changed files for a tracked PR), and
`/api/status` (version, last scan times, whether a sync is running). PR details include up to the first
`/api/pr-detail?repo=OWNER/REPO&number=123` (description and changed files for a tracked PR),
`/api/status` (version, last scan times, whether a sync is running) and `/api/summary/status` (whether
summaries are on, the provider, whether a run is going, its progress and the last error; this Mac only,
like the Sessions tab). PR details include up to the first
100 changed files and the total changed-file count.

`POST /api/remove` is the one write. It is meant for the page, not for scripts: it needs the token
`POST /api/remove` removes worktrees (and `POST /api/summary` starts a summary run, see
[Privacy and security](#privacy-and-security)). `POST /api/remove` is meant for the page, not for scripts: it needs the token
the page embeds for viewers on this Mac, and the dashboard's own `Origin`.

```
Expand Down Expand Up @@ -680,6 +733,19 @@ agentyard is a local tool with no login and no telemetry. It talks to GitHub thr
branch names, PR titles and repository names. Don't use LAN mode on shared or public Wi-Fi.
- **Sessions stay on this Mac.** Other devices see a notice and no session ids, unless you opt in with
`--sessions-lan`.
- **Summaries send transcript excerpts to one provider, only when you turn them on.** With
`--summary` off (the default) nothing runs and no model is called. With it on, each run sends clipped
excerpts of the Claude Code and Codex sessions active in the window (their titles, first prompts and
latest messages) to the provider you chose, Anthropic for `claude` or OpenAI for `codex`, through your
own CLI login. Transcripts can contain secrets, so decide that before you opt in. agentyard starts the
CLI in an empty folder with every tool, MCP server and session record switched off. Claude runs with
`--safe-mode --strict-mcp-config --tools "" --no-session-persistence`. Codex runs in a read-only
sandbox with `--ephemeral`, `--ignore-user-config`, web search disabled and every default-on tool
feature turned off. The prompt travels on stdin, not in the process list, and answers are checked
against a fixed schema before they are saved. Saved runs, notes and topics live in
`~/Library/Application Support/agentyard/summary` (folder `0700`, files `0600`). The Summary page
follows the Sessions tab's rule: this Mac only, unless `--sessions-lan`. Only this Mac can start a
run, and a browser must send the page's token and its own `Origin`.
- **Sync** refuses cross-origin requests, so another web page cannot trigger scans.
- **Removal is this Mac's alone.** The dashboard is no longer read-only: `POST /api/remove` removes
worktrees, through the same re-checked removal as `agentyard mcp`. It answers only a client on this
Expand Down
34 changes: 33 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Threat model

agentyard is a local developer tool. It reads your git worktrees, the GitHub CLI's view of your pull
requests, and your Claude Code and Codex transcripts, and serves them over HTTP.
requests, and your Claude Code and Codex transcripts, and serves them over HTTP. If you turn on
summaries, it also sends excerpts of those transcripts to Anthropic or OpenAI.

- **The page has no login.** Anyone who can reach the listening address sees branch names, PR titles
and repository names. By default it listens on `127.0.0.1:4777`, reachable only from this machine.
Expand Down Expand Up @@ -49,6 +50,37 @@ with `--lan`. Session ids are validated and shell-quoted in the copied resume co
(`.env` and the like) are deleted with it and listed in every result. Branches are never deleted.
`agentyard mcp` reads its listings from the agent at the address it is given, the installed agent's
by default; the decision to remove always comes from its own local scan, never from that data.
- **Summaries send transcript excerpts to a model provider (opt-in).** With summaries off, the default,
nothing is read for them and no model is called. With `-summary` on, each run sends clipped excerpts
of the Claude Code and Codex sessions active in the window (title or first prompt, the latest
messages, a first prompt and last reply for automated sessions) to the one provider chosen, through
that provider's CLI and your login there. It never falls back to the other. Excerpts can hold secrets
from tool output and text written by someone else (a web page or issue an agent read), so assume the
provider sees both. `install` asks before turning this on and names the company that receives them;
`--yes` keeps the previous choice or leaves it off.
- **Prompt injection is contained by denying tools, not by trusting the model.** The prompt says to
treat excerpts as data, but the protection is that the CLI can do nothing with an instruction. It runs
in an empty folder with the prompt on stdin. Claude gets `--safe-mode --strict-mcp-config --tools ""
--no-session-persistence`. Codex gets a read-only sandbox, `--ephemeral`, `--ignore-user-config`,
`--ignore-rules`, web search disabled and every feature that adds a tool turned off (the list is read
from the installed `codex`, so tool families added later are off too). Each call times out after two
minutes. The answer must match a closed JSON schema, or the batch fails and its sessions show as not
summarized. The page renders every field as escaped text; the model's output is never HTML, a command
or a link. The one command the page offers, Copy resume, is built from the session id and folder
agentyard read, not from model text.
- **Starting a summary is guarded like removal.** `POST /api/summary` is refused unless the client is
this Mac itself (never another LAN device, even with `-sessions-lan`). A request that carries an
`Origin` header, which is every browser request, must name the dashboard's own host and carry the
`X-Agentyard-Token` the page embeds for this Mac. A request with no `Origin` header from this Mac is
the path for `agentyard mcp` and command-line tools, which are the user's own processes. It takes no
parameters (the window is always the last 24 hours), starts nothing while a run is going, and
answers `409` when summaries are off. `GET /summary` and `GET /api/summary/status` follow the
Sessions tab's rule: this Mac only unless `-sessions-lan`, and other devices see a notice. Under
`-sessions-lan` a device can read the summary but not start a run.
- **Summary state is private.** Saved runs, cached notes, topics and the schedule live in
`~/Library/Application Support/agentyard/summary`, in a `0700` folder with `0600` files. They hold
model-written text derived from your transcripts, which can repeat what the transcripts contained.
`brew uninstall --zap agentyard` deletes them; `agentyard uninstall` does not.
- **Credentials.** It uses the GitHub CLI's existing login and stores no tokens; the LaunchAgent never
carries `GH_TOKEN` or `GITHUB_TOKEN`. Caches in
`~/Library/Caches/agentyard/` hold repository, PR and session metadata, not credentials.
Expand Down
2 changes: 1 addition & 1 deletion cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func agentJSON(method, listen, path string, timeout time.Duration, limit int64,
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("%s", resp.Status)
return &agentHTTPError{Code: resp.StatusCode, Status: resp.Status}
}
b, err := io.ReadAll(io.LimitReader(resp.Body, limit))
if err != nil {
Expand Down
Loading
Loading