Layouts
Projects as git submodules, or as directories of one repository. Both give the same feature folder.
A feature folder always looks the same. There is one directory per project under the feature root. Touched projects are on the feature branch, and referenced ones are at the base. Deny rules keep the session’s edit tools out of the referenced ones. What differs is how AspenX builds that folder from your monorepo.
layout: submodules
The monorepo is a superproject whose projects are git submodules. Each project has its own repository, branches and PRs. The superproject’s commits record which commit of each project belongs together. These records are the gitlinks.
For a feature, AspenX creates a worktree of the superproject at the feature root, on the branch feature/<name>. At each touched submodule’s path it adds a worktree of that submodule’s repository, also on feature/<name>. That branch starts at the pinned commit, or is used as it is when it already exists.
Each referenced submodule gets a detached worktree at the superproject’s pinned commit, or at the --ref commit. AspenX builds the project’s main image from that commit. Deny rules in .claude/settings.local.json keep the session’s edit tools out of these worktrees.
Each project’s name must be a submodule’s name or path in .gitmodules.
aspenx pr pushes every touched project and opens one PR for each. It also opens a “Bump gitlinks” PR on the superproject with its feature/<name> commits, which move the touched projects’ gitlinks to their feature-branch commits. It skips touched projects with no commits. Project PRs target each repository’s default branch. The superproject PR targets the feature’s base when that branch exists on origin. --base overrides both. aspenx diff <feature> monorepo shows the gitlink diff alone.
The layout needs a normal superproject. Its submodules must be initialized in the main checkout (git submodule update --init) and fetched far enough to hold the pinned commits. AspenX uses native gitlinks. aspenx projects warns about a submodule the manifest does not cover. Such a submodule stays an empty directory in feature folders.
layout: directories
The monorepo is one repository and each project is a directory, named by path in the manifest. A feature is one worktree of that repository on feature/<name>. You edit the branch in the touched projects’ directories. The referenced projects run from images of their directories at the base commit.
A referenced directory is writable on disk, but the deny rules in .claude/settings.local.json keep the session’s edit tools out of it. aspenx doctor reports commits under one and fixes them with --referenced-edits touch or revert.
aspenx pr opens one PR for the branch. There are no gitlinks to bump.
Choosing
| submodules | directories | |
|---|---|---|
| Project versioning | Each project has its own repo and history. | One history. |
| Pin a referenced project to another ref | --ref worker=v2.3.0 checks that submodule out at the ref and builds its image from it. aspenx pr does not commit that gitlink. |
--ref applies to the image only. The folder keeps the base commit. |
| PRs per feature | One per touched project, plus the bump PR. | One. |
| Risk | Git’s support for worktrees with submodules has edge cases. AspenX handles them. | None specific. |
Both layouts support --base <ref> and --ref <project>=<ref>. --base picks the monorepo commit a feature starts from, main by default. --ref gives a referenced project a different pin. That can be another feature’s branch, to build on top of it.