Stu Mason
Stu Mason

Feeding Your AI the Docs It's Missing

Stu Mason3 min read

Claude kept giving me outdated Laravel syntax. The fix was condensing the docs down to just what changed since its training cutoff.

Feeding Your AI the Docs It's Missing

Claude kept fucking up my Laravel queue jobs. Every time I asked it to set up a queue worker or configure broadcasting, it would give me Laravel 9 syntax. The commands were wrong, the config files were in the wrong place, and I was spending more time fixing its output than I would have spent writing it myself.

The model's training data has a cutoff. It knows Laravel, but it knows the Laravel from whenever its training ended. Laravel moves fast. The queue system changed. Broadcasting changed. The whole application structure changed in Laravel 11.

I needed to feed it the current docs.

The First Attempt: Repomix

Found a tool called repomix that compresses a whole repo into a single text file. Perfect for uploading to Claude's Projects feature.

Grabbed the Laravel docs repo, ran repomix, tried to upload it.

Problem: it used 450% of the project's knowledge capacity. The Laravel docs are massive. Too massive.

The Solution: Delta Condensing

I only needed Claude to know what had changed since its training cutoff. It already knows Laravel 10. I just needed to teach it Laravel 11+ differences.

So I wrote a command that:

  1. Takes the full Laravel docs
  2. Sends each section to GPT-4 (cheaper than Claude for this)
  3. Asks "what's new or changed from Laravel 10?"
  4. Keeps only the delta
private const PROMPT = <<<'EOT'
You are helping create training data about Laravel 11+. You already know Laravel up to version 10.

Keep ONLY information that is:
- New in Laravel 11+
- Changed from Laravel 10
- Non-obvious implementation details specific to Laravel 11+

Remove everything that:
- Was already present in Laravel 10
- Is basic PHP or web development knowledge
- Is introductory or explanatory text

Format as concise bullet points.
If there's nothing new, respond with "NO_NEW_CONTENT".
EOT;

The full command runs through each markdown file in the docs, condenses it, and outputs a single file of just the changes.

The Result

The full Laravel docs: 450%+ of project capacity (unusable) The condensed changes: 12% of project capacity (perfect)

Now Claude knows about the new application structure in Laravel 11, the streamlined bootstrap/app.php setup, the updated queue configuration, health check routes, and all the other shit that changed.

How I Use It Now

I don't actually use Claude Projects much anymore. With Claude Code, I use a CLAUDE.md file in my project root that contains:

  1. Project-specific patterns and conventions
  2. My preferred stack versions
  3. Links to or excerpts from current documentation
  4. Things Claude consistently gets wrong that I want it to remember

The CLAUDE.md approach is better for active development because it lives in the repo and travels with the project. But the doc-condensing technique still works great for building that initial knowledge base.

The Command

If you want to do this yourself, the basic flow is:

// Pseudocode
foreach ($docsFiles as $file) {
    $condensed = $llm->ask(PROMPT . $file->contents());

    if ($condensed !== 'NO_NEW_CONTENT') {
        $output->append($condensed);
    }
}

Full gist here: gist.github.com/StuMason/...

You can adapt this for any framework or library that's moved faster than your AI's training data. Works great for Inertia, Livewire, Tailwind - anything with active development and good docs.

Get the Friday email

What I shipped this week, what I learned, one useful thing.

No spam. Unsubscribe anytime. Privacy policy.