Lifestyle
Integrating parallel work
Integrate independent edits using file and interface contracts, resolve conflicts and verify combined behavior.
About 20 min read · Practice 30 min

Advanced · Desktop / CLI / VS Code / JetBrains
Before you start
On this page
Back to the Codex learning hubCodex learning hub: tutorial directoryA planned 60-lesson, ten-unit Codex curriculum, from setup and your first task to MD instructions and advanced integrations. Find your next lesson by experience, platform, goal or command; unpublished entries show their status.Read the full article
Goal and preparation
Lessons and resources mentioned here: WorktreesWorktrees and isolated tasksA Git worktree gives one repository multiple working directories on different branches. It isolates file edits, but databases, ports and external services may still be shared. File isolation is not full resource isolation.Read the full article · Evidence checksSubagent scope and quality checksDefine independent inputs, edit scopes and evidence, then review subagent results and resolve gaps.Read the full article
Parallel work saves time on independent parts; integration still has an order. Two completed workers may mean only that each branch is done. A page using both changes needs acceptance on their combined version and environment. This exercise represents the deliverables with heading and footer text files, without calling those checks full website tests. Apply the workflow to your project's real build/browser checks afterward.
Step 1: Prepare shared acceptance fixtures
Create a new integration-lab in your practice area and open its terminal. The Git/Node commands below are the same on Windows, macOS and Linux. Verify the path and ensure sibling names integration-heading, integration-footer, integration-review and integration-conflict are unused. Choose and consistently substitute different names if necessary instead of overwriting existing work.
git init -b main
git config user.name "Codex Learner"
git config user.email "learner@example.test"
Create the three complete files below. Initially heading.txt contains Title: Small Steps and footer.txt contains Footer: Local exercise, each with a final newline. The tests describe two new requirements that are not yet implemented, so the baseline deliberately has zero passes and two failures. This isolated, remote-free lab is not an unexplained failure on a production main branch.
Title: Small Steps
Footer: Local exercise
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const read = name => readFileSync(new URL(name, import.meta.url), 'utf8').trim();
test('heading includes the practice label', () => {
assert.equal(read('heading.txt'), 'Title: Small Steps Lab');
});
test('footer identifies practice-only material', () => {
assert.equal(read('footer.txt'), 'Footer: Practice only');
});
node --test integration.test.mjs
git add -- heading.txt footer.txt integration.test.mjs
git commit -m "Add integration exercise and acceptance cases"
git status --short
Step 2: Assign two separate deliverables
git worktree add -b codex/heading ../integration-heading main
git worktree add -b codex/footer ../integration-footer main
git worktree add -b codex/integration ../integration-review main
git worktree list
A may change only integration-heading/heading.txt to Title: Small Steps Lab. B may change only integration-footer/footer.txt to Footer: Practice only. Make these exact edits manually, or explicitly delegate two workers in a supported Codex task with full paths, branches, exclusive writable files and report format. Reference verification uses equivalent deterministic edits without claiming two model runs.
Use two subagents with separate checkouts. Do not create more agents.
Agent A owns only <ABSOLUTE_HEADING_CHECKOUT>/heading.txt on codex/heading.
Set that file to 'Title: Small Steps Lab' with a final newline.
Agent B owns only <ABSOLUTE_FOOTER_CHECKOUT>/footer.txt on codex/footer.
Set that file to 'Footer: Practice only' with a final newline.
Neither agent may edit tests, merge, push, deploy or touch the other checkout.
Return the actual file diff and blockers. Leave staging and integration to the parent.
Wait for both agents before reviewing their results.
| Work | Writable file | Expected tests at this stage |
|---|---|---|
| A: heading | heading.txt | Heading passes; footer pending |
| B: footer | footer.txt | Footer passes; heading pending |
| Integrator | Reviewed combined branch | Both pass after both merges |
Inspect any change to integration.test.mjs before accepting it; workers must not weaken acceptance.
git -C ../integration-heading diff -- heading.txt
git -C ../integration-footer diff -- footer.txt
node --test ../integration-heading/integration.test.mjs
node --test ../integration-footer/integration.test.mjs
Step 3: Commit and integrate in sequence
Wait until both writers stop, inspect full statuses and commit only the specified files. If a worker already committed, verify that commit/diff instead of duplicating it. Record both SHAs. For real collaboration, use verified commits or pause ongoing branch changes so acceptance does not target a moving result.
git -C ../integration-heading add -- heading.txt
git -C ../integration-heading commit -m "Label the practice heading"
git -C ../integration-footer add -- footer.txt
git -C ../integration-footer commit -m "Label the practice footer"
git rev-parse codex/heading codex/footer
git -C ../integration-review status --short
git -C ../integration-review merge --no-ff codex/heading -m "Integrate practice heading"
git -C ../integration-review merge --no-ff codex/footer -m "Integrate practice footer"
node --test ../integration-review/integration.test.mjs
git -C ../integration-review diff main...HEAD -- heading.txt footer.txt
Expect both checks to pass in the review checkout, both new values in its diff and unchanged baseline text on original main. If the first merge conflicts, stop before the second. A green individual branch does not replace combined acceptance. --no-ff preserves visible integration records for teaching; real repositories should follow their own merge policy.
git -C ../integration-review rev-parse HEAD
Record this full SHA with the two passing checks. After the conflict and abort below, run the same command from the original folder: require the identical SHA, clean status and both tests passing. Do not substitute the heading branch or main SHA for the integration commit.
Step 4: Create a deliberate conflict and abort
git worktree add -b codex/conflict ../integration-conflict main
Change only integration-conflict/heading.txt to Title: Another direction and commit it. Starting from old main, it edits the same line differently from the integrated branch. Before merging it, confirm the review checkout is clean and both tests pass. That gives --abort a clear pre-merge state instead of practicing on unsaved work.
git -C ../integration-conflict add -- heading.txt
git -C ../integration-conflict commit -m "Create a conflicting practice heading"
git -C ../integration-review merge --no-ff codex/conflict -m "Attempt conflicting integration"
git -C ../integration-review status --short
The conflict file contains both headings and Git markers. For this exercise, record the error/status and abort instead of choosing a side. Tests should return to two passes with a clean status. With pre-existing uncommitted edits, abort may not reconstruct all earlier work, which is why the clean-state check matters. Real conflict resolution requires choosing behavior section by section and retesting rather than always taking ours or theirs.
git -C ../integration-review merge --abort
node --test ../integration-review/integration.test.mjs
git -C ../integration-review status --short
Cleanup, problems and delivery
If tests cannot locate text files, confirm all three files belong to the same checkout. The test reads relative to its own file URL, preventing the caller's directory from selecting another copy. Identify unexpected changes, trace missing branches to creation/commits and inspect combined diffs after a merge that fails acceptance. Do not let workers weaken tests or split dependent interface work without a shared contract.
Stop practice workers and close checkout windows, then verify full paths and clean statuses for all four copies from integration-lab. Remove only the new, committed, unused copies, investigating refusals without force. The original repository and codex/integration branch remain, so git show can still retrieve the combined result. No production main merge or PR occurs.
git worktree list
git worktree remove ../integration-heading
git worktree remove ../integration-footer
git worktree remove ../integration-review
git worktree remove ../integration-conflict
git show codex/integration:heading.txt
git show codex/integration:footer.txt
Record both input SHAs, merge order, integrated SHA, two-test result, conflict/abort result and preserved main state. Reference Git/Node checks prove neither model delegation nor full website acceptance. Mark unoperated platforms as officially documented. Continue to Browser and imagesWork with browsers, screenshots and imagesVisual work needs a reference, the actual result and explicit change criteria. Browser inspection, screenshots and generated concepts provide different evidence. A generated interface is not proof that a workflow works.Read the full article before preparing delivery for a real project.
Back to the Codex learning hubCodex learning hub: tutorial directoryA planned 60-lesson, ten-unit Codex curriculum, from setup and your first task to MD instructions and advanced integrations. Find your next lesson by experience, platform, goal or command; unpublished entries show their status.Read the full article
Read the full description
Three numbered stages: identify the starting point, perform the exercise, and verify the result. Original illustration, not a product screenshot.
Lifestyle
Codex learning hub: tutorial directory
A planned 60-lesson, ten-unit Codex curriculum, from setup and your first task to MD instructions and advanced integrations. Find your next lesson by experience, platform, goal or command; unpublished entries show their status.
Lifestyle
Worktrees and isolated tasks
A Git worktree gives one repository multiple working directories on different branches. It isolates file edits, but databases, ports and external services may still be shared. File isolation is not full resource isolation.
Lifestyle
Workshop: build a small website
Plan and build the Small Steps task website from brief.md, with adding, completing, deleting, filtering and local persistence. Separate HTML, CSS, data functions, UI events and tests, verify with Node and browser checks, and document restart and recovery steps.
Lifestyle
Usage and efficiency: reducing rework
Record task conditions, model options, time and outcomes to reduce unnecessary retries and excess context.
Articles that cite this one
Latest travel guides

