Jian/ Docs

Projects, worktrees and pull requests

Point a chat at a repository or folder, let agents work in isolated git worktrees, and follow the pull requests they open.

A conversation can be bound to one or several repositories or folders. The agent then works in those checkouts, follows each repository's own instructions, keeps its work apart from other agents in git worktrees, and opens pull requests that the gateway watches for you.

Try asking

In the Harbor Studio dashboard repo, find why the empty state renders twice. Add a regression test, show me the diff and wait before pushing.

Work on the billing fix in a separate worktree. I'm still editing the main folder.

Open a pull request for this branch and tell me when the checks finish.

Choose what a chat works on

Above the composer in a new chat you can start from scratch, or pick folders or GitHub repositories, one or several.

You pickIt runs
A GitHub repositoryIn the cloud (on the gateway), on a machine that is online, or on this computer in a folder you choose
A folder on this computerOn this computer, through the desktop app. A server never takes folders from its own disk
NothingIn the shared folder of the gateway

Picking repositories doesn't limit what the agent's GitHub access can reach. The web panel offers repositories only.

The sidebar mixes Recent chats with one folder per project, joined by name, and a cloud mark shows chats that run on a remote gateway or machine. A chat with no project gets its own folder in Recent.

How the conversation is bound to a place:

  • Gateway: the agent works in the folder every agent on that gateway shares.
  • Desktop app's own gateway: agents start in your real home folder. A repository cloned with no folder chosen goes in ~/Jian.
  • A connected machine: commands and file tools run there. See Jian Remote.

The repository's own instructions

In a chat that works in folders or repositories, the agent follows each one's AGENTS.md, or its CLAUDE.md when there is no AGENTS.md. They rank below your own instructions and can't allow anything you wouldn't. Skills in .agents/skills and .claude/skills appear beside the agent's own. Nested AGENTS.md files in subfolders are listed, and the agent reads them when it works there. Changes are picked up within a minute on the gateway and within five minutes on a machine. A subagent gets the instructions and skills of the conversation that started it.

Worktrees

A worktree is a checkout of its own: a separate folder with its own branch jian/<name>, made from the branch you have checked out. What the agent does there stays out of your folder until it is merged.

  • When the agent makes one: at the start of each turn it sees who else works in each folder. If another agent or conversation is there, it makes a worktree before its first edit. If only your uncommitted changes are there, it asks before touching the folder. You can also just ask for one.
  • Writes stay inside: while a worktree exists, the agent's file tools refuse to write in the folder it came from, and its commands start in the worktree.
  • The worktree badge sits left of the pull request badge. It shows how far the worktree is ahead or behind its base and how many files are uncommitted. Its menu has Merge into, Update from, Open pull request and Discard. The first three ask the agent to do it. Discard asks you to confirm, says what will be lost, and waits until the agent has finished.
  • Merging goes into the folder the worktree came from, then removes the worktree and its branch. If a hook stops the merge or it takes too long, the merge is undone and the agent is told why. A branch with commits the base doesn't have is kept when the worktree is removed, unless you asked to throw the work away.
  • Subagents get their own worktree, made from the conversation's one, and merge back into it.
  • Under Ask first, creating, updating, merging and removing a worktree wait for your approval.
  • On a machine, worktrees live there too, and the agent's file tools work in them.

Pull requests

The badge and the Inspector

The pull request badge lists the pull requests your agent or its subagents created. Clicking a link or the badge opens the pull request in the Inspector in folding sections: Description, Checks, Changes and Reviews. A refresh button re-reads it from GitHub, and Update branch brings in the base.

  • Merge is in the panel's own chats. Why a pull request can't merge shows as a tooltip on the button, and the button is disabled when merging can't work. If Jian's GitHub App is on the branch's bypass list, you can Bypass rules and merge.
  • Fix merge conflicts takes Merge's place when a branch conflicts. The agent brings the base in, settles each conflict, runs the checks that cover it and pushes the branch. It works in every conversation, WhatsApp and Telegram included, and shows in the panel without reaching the contact.
  • Mark ready for review turns an open draft into a regular pull request.

Watched for you

The gateway watches each pull request your agent opens until it is merged or closed. A new review or comment, a failed check, checks passing after a failure, a conflict, or commits from someone else reach your agent as one note, in the background. The note stays out of the chat, and you see what the agent does about it. The badge says which ones are watched, and why one can't be. See Listening.

The Pull requests screen

With GitHub connected on a server gateway, Pull requests in the sidebar lists the open pull requests of every connected account, up to 50 per account. Each row shows reviewers, checks, whether it can merge and when it last changed.

  • Switch between Open, Mine and Needs review, pick a repository, or search. Needs review leaves out drafts and anything already approved.
  • Review on a row hands the pull request to an agent. It gets a new chat named after the pull request, for example Review octo-example/site#7, and runs on Auto. The agent reads the changes, posts one review on GitHub with comments on the lines they concern, and sums up in that chat. The row then links to that chat.
  • Review settings sets the reviewing agent and the instructions it follows. Review new pull requests reviews each one that is opened, reopened or marked ready. Include drafts adds drafts, and you can limit it to some repositories. Each new head commit gets one automatic review at most. See GitHub for the webhook setup.

The text of the pull request's author stays out of the agent's instructions: the message that starts a review carries only the address, the head commit and your instructions, so a pull request can't slip instructions to the reviewer.

Terminals and files

The Inspector has terminals, a read-only file tree and Changes for each project. See The Inspector.

Limits and failures

  • Pull requests and automatic reviews are for server gateways. The desktop app's own gateway doesn't show the Pull requests screen.
  • Subagents work on the gateway, not on a conversation's machine. The brief must name the machine and paths.
  • Changes opens for a conversation on a machine, for its worktrees and for the project's clone there.

On this page