ArticleGeneral

My favorite Claude Code trick for fixed income

By Felipe SinisterraJune 30, 20266 min read
My favorite Claude Code trick for fixed income

Most credit investors I know still do this by hand when you can leverage AI for this.

They read the rating-agency headlines, eyeball a screen, and wait for the month-end index rebalance to print before they react.

I get it.

The data lives in five places and the rules are fiddly.

But that habit leaves one of the better edges in fixed income sitting on the table. Forced flows.

Here is the idea in one line: A bond’s price comes down to who has to buy it and who has to sell it. The biggest forced traders in the market are index funds.

You already trade a version of this in equities. A stock joins the S&P 500, index funds have no choice, and the price usually moves before they finish buying.

Credit works the same way. The difference is timing. The S&P reshuffles a handful of names a few times a year. Corporate bond indexes reset on the last day of every single month, so this trade comes around twelve times a year, not three or four.

For this week, we will focus on credit which has several triggers for forced flows.

The credit investors I work with kept asking for the bond version of how I run my forced flows AI technique, so here it is.

Let me show you how I get Claude Code to find the next round of forced buyers and sellers in credit, before the rebalance hits.

The logic is three steps.

  • Pull what is actually in the indexes right now.
  • Find who is crossing the investment-grade line.
  • Then rank the forced flows by size and timing.

And I run all three with one Claude Code prompt.


The Prompt

I used Claude Code (you can also use Codex) because this needs an agent that can do real work. It writes its own code to download the holdings, runs the searches itself, and stitches everything together. Which is not possible on web frontend AI due to context window limitations.

Check out the prompt here to try for yourself: Forced-Flow-Screen-Prompt.pdf

A few lines in there are doing the heavy lifting (if you care to learn the logic behind the prompt).

The average-of-three rule is the whole thing. One agency does not move the index. React to a single Moody's headline and you get names that are not really crossing. Checking the average kills the false positives.

The order matters too. It pulls the holdings first, then the events, then checks each event back against the holdings. A real fallen angel is still sitting in the IG fund. A real new issue is not in there yet. Membership is the proof the flow is coming. I name the files on purpose too, since the iShares ones block bots.

The step I care about most is the prediction. Finding names on the line is easy. The edge is guessing which one tips. So the agent digs up each agency's own published downgrade triggers and scores the issuer against them. A name failing the swing agency's stated test is a different animal from one that is comfortably improving.


The Output

Full output here: https://fasinisterra.github.io/forced-flow-screen/

Claude Code chewed through the investment-grade and high-yield universe and handed me back a clean, ranked board. It flagged 31 candidates, narrowed them to 2 confirmed forced flows and 12 on watch, and threw out 17 that did not hold up under a closer look.

Both confirmed names were new-issue inclusions, and both were buy pressure.

SPCX (SpaceX) just priced a $25B investment-grade debut, one of the largest first-time deals on record. At month-end, every IG index fund has to add it.

Hundreds of billions of dollars track the IG index complex, so a name that size joining is real, mechanical demand.

$NVDA priced $25B of its own a week earlier. Same mechanic, same forced buying.

The backward check sold me. Both deals already sit in the index tracking files, right where the rules say. So the screen was reading the mechanic correctly, not guessing.

The name I actually got excited about was on the watch list, not the confirmed one.

$F (Ford). Moody’s already has Ford in junk at Ba1, though with a stable outlook. S&P and Fitch still hold it at BBB-, the bottom rung of investment grade. The index reads the average, so Ford is still IG by one agency.

A basic screen stops there and tells you Ford is on the line. The useful question is which holdout actually cuts, and how likely it is. So I had it reverse-engineer the agencies.

TLDR - We had AI try to predict ratings downgrade by reverse-engineering agency methodology:

S&P is the swing vote. It is the only holdout with a negative outlook, and its downgrade trigger is public and specific. S&P wants an automotive margin near 8%. Ford’s 2025 margin came in around 3.6%, and Ford just pushed its own 8% target out to 2029.

That is what makes it more than a screen. It found which agency moves next, the test that agency uses, and where Ford stands against it. Elevated odds over the next year, not a sure thing.

And if it tips, the flow is large. Ford is about 0.6% of the IG index. IG funds dump it, high-yield funds swallow it, and that handoff is the dislocation you want flagged months early.

On a credit desk, this kind of monitor usually lives as a standing data feed off a terminal. Here, Claude Code downloaded two holdings files, cross-referenced ninety days of rating actions, checked SEC filings for new deals, and ranked everything. One prompt, one afternoon.

One honest caveat on the above: This version leans on public files, so treat the sizes as rough estimates. Point the same prompt at real bond data through an MCP server. That is the version I would run on a desk.

If you're a public fixed income investor, try this out.

Happy hunting.

-Felipe


A Live Event - With Me!

P.S. Everything you just read, the screen, the prompt, the diagrams, came out of Claude Code.

If you want to master Claude Code for Investing, I'm hosting a live bootcamp just for that.

Five days, two hours per day.

July 13 to 17, 7pm London and 2pm New York.

You are not just watching me build, but I'm also live the whole time answering every question to make this as interactive as possible.

Last cohort ran 200+ PMs and analysts from funds like Morgan Stanley Investment Management, AllianceBernstein, Fidelity, and more.

The early-bird seats open to the newsletter before anyone else, $497 before they move to $997. We keep them capped for one reason: so every question still gets a real answer.

Hit the reply button if you have any questions - I'll see you soon :)

Enjoyed this article?

Get more AI for finance content delivered to your inbox.