Sundial for agents
What a Sundial workspace is to an agent, the ways in, the six facts that unblock the first call, and the rules.
What you are looking at
A Sundial workspace is a folder of files that humans and agents edit together. Every file is a live document. Every edit is attributed to whoever made it, human or agent, and an agent's edits arrive as suggestions the human accepts or rejects. You are a visible participant with a presence chip and a cursor, not a background script.
These docs are plain markdown. Fetch /docs.md for every page in one file, or /docs.md?page=for-agents for one page.
How you arrived, and what your credential is
| You have | Do this |
|---|---|
| Claude Code or Codex launched by the desktop app | Nothing. You are that chat's agent. Write with your normal tools and Sundial tracks the edits. |
A /w/<slug>?anon=<key> link, which is what Open with copies | Fetch /start. anon is your key: key= on every /g/ URL, or Cookie: sd_anon=<key> on the join call. |
| A pasted join prompt with the token and workspace id inline | Run its first command. It is the contract. |
| An Open with prompt: "Fetch /start and follow it, then join my workspace at <url>" | If that URL carries anon=, that is your key. If it carries nothing, you hold no credential yet. Say so and ask the human for the anon= link, a join prompt, or an MCP connection after they sign in. |
A bare /w/<slug> | The same: no credential yet. |
| Nothing yet | /start creates a live, writable workspace in two calls, no account needed. |
Six facts that unblock the first call
- Call
https://www.sundial.mdexactly. The apex redirects and curl drops your headers on the way, so the wrong host is a 401. A localhost workspace is unreachable from outside. - Two headers on every request:
Authorization: Bearer <token>andX-Agent-Id: ai:<your-name>, kept stable. Omit the id and you areai:local-agent, the same name as every other agent that omitted it. workspaceIdis the UUID; a slug returns 401.POST /api/workspace/local-agent/joinwith{"projectId":"<slug>"}and yoursd_anoncookie returns the UUID asworkspaceIdand a token good for 7 days.- Every write is a suggestion unless its body carries
"editMode":"edit", and only when the human asked for direct edits. Join with{"editMode":"suggest"}unless they did; that locks your token. The human can also switch you to Suggest only from your chip, which blocks delete, rename, exec and uploads. - The token is a secret. Never paste it into chat or into a file. The link that carries
anon=ortoken=is the same: never write it into a file, a commit, or a shared channel. - Fetch /start with whatever tool you have. A browsing tool gets the GET-only edition, where every operation is a URL under
/g/and your key rides in the query. A shell gets the full API. /start.md is always the markdown.
Connecting is one call, GET /api/workspace/local-agent/files?workspaceId=<uuid>: it registers your presence and returns the tree. Every endpoint is in /agent-docs; the workflow is in /start.
Feedback arrives on GET /events
Feedback arrives on GET /events: the human's comments on your work and their accept or reject on each suggestion, keyed by the suggestionId your write returned. Reply in the thread, revise, watch again. Never re-apply a rejected suggestion.
GET /file and GET /grep return the document as if every pending suggestion were accepted, yours and others'; a rejected suggestion's text disappears from later reads. Check GET /suggestions before anchoring an edit on text that might be someone's unreviewed proposal.
The rules
- Suggest by default. Every write is a suggestion unless its body carries
"editMode":"edit"and the human asked for direct edits. - Edit, do not overwrite. Anchor edits on exact existing text. A whole-file write on a document someone else is typing in loses their work.
- Say what you did. Report back in the chat or the thread you were asked in, briefly, and end with the question that moves the work forward.
- The token is a secret. Never paste it into chat or into a file.
MCP, once the human is signed in
MCP is for a signed-in human who wants a permanent connection to every workspace on their account; in a cloud workspace, Settings → Advanced → MCP connections prints the command. Start over HTTP.
Install the pointer
Install a pointer, never a snapshot. A downloaded copy of /start goes stale. The install stub in /start triggers on Sundial links and always follows the live version. It works for Claude Code at ~/.claude/skills/sundial/SKILL.md and for Codex at ~/.codex/skills/sundial/SKILL.md.
Where everything else is
- /start: the skill. Joining, creating, the local-folder live sync, and the template catalog.
- /agent-docs: the HTTP contract, every endpoint in full.
- /llms.txt: the signpost crawlers probe first.
- /templates.md: every template slug you can create a workspace from.
- /.well-known/agent.json: the discovery manifest.