# Magic Draft Assistant

AI-powered overlay for competitive card drafting

- Role: Designer & Builder
- Year: 2025
- Tags: AI, Desktop, Gaming
- Canonical: https://austastic.com/work/mtga-drafter

A transparent desktop overlay for Magic: The Gathering Arena. Reads the game log, queries 17lands for stats, and asks Claude Sonnet to grade each pick with reasoning - all within the 60-second window.

## Overview

In a Magic: The Gathering draft, you open packs of cards and pick one at a time, building a deck on the fly against other players. You have about 60 seconds per pick to evaluate 14+ cards across power level, color synergy, mana curve, and what your opponents are signaling through their picks. Drafts on Magic Arena cost real money, and the decisions are irreversible.

I built an AI companion tool to help with drafting that synthesizes all available information about a given set, from expert analysis, to podcasts, to card win rates, and creates real time recommendations as a learning tool for drafting in real time taking into account your current draft state.

## Building an amazing draft partner

### A companion that sits with you draft in and draft out

The overlay sits on top of Magic Arena during drafts (or to the side provided enough screen real estate). It reads the game log in real time, pulls card statistics, synthesizes expert strategy from professional podcasts, and grades each card in the context of your specific pool, color signals, and archetype - streaming the results into the overlay as fast as the AI can think.

It's not just a stat display. It's an opinionated co-pilot that explains its reasoning, stays current with the evolving format meta, and adapts when you override its recommendations.

Video: https://austastic.com/videos/mtga-draft-helper/mtgapick2.mp4

### From data table to AI companion

The first iteration (seen here) threw TONS of information at the user. I quickly discovered that this information, while all technically useful, ended up making decision making more challenging given the time pressures of a real time draft. It's simply too difficult to parse and analyze large amounts of information, it needs to be reduced to only the bare minimum tablestakes for decision making.

For all the nuances and complexity that one would normally take their time on, I instead leaned on the AI to condense and explain the findings semantically, rather than putting that mental burden on the user.



