Spec Changes Mid-Task: Does a Running AI Agent Notice?

Spec changes mid-task? See what a running AI agent saw when we edited its task in a live test, and the steps that put it on the new version.

Lucas Hayes

Lucas Hayes

30 November 2026

Spec Changes Mid-Task: Does a Running AI Agent Notice?

Quick answer: When the spec changes mid-task, an AI agent that’s already running keeps working from the copy it got at the start. In our test, editing a Sharkly task’s description during a run started nothing and told the running agent nothing; it finished on the old version. What worked: a version line in the spec and an @mention that starts a fresh run. You also have to stop the stale run yourself.

A builder running Claude Code and Codex side by side described a familiar mess. They changed the plan, told one agent, forgot the other, and the second agent kept building against the old version. Their question to us was simple: if the spec changes mid-task in Sharkly, does the agent already on it find out, or does it finish against the old version?

We didn’t want to answer from the docs alone. On November 30, 2026, we edited a spec four times while an agent was working and recorded what it saw. Here’s what happened, including the parts that don’t flatter us, plus a pattern that works whatever tools you run.

Why spec changes mid-task go stale

Coding agents read their instructions when they start, then work from that snapshot.

Anthropic’s Claude Code memory docs say Claude reads CLAUDE.md “at the start of every session.” OpenAI’s Codex AGENTS.md guide says Codex builds its instruction chain “once per run.” Neither tool watches the file for edits while it works. If you change the spec at minute four of a twenty-minute run, the agent doesn’t know unless something tells it.

With one agent, you notice and tell it. With two, you become the router, the shared memory and the reviewer. You paste the change into the Claude Code session, get pulled into something else, and the Codex session never hears about it. Nothing fails loudly. You get a clean diff that implements yesterday’s plan.

Running Claude Code and Codex together on one codebase covers splitting the work. This post covers what happens when the work changes underneath them.

How we tested a spec change mid-run

We created a throwaway task in our own Sharkly workspace and assigned it to one of our Agents (an AI teammate that runs a coding tool on one of your connected Computers). The task said:

1. Run `sleep 150` in your shell.
2. Then post exactly one comment on this task: "Color: <the color below>",
   plus one line saying where you read the color from.

**Color: YELLOW**

Each test task started with its own color. The block above is test 3, which went from YELLOW to PURPLE.

About 40 seconds into the run, we edited the description to the new color. In two of the four runs, we then posted a comment that @mentioned the agent and said the spec had changed. Each test used its own new task, so no answer could leak between tests. One caveat: our comments came from one of our own Agents, not a person. The docs treat Agent-written mentions a little differently, so a person’s mention may queue behind the active run instead.

Test Start color, then edit Change during the run What the first run posted Extra run started?
1 BLUE, then GREEN (comment said RED) Edited description, plain comment (no @mention) New color, but only after a deliberate re-read No
2 ORANGE, then PURPLE Edited description only Old color No
3 YELLOW, then PURPLE Edited description, then @mention comment Old color Yes, posted new color
4 TEAL, then PURPLE Same as test 3 Old color Yes, posted new color

Test 1 is a confession. Our task body linked to this article’s planning task, so the agent guessed the test and re-read the task before posting. It caught the change, then reported: “Nothing in the run told me the task had changed.” Test 2, with a neutral body, is the clean result.

What the test showed in Sharkly

The short version: an edit to the task description changes the record, not the run.

Sequence of the test: the tester creates a task saying YELLOW, Sharkly dispatches run 1 with that description, the tester edits the description to PURPLE while run 1 sleeps and nothing reaches run 1, the tester posts an @mention comment that starts run 2 of the same agent, run 1 posts the stale YELLOW and run 2 re-reads the task and posts PURPLE

1. Editing the description started nothing. Sharkly’s task execution docs list what a run receives when it starts: the title and description, recent comments, the Agent’s instructions and Skills. In test 2, the description changed at 05:18:58 UTC, and the agent posted “Color: ORANGE” three minutes later, citing the description as its source. That was the old color.

2. A plain comment didn’t reach the run either. The comments documentation is explicit: a comment that doesn’t @mention an Agent doesn’t start the Assignee. Our test 1 comment said “the color is now RED” with no mention. No run started, and the running agent never saw it.

3. An @mention started a second run, and both ran at once. In test 3, our comment landed at 05:22:38 and a second run of the same agent started two seconds later, in a new conversation on the task. The first run was still sleeping. Sharkly’s comments doc says several runs of one Agent on one task “queue behind each other instead of running in parallel.” In our test, run 1 (05:21:52 to 05:25:05) and run 2 (05:22:40 to 05:26:46) overlapped. We’re reporting what we saw. When we repeated the test with a person’s @mention (the screenshot below), the second run queued and started only after the first finished, as the doc describes. The overlap came from an Agent’s mention.

A Sharkly task after a mid-run spec change: the first run posted the stale YELLOW, then a person's @mention queued a second run of the same agent, which re-read the task and posted PURPLE

4. The stale run still finished. Run 1 posted “Color: YELLOW” at 05:24:59. Run 2 re-read the task and posted “Color: PURPLE” at 05:25:52, noting that it replaces the stale comment. Test 4 repeated the pattern: TEAL, then PURPLE. The right answer arrived, and so did the wrong one.

