> ## Content Index
> Fetch the complete content index at: https://www.npiedy.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Pitchside: Cricket Analytics You Can Ask your AI About
- URL: https://www.npiedy.com/pitchside-cricket-analytics-you-can-ask-your-ai-about/
- Published: 2026-10-30T05:19:41.000Z
- Updated: 2026-10-30T05:19:41.000Z
- Description: Pitchside is a local tool that turns ball-by-ball IPL data into net stats, runs added and win probability, then lets your AI answer questions about it. Here is what it does, how the numbers work, and what I built it to find.
- Author: Naveen Piedy
- Tags: Cricket, AI, Cricket Analytics, IPL, mcp, Pitchside

I have always been fascinated by how analysts like Jarrod Kimber, Prasanna Agoram and Himanish Ganjoo can break down a game using numbers and statistics. They show me there is more to the game than strike rates, averages and other surface-level stats. Cricket is beyond just pure numbers and stats, I agree. But often we get caught up in the fascination and the passion and don't try to understand what the numbers tell us. For example, we know the famous 2023 IPL final in which Jadeja scored 10 runs off the last 2 balls. But my appreciation for it has grown knowing that Jadeja single-handedly lifted CSK's chances of winning from 6.6% to 100% in two balls.  
  
That kind of analysis is inaccessible even to those who are interested in it. For example, a hundred at Chinnaswamy is not equal to a hundred at Chepauk. How do we compare them? A 150 strike rate in a vacuum looks good in T20, but is it good if everyone else is scoring at an average strike rate of 180? This has been my motivation for building [Pitchside](https://github.com/naveenpiedy/pitchside?ref=npiedy.com), a tool that works on Cricsheet data and makes these stats accessible. You can fire it up, hook it to your flavor of AI and ask questions in plain English, or just use it on its own.

## Explaining how Pitchside works

![](https://storage.ghost.io/c/f7/10/f7101a80-6932-4b03-b4dc-971108e4b353/content/images/2026/10/pitchside_architecture_light.svg)

Architecture Diagram

Cricsheet data is the source, so we have ball-by-ball data. What we don't have is bowling data such as line, length, swing or spin deviation. We get batting hand and bowling style from Wikidata and Wikipedia. All of this feeds into DuckDB, where the baselines and context-aware stats are computed with shrinkage. Each tournament gets its own database. A read-only engine on top serves both the CLI and the MCP server. Each tool wraps a common question, like a leaderboard or a player profile. If you find something that is not there, you can query DuckDB directly.

## Net stats: compared with an average player on the same balls

A net stat is what a player did minus what an average player would have done on the same balls. A raw strike rate ignores the situation: scoring at 150 in over 3 is not the same as scoring at 150 in the 19th over of a chase.

For every ball, Pitchside builds an expected value from:

- the league's scoring for that over in that season (so 2010 and 2026 are each judged against their own era),
- wickets down, and setting or chasing,
- the required rate, in a chase,
- how settled the batter is (balls 1-5, 6-10, 11+),
- the ground.

The adjustments are fitted separately for each rules era (before and after the 2023 Impact Player rule). Add up the expectations over any slice of balls and subtract them from what actually happened.

$$\\text{net SR} = \\text{strike rate} - \\text{expected strike rate}$$

**Example.** Virat Kohli struck at 165.9 in 2026, which looks excellent. But an average batter facing the same balls would have struck at 165.7, so his net SR is +0.15: par. The average tells a different story: 56.3 against 35.4 expected, a net average of +20.9, because he was dismissed far less often than an average batter would be. In 2023 his strike rate of 139.8 was 10.7 below the 150.5 expected for his balls, yet his average was 53.3 against 31.8 expected, a net average of +21.5.  
  
What this tells us that is Kohli has managed to catch up in terms of strike rates without sacrificing his wicket cheaply.

#### Kohli's strike rate caught up to par by 2026, and his net average stayed above +18 every year

Net = actual minus what an average batter would have managed on the same balls. Positive is better. Hover or tab to a bar for the numbers.

Net strike rate (runs per 100 balls)

Net average (runs per dismissal)

Source: Pitchside, IPL 2023–2026 (V Kohli, batting).

**Example, bowling.** Jasprit Bumrah's death-over economy in 2024 was 6.48\. An average bowler on the same balls would have gone for 10.69, so his net economy is +4.2 runs an over, about 71 runs saved. His average of 9.9 against 27.7 expected is a net average of +17.8, and he took 11 wickets where 6.5 were expected. Of bowlers with 60+ death balls that season, that was the best net average (next best: +12.7) and the best net economy (next best: +2.7).

What this means is, Bumrah was giving a boundary less in the death, per over than your average bowler. And his net average was +17.8: about 18 fewer runs given away per wicket than an average bowler. Literal cheat code.

#### Bumrah was the best death bowler of 2024 on both net economy and net average

Each dot is one of 28 bowlers with 60+ balls at the death in IPL 2024\. Further right means fewer runs per over than an average bowler would concede on the same balls. Higher means fewer runs per wicket.

Highlight a bowlerNone

Source: Pitchside, IPL 2024, death overs, bowlers with 60+ balls. Samples are small (60–131 balls), and net average swings hard on one wicket, so read the cluster, not single dots. The grey triangle at the bottom is B Kumar, whose net average of −122 (one wicket) is off the scale.

## Small samples: shrinkage

Shrinkage pulls a player's number towards the average by an amount that depends on how many balls we have seen, because small samples are mostly luck.

$$\\text{shrunk rate} = \\frac{\\text{player's total} + k \\times \\mu}{\\text{player's balls} + k}$$

Here μ is the average under the same filters, and k is the number of balls at which the player's own record and the average count equally. Pitchside estimates k separately for each stat, from player-seasons of 60+ balls. For batting net runs it is 177 balls.

**Example.** In 2026 Urvil Patel scored 129 runs off 64 balls, a strike rate of 201.6 and 62.5 above the 139.1 expected. Sixty-four balls is a short streak, so Pitchside shrinks his net SR from +62.5 to +16.6: still good, but a more cautious read of a short streak. The arithmetic: 40 net runs over 64 balls, divided by 64 + 177 (k) balls instead of 64.

For net stats, shrinkage pulls the difference from expectation towards zero. The expectation itself, which is the player's context, is never shrunk.

Dismissals and wickets are far noisier than runs. For a bowler's wicket rate k is 1,417 balls, and for a batter's dismissal rate it is 2,387\. Over one T20 season, who takes the most wickets is mostly noise.

## Runs added

Runs added is net runs plus a price for every dismissal, measured in runs. Net stats keep scoring and survival apart; runs added puts them in one number.

A dismissal costs the batting side the runs it would otherwise have made, and that cost depends on when it happens: about 10 runs in the powerplay, 7 in the middle overs, 2 at the death. The prices come from a Duckworth-Lewis-style curve of runs still to come, fitted separately for each rules era.

$$\\text{runs added} = \\text{net runs} + \\text{wicket runs}$$

Wicket runs is the wicket cost an average batter would have paid, minus the cost actually paid. For bowlers, their wickets earn the same price.

**Example.** In 2026 Kohli's net runs were +0.6: he scored what an average batter would on his balls. But he was dismissed so rarely that his wicket runs were +66.9, so his runs added are 0.6 + 66.9 = 67.5\. Most of his value that season came from staying in, not from scoring faster. Why that matters: every time a batter is out, his team loses the runs he would still have scored (about 10 in the powerplay, 7 in the middle overs, 2 at the death). An average batter on Kohli's balls would have been out more often, so by staying in he saved his team about 67 runs it would otherwise have lost. Strike rate alone would call him average; runs added puts scoring and survival into one number, in runs, so he can be compared with a fast hitter who gets out cheaply.

This builds on Himanish Ganjoo's "Impact" in his [T20 Metrics primer](https://hganjoo.github.io/t20basics/?ref=npiedy.com), using Pitchside's own expectations (settledness, chase pressure, ground).

## Who wins matches: win probability, WPA and leverage

Net stats measure efficiency. Win probability added (WPA) measures effect on the result: a single in the last over of a tight chase is worth far more than a six at 200/2.

**Win probability.** Two logistic regressions, one for the first innings and one for the chase, give the batting side's chance of winning before every ball. The chase model uses the required rate relative to the season's scoring rate, wickets in hand and balls left. Over the last 24 balls it hands over to a ball-by-ball model, because a smooth curve can't see that a single ball is lumpy.

**Example.** In the 2023 final, with two balls left and CSK needing 10, the model gave Gujarat a 93.4% chance, which is 6.6% for CSK. Ten off two balls needs a six and a four, which is why the odds were that long. It is the same logic as a weather forecast: it does not say what will happen, only how often teams in that spot have won.

**WPA.** WPA (win probability added) is how much one ball moved the batting side's chance of winning, measured in wins. The batter is credited with it for balls faced and the bowler gets the opposite for balls bowled. Add up a player's balls and you get his total effect on results: a match, a season, or one phase of an innings. The same run is worth different amounts at different moments, so a single that keeps a tight chase alive can be worth far more than a six at 200/2\. A WPA of 1.0 means one whole match swung from certain defeat to certain victory; +0.10 is a tenth of a win.

$$\\text{WPA(ball)} = p\_{\\text{after}} - p\_{\\text{before}}$$

In the 2023 final, Jadeja's six took CSK from 6.6% to 26.4% (+0.20), and his four took them from 26.4% to 100% (+0.74). His match total was +0.77 wins. In the CSK post, "Impact (wins added)" means WPA.

**Leverage.** Leverage is how much one ball could swing the game, whatever actually happens on it: the win probability if it goes for six, minus the win probability if it takes a wicket. The leverage index scales the IPL's average ball (0.107) to 1\. The last ball of the 2023 final scored 9.3; the ball before it (10 off 2) scored 2.5\. Only 0.5% of IPL balls reach "very high" (index 4 or more). The idea is Tom Tango's, brought to T20 by Ganjoo.

**Example.** On the last ball of the 2023 final, CSK needed 4\. A boundary wins the title (100%) and a wicket loses it (0%), so the swing is the whole match: 1.00\. Divided by the average ball's 0.107, that is a leverage index of 9.3, a ball with about nine times the stakes of an ordinary one.

#### Chennai were at 6.6% with two balls left, then Jadeja hit a six and a four

CSK's chance of winning before each ball of the 2023 IPL final chase (rain cut it to 15 overs). Hover, touch or use the arrow keys to move through the innings.

sixwicketGrey strip: leverage index (how much one ball could swing the match; 1 = an average ball)

Source: Pitchside win-probability model, GT v CSK, 29 May 2023 (match 1370353). Win probability is the model's estimate from the match state, not a prediction.

## Just ask your AI

I had Claude's help with all of [CSK's 2026 postmortem ](https://www.npiedy.com/csk-2026-the-postmortem-report/)findings. I had Claude break them down by phase and compare CSK with the playoff teams, to see where they were falling behind.  
  
As an example, I asked for Sooryavanshi's stats, and this is what Claude had to say. It is a simple query; you can ask Claude for much more complex analysis.

![](https://storage.ghost.io/c/f7/10/f7101a80-6932-4b03-b4dc-971108e4b353/content/images/2026/10/image-10.png)

Claude about Sooryvanshi's 2026 run

## What's next

Pitchside is far from done. The CSK postmortem was the first real test, and it showed me what the tool needs: more questions it can answer, and a faster way to ask them. I want to keep using it on the things I actually argue about as a fan, like auction targets, batting orders and matchups, and write those up here. If something it says looks wrong to you, or there is a stat you want it to have, tell me. The code, the methods and the issues are all on [GitHub](https://github.com/naveenpiedy/pitchside?ref=npiedy.com).

## Acknowledgements

Pitchside stands on other people's work. [Cricsheet](https://cricsheet.org/?ref=npiedy.com) publishes the ball-by-ball data for free, and without it there is no tool. Jarrod Kimber's writing on cricket and numbers is why I wanted to build this in the first place. Himanish Ganjoo's T20 Metrics primer and his work on Impact shaped how I think about net stats and wins added, and Tom Tango's leverage index is behind the win probability section. Any mistakes in the implementation are mine, not theirs.

If you enjoyed this, I'm hoping to write more about Cricket analysis fairly often, so please subscribe if you want them in your inbox. Thoughts, ideas or corrections, or just want to chat about Cricket? Drop a comment, I read them all. And if you want to find me elsewhere: [goodreads](https://www.goodreads.com/user/show/120692883-naveen-piedy?ref=npiedy.com), [letterboxd](https://letterboxd.com/naveenpiedy/?ref=npiedy.com), [github](https://github.com/naveenpiedy?ref=npiedy.com) and [linkedin](https://www.linkedin.com/in/naveen-piedy-47b7336b/?ref=npiedy.com).