Same Git Commit, Different Contexts: Why Two Coding Agents Diverge
You are on the same repository, on the same Git commit, with a clean working tree. Yet when you start a task with one coding agent in the morning and switch to another in the afternoonβor when two teammates open the same
You are on the same repository, on the same Git commit, with a clean working tree. Yet when you start a task with one coding agent in the morning and switch to another in the afternoonβor when two teammates open the same branch in different toolsβthe two sessions can still begin with different premises.
The split usually happens outside Git's boundary, where tools differ on instruction discovery, user-level config, and global memory. A four-line directory tree illustrates one common mismatch:
workspace/
βββ AGENTS.md # Parent instruction file outside the repo: some agents walk up to it
βββ service-a/ # Git root (.git/ lives here)
βββ AGENTS.md # Repo instruction file: agents bounded by the Git root stop project lookup here
In this layout, Codex scopes project-level upward discovery at the Git root (while separately loading global guidance and files along the launch path according to configuration). By contrast, official docs show Claude Code loading CLAUDE.md from the working directory and parent directories (and AGENTS.md depending on version and settings), OpenCode walking AGENTS.md from a workspace inside $HOME up toward the home directory, and Gemini CLI scanning workspace and parent directories for GEMINI.md or configured filenames. The AGENTS.md in the tree above illustrates directory boundaries; each tool checks different filenames and precedence rules, so whether it loads that specific file depends on its version and configurationβyet mixing tools on one repo can still split the starting context.
That tension motivated Shiftgate v0.2.0: multi-agent workflows want both cross-session continuity and cross-project isolation. If automatic memory is reused across projects, it can carry old context into a new task, depending on its implementation and configuration. Shiftgate is not a memory store and does not wrap your agentsβit focuses on auditing where instructions and config come from, and leaving disk-recoverable state for the next session.
A Captured Case: AGENTS.md Above the Repo
The public Shiftgate v0.2.0 README records one captured shiftgate doctor run (with local paths replaced):
shiftgate doctor v0.2.0
Target: /path/to/repo (repo root: /path/to/repo)
[PASS] SG-DOC-01 L0 global instructions
[PASS] SG-DOC-02 Global skills hygiene
[WARN] SG-DOC-03 Parent-directory bubbling & entry conflicts (1 finding)
- [WARN] parent-instruction-bubbling: /path/to/AGENTS.md
Hint: Move parent workspace control files to a sibling directory so child repos have no ancestor AGENTS.md/CLAUDE.md.
[PASS] SG-DOC-04 Black-box global memory & Layer-2 gitignore
[PASS] SG-DOC-05 Code-layer runtime boundaries
[PASS] SG-DOC-06 Handoff & summary context budgets
Summary: 0 FAIL, 1 WARN, 5 PASS, 0 SKIP (exit 0)
doctor flagged /path/to/AGENTS.md above the repository root. After moving that file away and rerunning, the warning cleared (0 FAIL, 0 WARN, 6 PASS).
This single capture proves something narrow: doctor can pinpoint an ancestor instruction file outside the Git root and confirm on a rerun that the warning clears once the layout changes. It is one concrete case, not evidence of how prevalent parent-directory bubbling is across teams.
If a team intentionally shares parent-directory instructions, an SG-DOC-03 warning is not automatically a bug. Check whether the parent file is meant to govern every child repo underneath, and whether every agent on the team actually reads above the Git root.
What doctor Checksβand Its Limits
doctor looks for specific indicators across six rule groups rather than claiming to detect every form of contamination:
-
Context leakage and entry conflicts: signs of global instruction contamination (
SG-DOC-01), duplicated global skills, broken symlinks, or repo-skill leakage (SG-DOC-02), parent-directory bubbling and dual-entry conflicts such as substantiveAGENTS.mdplusCLAUDE.md(SG-DOC-03), and global memory writer patterns (SG-DOC-04). -
Workspace and runtime pollution: missing or incomplete global Git ignore baselines (
SG-DOC-04), and mixed runtime signals such as mixed lockfiles or strayBun.*andDeno.*APIs (SG-DOC-05). -
File size budgets: whether entry, handoff, and summary files exceed configured size budgets (
SG-DOC-06).
By default, doctor checks the current repository and relevant host configuration under your home directory. Passing --no-host skips host-side rules (SG-DOC-01, 02, 04) when you only want repository checks, such as in CI.
doctor itself is strictly read-onlyβit writes no project files and edits no configuration. On first use, npx may write the downloaded package into your local npm cache. Shiftgate requires Node.js 24 or newer and has zero third-party runtime dependencies.
Optional Handoff for Mid-Task Switches
You can use doctor on its own without adopting handoff files. For switching agents mid-task without pasting chat logs or repeating investigation, Shiftgate provides an optional disk-based handoff flow.
Suppose you spend the morning using one agent to refactor request validation in an API service, then pause before finishing edge-case tests to switch to another agent in the afternoon. Preview changes first with init --dry-run, then run init to write a minimal HANDOFF.md at the repo root and append a handoff section to AGENTS.md. Before pausing, record four essentials in HANDOFF.md: where work paused, what was verified, the next step, and acceptance criteria, along with recovery commands.
Before handing off, check runs read-only checks on document structure and repo-verifiable factsβrequired fields, timestamps, high-confidence secret patterns, whether relative paths referenced in recovery-section code blocks exist, and working-tree changes under PAUSED or COMPLETE (failing if other files are dirty, and warning if only HANDOFF.md is uncommitted, which exits non-zero only under --strict). When the next session starts fresh, coldread generates a reading prompt telling the incoming agent to read the on-disk files in order and cite file:line evidence.
Keep the limits explicit: check inspects the text of last_verified_command without executing it, and coldread scoring checks answer form only. When a document claims tests passed, actual test output remains the evidence.
Help Test v0.2.0 and Shape v0.2.1
If you have used at least two coding agents in the same repository and have Node.js 24+, try a read-only check from your repository root:
npx --yes [email protected] doctor
We are collecting real-world first-run resultsβzero findings, failed runs (including Node or environment issues), and reported findings are all welcome. For findings, include the rule ID and label each as a real issue, reasonable exception, or cannot tell. Reply in the comments, post in the GitHub Discussion, or open an item on GitHub Issues using this template:
Agents: e.g. Claude Code + Codex
First run: zero findings / failed to run / SG-DOC-XX (real issue | reasonable exception | cannot tell)
Notes (optional): false positives, missed cases, or agent config paths to support
Please keep local paths, repository contents, full logs, and secrets on your own machineβshare only the redacted summary. Your feedback will directly help set priorities for Shiftgate v0.2.1.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.