Sessionboxer

One change, three repositories: how to let Claude Code or Codex work on a frontend, a backend and the docs at the same time

A change that spans a frontend, a backend and the docs needs one agent that sees all three. How --add-dir and a parent folder work, and what each one skips.

Sessionboxer's New session form with Claude Code as the provider, a git URL to clone into /workspace, the agent's model and instructions, and the MCP servers

The ticket says "add a phone number to the user profile". The API lives in one repository, the web app in another, and the docs in a third. You start Claude Code in the backend, it adds the field and the migration, and then it tells you that it cannot see the frontend. So you open a second terminal, start a second agent, and copy the new API shape from one chat to the other by hand.

There are better ways to do this. Each one gives the agent all three repositories, and each one leaves something out that you only notice later: an instruction file that never loads, a sandbox that will not write, or a pull request opened against the wrong account. This post goes through them for Claude Code and Codex, with what their docs say each option loads and skips.

Start the agent in the parent folder

The simplest setup is a folder that holds all the repositories:

~/work/profile-phone/
  api/        (git repository)
  web/        (git repository)
  docs/       (git repository)

Start claude in ~/work/profile-phone. The working directory now covers all three, so the agent can read and edit everywhere without asking for more access.

The catch is the instruction files. Claude Code's memory docs say that CLAUDE.md files in the folders above the working directory load at launch, and files in subdirectories load on demand: once Claude reads, writes or edits a file in api/, the api/CLAUDE.md comes in. That works, but at the start of the turn the agent knows nothing about how each repository wants to be tested. A short CLAUDE.md in the parent folder fixes that. Say which repository does what, and which command runs each test suite.

Codex works differently. Its AGENTS.md docs say it walks from the project root, usually the git root, down to the current directory, reading AGENTS.md in each folder on the way. If it cannot find a project root, it only checks the current directory. A parent folder that is not a git repository has no root, so Codex reads the AGENTS.md in the parent folder and nothing in api/ or web/. Again, put the facts the agent needs in the parent folder.

One more thing to check: commands run in the parent folder are not inside any repository. git status there fails. Tell the agent to cd into a repository before any git command, or it will lose a turn finding that out.

Add the other repositories with --add-dir

If you would rather start in one repository and lend the agent the others, Claude Code has --add-dir:

cd ~/src/api
claude --add-dir ../web --add-dir ../docs

You can do the same mid-session with /add-dir, or list folders under permissions.additionalDirectories in a settings file. The permissions docs are clear that an added directory grants file access, not configuration. From folders added with the flag or the command, Claude Code loads skills, command files and subagents, and two plugin keys from settings. It does not load the CLAUDE.md files of those folders unless you set an environment variable:

CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 claude --add-dir ../web --add-dir ../docs

Folders listed in additionalDirectories in a settings file load none of that; they only grant file access. And when /add-dir names a folder your workspace trust does not cover, Claude Code 2.1.326 and later asks you to trust it first.

If you use Claude Code's sandbox, added directories matter there too. By default, sandboxed commands can write to the working directory, a temp directory and the directories you added. Without --add-dir, an npm run build in ../web fails as soon as it tries to write its output.

Codex has the same idea. Its command line docs suggest --add-dir when Codex needs to write to more directories, rather than switching the sandbox to danger-full-access:

codex --sandbox workspace-write --add-dir ../web --add-dir ../docs

Which one to pick

Parent folder --add-dir
Agent starts in No repository One repository
Instruction files of the other repositories Claude Code: on demand. Codex: not read Claude Code: only with the environment variable. Codex: not described in its docs
Git commands Need a cd first Work in the main repository
Good for Changes that touch all repositories equally One main repository and a few it reads or edits a little

Both setups put the agent on your own machine, next to your SSH keys and your other projects. If that is why you keep the prompts on, our post on running agents in parallel covers worktrees and containers, which also work with several repositories.

Push to the right place

The code is the easy half. Then the agent has to push three branches and open three pull requests.

Check which account it pushes as. If the frontend is in your company's organization and the docs are in an open-source one where you use a personal account, one gh auth login will not do both. Our post on several GitHub accounts on one machine has the settings for that.

Then ask for the pull requests to link to each other, and say the order they merge in. The API change usually goes first, so the web app never calls a field that does not exist yet. Write that in the prompt. An agent that opens three pull requests one after another has no reason to know it.

How Sessionboxer does it

We build Sessionboxer, so this part is about our own product.

A Sessionboxer session runs in its own Docker container, and the New session form takes a list of repositories: git URLs it clones, or folders on your machine it copies in. The guide chapter on starting a session has the details. Each repository lands in its own directory, /workspace/<name>, and the agent starts in /workspace, the parent folder from the first section. The agent's briefing tells it to treat each top-level directory as its own git repository and to say which one a path, a commit or a pull request belongs to. /workspace/.sessionboxer/repos.json lists them.

From the command line it looks like this:

sessionboxer new --git https://github.com/org/web@main --git https://github.com/org/api ../docs

The header shows one chip per repository, with a dot when it has uncommitted or unpushed work. You can add a repository to a running session from there, and the agent is told on its next prompt. Removing one deletes its directory in the box, never your folder or the remote, and asks first if there is work that would be lost.

Each GitHub repository is bound to one of your connected GitHub logins, picked automatically by which account can push to it, or chosen by you. Inside that directory, git push and gh act as that account. The pull requests the agent opens are followed from the session, one row per pull request, with their checks and review comments. A file path in the chat, like src/App.tsx:42, is looked up in each repository in turn and opens in the Code pane at that line.

What Sessionboxer does not do: it does not link the pull requests to each other or merge them in order. They are separate pull requests in separate repositories, and the order is still in your prompt. A copied folder comes back to your machine one at a time, with Pull to folder… and a choice of which folder. And sessions created before repositories existed keep their single project at /workspace and cannot take a second one; start a new session for that.

A prompt that works

Whatever you use, the prompt does most of the work. Something like this:

The repositories are api/, web/ and docs/. Add an optional phone number to the
user profile: the column and migration in api/, the field and validation in
web/, and the API reference in docs/. Run each repository's tests in that
repository. Open one pull request per repository, link them to each other,
and say in each description that api/ merges first.

It names the repositories, says what goes where, and says how the work ends. Before you merge anything, read the three diffs together. Our post on reviewing a coding agent's changes has a way to do that without missing a file.

Features mentioned

Keep reading