![UI evolution from V1 data table to V2 AI rankings to V3 full overlay with signals and explanations](https://austastic.com/images/mtga-draft-helper/oldietight.png)

*V1 → V2 → V3: less data, more intelligence*

### Three stages, one smooth experience

The early versions waited for the AI to finish before showing anything - 8 to 12 seconds of a blank overlay. Unacceptable when you have 60 seconds to pick.

The solution was three stages that make the wait disappear:

1. Instant: a deterministic ranking based on heuristics - no AI call, no delay. The user has something to work with immediately.

2. Seconds later: the full AI ranking lands, reordering cards with contextual awareness of the pool, signals, and archetype. Cards stream in as JSON is parsed - the top 3 picks appear after 1-2 seconds.

3. Shortly after: detailed reasoning for the top picks auto-expands, showing why the AI made its call.

The AI takes the same amount of time either way. The architecture just removes the perception of waiting.

Video: https://austastic.com/videos/mtga-draft-helper/mtgapick1.mp4

*Instant → Smart → Deep*

### The AI adds weight, not authority

The tool doesn't tell you what to pick. It adds weight to your decision by showing its reasoning alongside hard data - so you can agree, disagree, or learn something.

The hard win rate for cards stays visible even when the AI ranks a card differently. A card might have a 50% baseline win rate but the AI ranks it first because it's exceptional in your specific archetype. Seeing both numbers lets you sanity-check: 'the AI sees something - let me read why' or 'the AI is wrong here, my deck needs removal.'

If you override the AI, it adapts. It buys into your direction and helps you from there - it doesn't keep pushing. The explanation makes errors visible too: you can see exactly which reasoning you disagree with.

Early results: my personal win rate moved from ~58% to ~62%. In competitive drafting that's the difference between above-average and near-professional territory. The sample size is still just me, but directionally strong.

![Overlay showing AI ranking alongside raw 17lands win rate for comparison and sanity-checking](https://austastic.com/images/mtga-draft-helper/aitrust.png)

### Building the AI's expertise

The AI isn't just reading statistics. A custom pipeline fetches YouTube transcripts from professional draft podcasts, extracts structured knowledge - card grades, archetype advice, trap cards, synergy combos - and synthesizes across episodes into a set-specific knowledge file.

The result: Complete individual card evaluations, identifying 'trap' cards, deep archetype tier lists, and strategic insights that evolve as the format develops - updated automatically as new content and insights emerge online.

I built a draft simulator to test the AI's context offline. It replays draft scenarios and compares picks against expected outcomes. It immediately exposed prompt weaknesses and allowed me to iterate on how the recommendation engine functioned quickly.

![Knowledge pipeline showing podcast extraction, synthesis, and set-specific knowledge output](https://austastic.com/images/mtga-draft-helper/draftsimshot.png)

## Designing the context

### Context as a design requirement

A typical draft has 42 picks. Each pick sends a 55K-token system prompt. Without optimization, that's 2.1 million input tokens per draft.

The system prompt is split into two independently cached blocks: static draft knowledge (~15K tokens, warmed on app startup) and set-specific content (~40K tokens, cached on the first pick). Anthropic's prompt caching gives a 90% discount after the first pick - every subsequent pick only pays full price on the ~2K-token dynamic prompt.

Total optimization: 2.1M tokens > ~290K per draft. 86% cost reduction. Combined with card reference compression (70% smaller) and a two-model strategy (Sonnet for ranking, Haiku for follow-ups at 10x cheaper), the tool is affordable enough to run every draft session.

Beyond the token cost - more context means greater turn around times for results. With a limited time window to make choices during a draft, every context token that doesn't earn its spot is stealing time from the user. Context crafting and curation isn't just plumbing - it's a design requirement to enable a good user experience.

![Context architecture showing two-block caching system and token optimization from 2.1M to 290K](https://austastic.com/images/mtga-draft-helper/contextmdshot.png)

### Two-block cached system prompt

The system prompt is split into two independently cached blocks to maximize Anthropic's prompt cache hits. Block 1 is warmed on app startup before any draft begins. Block 2 is cached on the first pack of each draft. After that, every subsequent pick gets a 90% cost reduction on the system prompt.

The dynamic user prompt changes every pick and includes the full draft state: current pool with color commitments, mana curve, color signals with evidence, and all cards in the current pack with stats and oracle text - roughly 1,500-2,000 tokens per pick.

The prompt dynamically adjusts advice based on how far into the draft you are. Early draft (commitment < 30%): card grade is the primary factor, only bombs create real pull toward a color. Locked in (commitment > 75%): stay in your colors, only S/A+ bombs worth splashing, fill curve gaps.

A critical discovery during testing: the AI was evaluating cards based on how they synergize with **other cards in the same pack** - not realizing you can only take one and the rest go to opponents. This required an emphatic instruction that the other cards are going to opponents and should not factor into synergy evaluation.

```
# Block 1: Static (same for ALL drafts, pre-warmed on app startup)
blocks.append({
    "type": "text",
    "text": static_knowledge,  # BREAD, CABS, signal theory, keywords
    "cache_control": {"type": "ephemeral"},
})

# Block 2: Set-Specific (changes per draft format)
blocks.append({
    "type": "text",
    "text": set_knowledge,  # Archetype guides, 400+ card reference
    "cache_control": {"type": "ephemeral"},
})
```

### From 2.1M to ~290K tokens per draft

A typical draft has 42 picks. Each pick sends the system prompt (~40-60K tokens for 400+ cards with oracle text) plus the dynamic prompt. Without optimization, that's 42 x 50K = **2.1 million input tokens per draft**.

**Prompt caching**: Anthropic's ephemeral prompt cache stores the system prompt for 5 minutes. Since draft picks happen every 30-90 seconds, the cache stays warm throughout the entire draft. First pick pays full price; picks 2-42 get 90% discount.

**Card reference compression**: The card reference for a full set (~400 cards with oracle text, types, stats) was ~80KB. Compressed to ~25KB using a single-line-per-card format - reminder text stripped, whitespace collapsed, oracle text truncated to 250 chars. **~70% size reduction** with no meaningful information loss for the AI.

**Two-phase ranking**: Instead of asking for rankings + detailed explanations for all 14 cards, Phase 1 (Sonnet) returns ranked JSON with no explanations (~60% fewer output tokens). Phase 2 (Haiku) provides on-demand explanations when the user clicks a card, using the faster, cheaper model with max_tokens=150.

**Incremental pool updates**: When exactly one card is added to the pool, the system appends just that card to the cached pool text instead of reformatting the entire pool. Saves ~500 tokens per pick.

### Showing results before they're complete

Users have ~30 seconds per pick. If the AI takes 8 seconds to fully rank 14 cards, they've lost a quarter of their think time. Streaming lets us show the top picks within 1-2 seconds while the AI is still working on lower-ranked cards.

The **early callback pattern** parses partial JSON as it streams in. When enough complete ranking objects have been parsed to identify the top 3 picks, it fires a callback immediately - before the full response finishes. The UI shows top 3 picks after ~1-2 seconds; full rankings arrive 3-6 seconds later.

A critical edge case: the user picks a card before the AI finishes ranking. Without cancellation, the next pack would show stale AI results from the previous pack. When a new pack arrives, any in-flight ranking task is cancelled before starting the new one.

```
async def _stream_response(self, set_code, user_prompt):
    with self.client.messages.stream(
        model="claude-sonnet-4-20250514",
        max_tokens=3000,
        system=system_blocks,  # Cached blocks
        messages=[{"role": "user", "content": user_prompt}],
    ) as stream:
        for text in stream.text_stream:
            yield text  # Character-by-character to frontend

# Early callback: fire when top 3 are identified
if len(parsed_rankings) >= 3:
    await on_early_picks(parsed_rankings[:3])
    # UI shows top 3 after ~1-2 seconds
```

### Expert strategy, not just statistics

The AI doesn't just see raw stats - it's informed by professional draft strategy synthesized from podcast episodes and expert analysis.

Sources include **Lords of Limited** (professional-level limited strategy), **Limited Resources** (the gold standard for draft theory - BREAD, CABS frameworks), and **Limited Level-Ups** (format-specific deep dives).

The knowledge extraction pipeline: fetch YouTube transcripts from professional draft podcasts, extract structured knowledge (card grades, archetype advice, trap cards, synergy combos), synthesize across episodes into a merged knowledge file with grade evolution tracking, and output a set-specific knowledge file (~500 lines of format expertise).

The result: 100+ individual card evaluations from pros, 55+ identified trap cards (cards that look good but underperform), 100+ strategic insights (synergy combos, build-around cards, splash rules), and grade changes tracked across episodes as a card's stock rises or falls.

The system prompt tells Claude to prioritize set-specific podcast knowledge over generic draft theory when they conflict. This matters because every set plays differently - a card type that's usually good might be unplayable in a fast format, and the podcast hosts identify this within the first week.

### Never leave the user without recommendations

The AI is the primary ranking engine, but a draft assistant that crashes when the API is down is worse than no assistant. The fallback strategy is layered:

**Layer 1: AI ranking** (primary) - Full Claude Sonnet analysis with streaming.

**Layer 2: Rule-based ranking** (fallback) - A sophisticated multi-factor scoring system that considers the same factors as the AI: base power (GIH WR normalized, 40% weight), color fit (-2.0 to +1.0 for on/off-color, 25% weight), signal alignment (-1.0 to +1.5 for open/cut, 15% weight), deck needs (+0 to +1.5 for curve gaps, 15% weight), and wheel adjustment (0 to -2.1 for cards likely to come back, 5% weight). It can't reason about synergy or format context the way an LLM can, but it's good enough to draft competitively.

**Layer 3: Raw stats** - If even rule-based fails, sort by raw GIH win rate.

**Model selection**: Claude Sonnet for the primary ranking (best balance of quality and speed), Claude Haiku for follow-up questions (3x faster, 10x cheaper for simple question-answering about a card). The user can also disable AI entirely in settings and use the rule-based system as the primary ranker.

```
# Layer 1: AI ranking (primary)
try:
    rankings = await ai_ranker.rank_pack(pack, state)
except (APIError, TimeoutError, JSONDecodeError):
    # Layer 2: Rule-based ranking (fallback)
    rankings = pick_ranker.rank_pack(pack, state)

# Layer 3: If even rule-based fails, sort by raw GIH WR
if not rankings:
    rankings = sorted(pack, key=lambda c: c.gih_wr, reverse=True)
```

## What's next

### Two challenges to address before release

Monetization: I've optimized cost aggressively, but someone has to pay. Free means I subsidize a niche audience that won't generate ad revenue. 'Bring your own API key' is a terrible user experience, regardless of cost. I'll likely release this for free while I learn from users what makes it great for them, and eventually transition to an at-cost per set model.

Community reception: gaming communities are skeptical of AI right now. The launch needs to be framed with awareness of how AI is changing the landscape in gaming and culture. Moreover, the challenge of draft is the decision making, and this tool aids that greatly. I hope to position it as a learning tool that teaches you to draft better, not a crutch that replaces your judgment.

![Product strategy showing monetization considerations and community framing approach](https://austastic.com/images/mtga-draft-helper/antiai.png)

## Contact

Austin McCasland — Staff Product Designer, Meta Reality Labs

- Email: austastic@gmail.com
- LinkedIn: https://www.linkedin.com/in/austastic/
- Web: https://austastic.com

---

HTML version: https://austastic.com/work/mtga-drafter · All pages: https://austastic.com/llms.txt
