~/beer-and-code
▪ Clã Beer and Code the largest AI Engineering community in Brazil · live, every week join the Clã ›
~ / tutorials $ ls -la

Tutorials

Practical step-by-step guides on Laravel, Filament, and the PHP ecosystem.

26 tutorials
01 #laravel · #php
Self-improving harness: how to let the agent rewrite its own rules without breaking what works

55% of the improvements an agent proposed for its own harness fixed one failure and broke something that worked. A PHP tutorial for a self-improving harness with the piece that makes it engineering: the regression gate. Git-versioned rules, failure mining, minimal rules, protected cases, provisional promotion and pruning.

07 Nov · 12 min ›
02 #laravel · #ai-agents
AI agent verification: why your agent can't grade its own exam

Across 54 cycles, the agent said it improved every time. In 56%, nothing changed or it got worse. The progress mirage measured in a paper, why a bigger LLM judge doesn't fix it, and how to build a Laravel loop with an external verification gate: checkable exit, hard budget, and a guard that stops the agent from editing its own exam.

06 Nov · 6 min ›
03 #laravel · #php
Filesystem as agent memory: progress file, feature list and git log in practice

An agent that runs across several context windows forgets everything each session. The pattern Anthropic, Manus and LangChain converged on: move state out of the window and into files. A JSON feature list that only accepts status changes, a progress log, a session start ritual and offloading large results with a restorable pointer, all with PHP code.

06 Nov · 5 min ›
04 #php · #ai-agents
Subagents: use them to isolate context, not to build an agent team

A subagent isn't a job title, it's a context window. When to use subagents (and when one agent is enough), the difference between isolated and fork modes, the numbers from Anthropic and Cognition, and how to implement both in a PHP harness straight on the Claude API, no framework.

06 Nov · 11 min ›
05 #ai-agents · #produtividade
How to use skills in Claude Code: writing the SKILL.md and when it beats MCP and CLAUDE.md

Your CLAUDE.md is 400 lines long and Claude ignores half of it. A tutorial on how to use skills in Claude Code: folder structure, SKILL.md frontmatter, progressive loading, scripts and references inside the skill, how to test whether the agent triggers it, and the decision matrix between skill, MCP, CLAUDE.md, slash command and subagent. Built on the real skills that run this blog's pipeline.

28 Oct · 19 min ›
06 #ai-agents · #typescript
Code Mode MCP: why your agent should write code instead of calling tools

Cloudflare's Code Mode MCP turns MCP tools into a TypeScript API and has the agent write code instead of making tool calls. From 1.17 million to about 1,000 tokens on Cloudflare's own API MCP. How it works under the hood (isolates, bindings, network-less sandbox), how to plug it into Claude Code, and where the pattern bites.

28 Oct · 11 min ›
07 #performance · #claude
Claude Code fast mode is out of preview: 2.5x faster for double the price. Worth it?

Claude Code fast mode is out of research preview on Opus 5.5: same model, up to 2.5x more output tokens per second, for double the price ($8/$40 per MTok). On Pro and Max it bills your usage credits, not your plan, and turning it on mid-conversation reprocesses the whole context uncached. How to enable it in the CLI, settings, VS Code and headless, the math, and when it pays off.

27 Oct · 15 min ›
08 #laravel · #ai-agents
Higgsfield MCP: What It Is and 10 Systems Where a Dev Can Integrate Image and Video

Higgsfield MCP hands your agent more than 30 image and video models, with the generation harness already built. How to connect it to Claude Code, what each generation costs in credits, and 10 systems where a dev can integrate it.

01 Oct · 11 min ›
09 #laravel · #php
Claude Code headless: how claude -p becomes an AI agent orchestrated by your code

An artisan command, a queue and Claude Code in headless mode (claude -p) generating 11 sites inside the subscription. How to orchestrate the agent from PHP, where the math works out, and how to plug in Higgsfield as an asset step with a budget controlled by code.

30 Sep · 8 min ›
10 #guardrails · #llm
Replacing Your LLM with Jev: 10 Places Where the Migration Pays for Itself in a Week

A decision catalog with numbers, not adjectives: ten tasks that run on a frontier LLM today and fit Jev's three primitives. One million calls in each case costs $46,200 on the LLM and $523 on Jev. It has the payload for each case, the cascade pattern, how to measure the migration in shadow mode without labeling anything, and the four tasks where Jev is the wrong choice.

21 Sep · 19 min ›
11 #ia · #observabilidade
10 AI Tools for AI Engineers in 2026 (and the Criteria for Choosing When They Change)

Tool lists rot in twelve months, yours included. That's why each of the ten comes with a swap criterion: the ten slots in the AI engineer's stack in 2026, the default for each one, and the objective signal that tells you when to rip it out. With data from the 2026 OWASP Top 10 and the Pragmatic Engineer survey.

03 Sep · 16 min ›
12 #ia · #ai-agents
When to Use an AI Agent: The 3-Minute Test

Half of the "AI projects" I reviewed in 2026 could have been solved with an if and a SELECT. The other half became agents because the team wanted to say they had AI. Here's the 3-minute test: 4 questions that decide whether your problem calls for an if, a query, a prompt, a deterministic flow or an actual agent. With 5 real cases, the verdict on each one (spoiler: 1 in 5 was an agent) and the invisible cost of overshooting.

02 Sep · 18 min ›
Meet the Clã Beer and Code
playing