<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahmoud Rabea</title>
    <description>The latest articles on DEV Community by Mahmoud Rabea (@mhrabea).</description>
    <link>https://dev.to/mhrabea</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4266785%2F18c9df35-4af7-41d6-bf31-3a25834ea06a.jpg</url>
      <title>DEV Community: Mahmoud Rabea</title>
      <link>https://dev.to/mhrabea</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mhrabea"/>
    <language>en</language>
    <item>
      <title>How I keep context when switching between Claude Code, Codex and DeepSeek</title>
      <dc:creator>Mahmoud Rabea</dc:creator>
      <pubDate>Thu, 26 Nov 2026 11:57:18 +0000</pubDate>
      <link>https://dev.to/mhrabea/how-i-keep-context-when-switching-between-claude-code-codex-and-deepseek-112</link>
      <guid>https://dev.to/mhrabea/how-i-keep-context-when-switching-between-claude-code-codex-and-deepseek-112</guid>
      <description>&lt;p&gt;Every AI coding session I run ends in one of three ways: the usage limit hits, the session crashes, or I want to try the same task in another agent. All three lose the same thing: the agent's understanding of what's done, what's next, and what must not be touched.&lt;/p&gt;

&lt;p&gt;So the next session starts with me re-explaining the project. Or worse, with "continue where you left off" pointing at code that changed an hour ago.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://github.com/MHRabea/tagteam" rel="noopener noreferrer"&gt;tagteam&lt;/a&gt; to make that handoff explicit, structured and checked against git. Here's the workflow, and the three design decisions that made it reliable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffpcgj02nkypnonop20pz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffpcgj02nkypnonop20pz.gif" alt="tagteam demo" width="759" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The workflow in 30 seconds
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i -g tagteam-ai
tagteam profile add claude      &lt;span class="c"&gt;# Claude Code with your normal login&lt;/span&gt;
tagteam profile add deepseek    &lt;span class="c"&gt;# Claude Code on DeepSeek's API&lt;/span&gt;
tagteam chain claude,deepseek
tagteam                          &lt;span class="c"&gt;# instead of `claude`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude Code starts with the saved context. When it exits (for any reason), tagteam makes sure a handoff exists and asks: &lt;code&gt;Continue with "deepseek"? [Enter]&lt;/code&gt;. Press Enter and the next agent starts with the task, the completed steps, the exact next action and your constraints.&lt;/p&gt;

&lt;p&gt;It works with Claude Code (your login, or any Anthropic-compatible API), Codex (your login, or any Responses API), any other command, and as an MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decision 1: a handoff is data, not prose
&lt;/h2&gt;

&lt;p&gt;Most "memory" tools store a summary paragraph. A paragraph is easy to write and hard to act on. A tagteam handoff is a small JSON document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;task&lt;/code&gt;: title, goal, acceptance criteria&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;completed&lt;/code&gt; and &lt;code&gt;in_progress&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;next_action&lt;/code&gt;: &lt;strong&gt;one&lt;/strong&gt; concrete step a new agent can start without reading the transcript&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;known_issues&lt;/code&gt;, &lt;code&gt;tests&lt;/code&gt; (command and pass/fail)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;decisions&lt;/code&gt; and &lt;code&gt;constraints&lt;/code&gt;, which outlive the handoff&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The single &lt;code&gt;next_action&lt;/code&gt; matters most. "Continue the billing work" makes the next agent explore; "add the retry wrapper around &lt;code&gt;gateway.charge()&lt;/code&gt; in &lt;code&gt;renew()&lt;/code&gt; in &lt;code&gt;src/billing.js&lt;/code&gt;" makes it work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decision 2: trust, but verify against git
&lt;/h2&gt;

&lt;p&gt;Every handoff records the branch, HEAD, the uncommitted files and a hash of the diff. When the next session starts, tagteam compares that with the repo and puts a warning at the top of the context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## ⚠ Drift since handoff — verify before trusting it
- 2 new commit(s) since the handoff, touching 3 file(s): src/billing.js, ...
- Uncommitted changes differ from the handoff. Newly modified: src/gateway.js.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Constraints can be bound to paths:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tagteam constraint &lt;span class="s2"&gt;"Do not change the payment gateway interface"&lt;/span&gt; --paths &lt;span class="s2"&gt;"src/payments/gateway.*"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every agent sees the rule at session start, and &lt;code&gt;tagteam status&lt;/code&gt; exits with code 2 when your diff touches a protected path, so the same rule works as a pre-commit hook or a CI step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decision 3: a handoff even when the agent can't write one
&lt;/h2&gt;

&lt;p&gt;The best handoff is written by the agent itself (Claude Code gets a &lt;code&gt;/handoff&lt;/code&gt; command and every agent gets an MCP &lt;code&gt;save_handoff&lt;/code&gt; tool). But the moment you most need a handoff is when the agent stopped unexpectedly, and then it can't write anything.&lt;/p&gt;

&lt;p&gt;So when an agent exits without saving one, tagteam asks a cheap model from one of your other profiles to write it from the transcript and the diff. A summarizer call on Claude Haiku costs about $0.0004 in my tests. If that provider is down, it tries the next one. If every provider fails, it still saves the git state and your last messages.&lt;/p&gt;

&lt;p&gt;Everything sent to a summarizer is redacted first: API keys, tokens, passwords in URLs, &lt;code&gt;KEY=value&lt;/code&gt; secrets, private keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  What testing taught me
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fake agents beat mocks.&lt;/strong&gt; The run loop is tested against fake &lt;code&gt;claude&lt;/code&gt; and &lt;code&gt;codex&lt;/code&gt; binaries that run the real hooks and talk to the real MCP server. That caught bugs no unit test would.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A redaction corpus finds real leaks.&lt;/strong&gt; I collected about 30 real-world secret formats. The first run caught 13 that my patterns missed, including the key formats of two providers I use every day.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Record your own demo.&lt;/strong&gt; Recording the GIF exposed a summarizer that saved one of its own instructions as a permanent project constraint. That's fixed in 0.1.3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ship with provenance.&lt;/strong&gt; Releases go from a git tag to npm through GitHub Actions trusted publishing: no npm token anywhere, and every version is signed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Automatic switching when an agent hits its limit, a VS Code status bar, cost per task, and shared team handoffs.&lt;/p&gt;

&lt;p&gt;tagteam is Apache-2.0: &lt;a href="https://github.com/MHRabea/tagteam" rel="noopener noreferrer"&gt;github.com/MHRabea/tagteam&lt;/a&gt;. If you switch between AI coding agents, I'd love to hear what your handoff needs to contain.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>node</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
