<?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: Ahmed Allam</title>
    <description>The latest articles on DEV Community by Ahmed Allam (@ahmedallam222).</description>
    <link>https://dev.to/ahmedallam222</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F826825%2F4051ae99-6a02-457f-9339-2757d3597921.png</url>
      <title>DEV Community: Ahmed Allam</title>
      <link>https://dev.to/ahmedallam222</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmedallam222"/>
    <language>en</language>
    <item>
      <title>GhostTrace: Capture "Phantom Branches" to Debug Rejected Decisions in AI Agents</title>
      <dc:creator>Ahmed Allam</dc:creator>
      <pubDate>Wed, 18 Feb 2026 05:34:23 +0000</pubDate>
      <link>https://dev.to/ahmedallam222/ghosttrace-capture-phantom-branches-to-debug-rejected-decisions-in-ai-agents-2pf</link>
      <guid>https://dev.to/ahmedallam222/ghosttrace-capture-phantom-branches-to-debug-rejected-decisions-in-ai-agents-2pf</guid>
      <description>&lt;p&gt;When an AI agent makes a decision, it evaluates several options and picks one. The rest disappear forever — you never see what it almost did or why it rejected the alternatives.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;GhostTrace&lt;/strong&gt; to fix that.&lt;/p&gt;

&lt;p&gt;It captures &lt;strong&gt;"Phantom Branches"&lt;/strong&gt;: the actions your agent considered but rejected, with the full reasoning for each rejection. Everything is saved to a &lt;code&gt;.ghost.json&lt;/code&gt; file that you can replay and inspect anytime.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quick Demo
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ghosttrace record
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✓ Recorded 4 decisions with 5 phantom branches
📄 Saved to gt_a1b2c3d4.ghost.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ghosttrace replay gt_ghost.json &lt;span class="nt"&gt;--show-phantoms&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Step 1: ✓ read_file → src/auth.py
👻 REJECTED: write_file (premature)
👻 REJECTED: search_codebase (too broad)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Super simple to get started:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;ghosttrace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/AhmedAllam0/ghosttrace" rel="noopener noreferrer"&gt;https://github.com/AhmedAllam0/ghosttrace&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org/project/ghosttrace/" rel="noopener noreferrer"&gt;https://pypi.org/project/ghosttrace/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's framework-agnostic for now, but &lt;strong&gt;what should I integrate first?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
LangChain? CrewAI? OpenAI Agents SDK?  &lt;/p&gt;

&lt;p&gt;Feedback very welcome — let me know what you think, if you'll try it, or what features you'd love to see! 🔥&lt;/p&gt;

&lt;h1&gt;
  
  
  ai #agents #python #opensource #machinelearning #debugging #llm
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;



![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nvd4317vowb62srn3hqx.png)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>cli</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
