Skip to content

Context in practice For engineers

How to switch coding assistants midway through a task

Give the new assistant the branch and full commit ID, the state of the unfinished changes, one source for the accepted decision, and the last check you actually ran. Ask it to inspect the checkout and read the decision before editing. Pause if the checkout differs or the decision no longer applies.

Record the checkout before you switch

Pause edits in the first assistant. Write down the repository, branch and full commit ID, then list the staged, unstaged and untracked files that belong to this task. Note unrelated changes the new assistant should leave alone. The commit ID identifies committed history. Two checkouts can share that ID and contain different unfinished work.

Open the same working tree in the receiving assistant when it can use that directory. If it starts in a separate clone or worktree, confirm that you can transfer the unfinished changes by an approved route. Share only the files and decision references the receiving tool is permitted to read.

Give the next assistant a handoff it can check

Start with the job and the decision that constrains it. Link to the original decision at a version the receiver can open. If the repo holds that record and the current diff, those references can carry most of the handoff. Include the date and result of the last observed check and name any work added afterward.

This fictional example switches assistants halfway through adding an environment filter to a deployment list. The second assistant needs the new filter and the old behavior for saved links. Replace the example paths, commit and check output with your own.

Task: finish the deployment list's environment filter.
Repo: release-board, use the existing working tree
Branch: feature/environment-filter
HEAD: 92f3d11c1a7edeb29300bdd076b284df5c5aaab4

Accepted decision: saved links without an environment
parameter still show deployments from every environment.
Source: docs/decisions/ADR-016.md, accepted 2026-10-21.
Scope: the deployment list URL.

Staged: app/deployments/query.py, filter query only.
Unstaged: none for this task.
Untracked: tests/test_environment_filter.py, draft tests.
Historical check: 2026-11-10, exit 0, 4 tests passed
for tests/test_deployments.py, before the draft tests.
Pending: verify filtering and a saved URL with no parameter.

First: inspect the checkout and ADR-016 without edits.
Reply with the governing rule, mismatches, and next check.

Inspect the files before the first edit

From the repository root, compare the reported branch, HEAD and file states with the handoff. Use the path-scoped diff commands with your own tracked files. The first diff shows staged changes and the second shows unstaged changes. Read a listed untracked file directly to inspect its contents.

In the deployment example, a clean checkout at the recorded commit is missing the staged query and the draft tests. Ask the original owner to provide the missing work through an approved route. Leave the checkout alone while you establish which changes to carry forward.

Read the decision and any accepted successor. If a draft ticket says to default to production, confirm which rule governs with the decision owner before editing the filter. A newer proposal alone leaves the earlier accepted rule in effect in an ADR process that requires accepted successors.

git --no-optional-locks status --short --branch --untracked-files=all
git rev-parse --verify HEAD
git --no-pager diff --no-ext-diff --no-textconv --cached -- app/deployments/query.py
git --no-pager diff --no-ext-diff --no-textconv -- app/deployments/query.py

Continue from evidence in the receiving checkout

Once the checkout and decision match, run the relevant checks on the state you are about to change. Keep the previous result with its date and scope. The four historical passes in the example leave the draft filter cases unverified.

For this task, verify that a URL with an environment shows only that environment and that a saved URL without the parameter still shows all environments. The first response from the new assistant should name both cases and explain whether the current files contain tests for them. Update the handoff with the checks actually run so it can support the next switch.

Sources and further reading

Prepared with AI assistance and reviewed for source fidelity and practical usefulness. Examples marked fictional are illustrations, not customer results.

PUT THE CONTEXT TO WORK

Try it on one feature.

Connect one supported source and inspect the context Shifu brings back. Start with a task you understand well enough to check.

Build with Shifu

Keep reading