Show HN: GhostTrace – See rejected decisions in AI agents
1 points
2 hours ago
| 1 comment
| github.com
| HN
Hey HN,

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.

I built GhostTrace to fix that. It captures "Phantom Branches": the actions your agent considered but rejected, with the reasoning for each rejection. All saved to a .ghost.json file you can replay and inspect.

Quick demo:

ghosttrace record Recorded 4 decisions with 5 phantom branches Saved to gt_a1b2c3d4.ghost.json

ghosttrace replay gt_ghost.json --show-phantoms

Step 1: read_file → src/auth.py REJECTED: write_file (premature) REJECTED: search_codebase (too broad)

pip install ghosttrace

PyPI: https://pypi.org/project/ghosttrace/

It's framework-agnostic for now, but what agent frameworks should I integrate first? LangChain? CrewAI? OpenAI Agents SDK?

Feedback very welcome!

umairnadeem123
1 hour ago
[-]
this is useful. rejected branches are usually where latency and token burn hide. would love a small cost timeline per rejected decision too, that makes tuning loops way faster.
reply
AhmedAllam0
1 hour ago
[-]
Great point,this is exactly the kind of signal I hadn't thought to surface explicitly

Right now GhostTrace logs reasoning per rejection, but not token cost or latency per branch

Adding a cost timeline (tokens + ms per phantom) is going on the roadmap.

It would make the .ghost.json file genuinely useful for optimization, not just debugging.

reply