Project code
Keep one line of history for a project's code, synced from the workspaces of its chats, start it from a repository, and take it with you as a zip or to GitHub.
3 min readUpdated for Chat 0.5.2Edit on GitHub
Sync a chat's work
Every chat in a project has a workspace that is a git repository, and the project has one main line of history that those workspaces share. A new project chat's workspace starts with the project's code.
- 1
Work in a project chat
Ask for changes as in any workspace. The workspace's Git tab lists what changed.
- 2
Sync
Choose Sync. Chat saves the chat's changes as a commit, with a message drafted from the changes that you can edit, brings in what others synced and shares the result as the project's main line. Save without syncing keeps a commit in this chat only.
- 3
Settle a clash
When you and someone else changed the same lines, Sync pauses and shows each file. Choose Keep mine, Keep the project's, or Resolve with the model, then Finish syncing. Stop syncing leaves your changes as they were.
The model can sync too, with its sync_code tool, when you ask it to. In a chat's Git tab, the latest save that hasn't been synced can be undone: its changes go back to unsaved.
Start from a repository
To build on an existing repository, give its address when you create the project, under Start from a repository, or choose Start from a repository on an empty project's Code tab. Chat copies the repository's default branch once, with all its history and authors, and it becomes the project's main line. Sync, History, Undo and research build on it, and every new project chat's workspace starts with the code. The Code tab says where the project started.
- Private repositories take an access token with read access to the contents. It's used for that copy and never stored.
- Large histories. When the history is too big to keep (over 64 MiB), the latest version comes in as one commit instead.
- Only the project's owner can do this, and only while the project has no code.
Chat fetches over HTTPS from public addresses only, and doesn't follow redirects.
Browse the history
The project's Code tab shows its files, its History (the latest 200 commits), which chat made each commit, and who changed each line of a file. It also lists the chats working on the code.
From a commit you can:
- Compare with now: the commits in between and each file's diff. Pick any two versions to compare, or Swap them.
- New chat from here: a project chat whose workspace starts at that commit. Its next Sync combines the work with everything synced since.
- Undo this commit: a new commit on main takes back its changes and keeps everything after it. When later commits changed the same lines, Chat offers to do it in a new chat, where the model combines the undo with the later work. Other chats bring the undo in with their next Sync.
Take the code with you
Export on the Code tab:
- Download a zip of the code. Tick to add its history as a git bundle and your chats as Markdown.
- Push to GitHub with a token, to a repository Chat creates (private or public) when it doesn't exist. The token is used for that push and never stored.
Other people's repositories
To read, explain or review a public repository without making it the project's code, paste its address in a chat with a workspace, or start from Explore a repo on the home page. The model clones it into repos/, which stays out of the project's history, so Sync never takes it in.
Limits and storage
| Limit | Value |
|---|---|
| Code and history per project | 256 MiB |
| One sync | 64 MiB |
| History shown | The latest 200 commits |
| One file shown | The first 200 KB |
Chat keeps each project's history as a chain of git bundles in Postgres and folds them together from time to time. Bundles travel over the workspace's own command channel, so workspaces need no network access or credentials to sync.