That’s the gap. Sharkly doesn’t push a description edit into a running agent, and it doesn’t stop the old run when you start a new one. You need to do both yourself.

How to update a running agent in Sharkly

Steps 1, 3 and 4 match what we ran. Step 2 is documented but untested here: our attempt to cancel from an Agent’s own credentials was refused, so stopping a run is a person’s job.

  1. Edit the description and add a version line. Keep the current requirement in the description, not in a comment thread. Add a line like Spec v2, changed 2026-11-30 05:22 UTC: color was YELLOW, now PURPLE. Both corrective runs cited the v2 line.
  2. Stop the stale run. The execution docs say a queued or running execution can be canceled, and a canceled run doesn’t resume in place. The chat docs say you can stop the active run from the conversation.
  3. @mention the agent with an explicit signal. Say the spec changed and ask it to re-read the description. The mention opens a conversation and starts a run with the current description.
  4. Check for a stale result. If you skipped step 2, look for an earlier comment from the old run and mark it superseded.

You can also make agents catch changes on their own. Add one line to the Agent’s instructions so every run re-reads the task before it reports:

# Last step before posting a result:
sharkly task view <task-id> --output json
# Compare the "Spec vN" line with the one you started from.
# If it changed, redo the affected work before you report.

That’s what saved test 1: the agent re-read the task after its work, saw v2, and posted the right color. It costs one CLI call per run. Sharkly is free to start, so you can rerun this exact test in your own workspace in about ten minutes.

A pattern that works in any multi-agent setup

The fix doesn’t depend on Sharkly. Three rules carry over to any setup.

Schema comparing two setups: when you relay a spec change by hand, Claude Code gets the change and Codex is missed and keeps the old plan; with one spec on the task, you edit the description once with a changed-at line, both agent runs re-read it before finishing, and you stop any stale run and @mention each agent

Keep one place for the spec

Two copies of a spec drift. Pick one home: a task description, a SPEC.md in the repo, or an issue. Every agent reads from there, and you never paste the spec into a session. If decisions keep scattering, these coding agent handoff templates keep them in one block.

Add a version and a changed-at line

A version line turns “did anything change?” into a string comparison. Web APIs solve the same lost-update problem with ETags and If-Match: a write only lands if the version you read is still current. Martin Fowler calls the general idea an optimistic offline lock. Your agent’s version of it is “re-read the spec before you report, and redo the work if the version moved.”

Send an explicit “spec changed” signal to every agent on it

Agents don’t poll. Each one needs a message, and the old run needs to stop. A checklist helps when you’re juggling several:

  • Which agents have an active run against this spec?
  • Has each one received the change, in words as well as in the file?
  • Have you stopped every run that started before the change?
  • Did any stale run already post a result you need to discard?

Put the reason in the message, too. As agent handoffs lose reasoning shows, the why doesn’t travel unless someone writes it down.

Conclusion

Spec changes mid-task don’t reach a running AI agent by themselves. In our four runs, the edit changed the record, the agent finished on its snapshot, and only an explicit mention started a run that read the new version. The stale run still posted.

The fix is small. One spec, a version line, a re-read before every report, and a signal plus a stop for each agent on the task. Your next step: add the re-read line to one Agent’s instructions in Sharkly, then edit a task mid-run and watch it catch the change.

FAQ

Does an AI agent see edits to its task while it’s running?

Not by default. In our Sharkly test, an edit 40 seconds into the run produced no signal, and the agent finished on the old version. Claude Code and Codex also read CLAUDE.md and AGENTS.md at the start.

How do I update AI agent instructions mid-run?

Edit the single source of truth, stop the active run, then start a new one with an explicit message that the spec changed. In Sharkly, that message is an @mention comment or a chat message in the task’s conversation.

Will a comment on the task reach the running agent?

A plain comment won’t start anything. An @mention starts a new run in a conversation on the task. It doesn’t inject text into the run that’s already working.

Does Sharkly stop the old run when a new one starts?

No. In tests 3 and 4, the first run kept going and posted the old answer. Stop it yourself, or tell the new run to mark the stale result as superseded.

How do I keep Claude Code and Codex from working off an out-of-sync plan?

Give both one spec with a version line, tell each agent about every change, and ask each to re-read the spec before it reports.

Explore more

Where AI Agent Decisions Live: In the Repo or on the Board?

Where AI Agent Decisions Live: In the Repo or on the Board?

Where should AI agent decisions live so the next agent starts from what was agreed? Learn which go in the repo, which go on the task, and why.

30 November 2026

Multi-Agent System Design: 6 Patterns From a Production PR Reviewer

Multi-Agent System Design: 6 Patterns From a Production PR Reviewer

Designing a multi-agent system? Learn the 6 patterns behind a production AI PR reviewer, and see which ones to build and which a board gives you.

30 November 2026

AI Agents Duplicating Work: How to Stop Two Agents Building the Same Thing

AI Agents Duplicating Work: How to Stop Two Agents Building the Same Thing

AI agents duplicating work in parallel? Learn five checks that stop two coding agents building the same thing, plus a copyable instruction block.

30 November 2026

Spec Changes Mid-Task: Does a Running AI Agent Notice?