GuideTokyo
Where to Stay in Tokyo: Comparing Shinjuku, Ueno, Tokyo Station, Shibuya, Asakusa, Ikebukuro, and Ginza, Plus Airport Access, Accommodation Tax, and Luggage Delivery
Where should you stay in Tokyo? Compare Shinjuku, Ueno, Tokyo Station, Shibuya, Asakusa, Ikebukuro, and Ginza by the same criteria: access from Narita and Haneda, transit routes, nearby attractions, neighborhood character, and who each area suits. Includes a comparison table, a Yamanote Line diagram, Tokyo’s accommodation tax as verified in 2026/9 (changing to 3% in 2027/4), and Airport TA-Q-BIN luggage shipping rules.
- Budget
- Hotels

GuideTokyo
How to Choose Tokyo Transit Passes: Are Suica, Welcome Suica, the Tokyo Subway Ticket, and the JR Pass Worth It?
On a first Tokyo trip, start with an IC card and pay per ride (Welcome Suica has no deposit and is valid for 28 days). If you take four or more subway rides in a day, add a 72-hour Tokyo Subway Ticket for 2,000 yen; a JR Pass is never worthwhile if you stay in Tokyo and do not go to Kansai. See what TOURIST PASMO, Suica on iPhone, and the Tokyo Metro day pass do and do not cover, with a decision chart. Prices verified in September 2026.
- Transport
- Budget

GuideTokyo
Tokyo Disneyland and DisneySea Guide: Ticket Prices, Fantasy Springs, Disney Premier Access (DPA), Standby Pass, and Which Park to Choose for Your First Visit
Tokyo Disney one-day Passport prices vary: most weekdays in 9/2026 cost ¥9,900 and weekends ¥10,900. At 14:00 daily, tickets go on sale for the same date two months later. Free Priority Pass is no longer on the official service list; only paid Disney Premier Access (¥1,000–3,500 per person per use) shortens waits. Covers hours, the 25th anniversary, Standby Pass, Entry Request, Fantasy Springs access and first-visit park choice; checked on the official site in 9/2026.
- Itineraries
- Family
Sources
- Git merge and abort · Checked:
- Git worktree · Checked:
- Codex worktrees · Checked: