Web Developer | mainly with React | also on bluesky 👉 bsky.app/profile/benjaminles…

France
Joined September 2023
Benjamin Lesné retweeted
New on the Anthropic Engineering blog: tips on how to build more efficient agents that handle more tools while using fewer tokens. Code execution with the Model Context Protocol (MCP): anthropic.com/engineering/co…
Benjamin Lesné retweeted
Tip of the day: don't spread …state when setting in useQueryStates. The state updater function accepts Partial inputs. Only what is specified changes, the rest remains untouched in the URL. Bonus: set the state to null to remove _only_ those keys from the URL. Composition FTW.
5
8
169
Benjamin Lesné retweeted
Anthropic just posted another banger guide. This one is on building more efficient agents to handle more tools and efficient token usage. This is a must-read for AI devs! (bookmark it) It helps with three major issues in AI agent tool calling: token costs, latency, and tool composition. How? It combines code executions with MCP, where it turns MCP servers into code APIs rather than direct tool calls. Here is all you need to know: 1. Token Efficiency Problem: Loading all MCP tool definitions upfront and passing intermediate results through the context window creates massive token overhead, sometimes 150,000+ tokens for complex multi-tool workflows. 2. Code-as-API Approach: Instead of direct tool calls, present MCP servers as code APIs (e.g., TypeScript modules) that agents can import and call programmatically, reducing the example workflow from 150k to 2k tokens (98.7% savings). 3. Progressive Tool Discovery: Use filesystem exploration or search_tools functions to load only the tool definitions needed for the current task, rather than loading everything upfront into context. This solves so many context rot and token overload problems. 4. In-Environment Data Processing: Filter, transform, and aggregate data within the code execution environment before passing results to the model. E.g., filter 10,000 spreadsheet rows down to 5 relevant ones. 5. Better Control Flow: Implement loops, conditionals, and error handling with native code constructs rather than chaining individual tool calls through the agent, reducing latency and token consumption. 6. Privacy: Sensitive data can flow through workflows without entering the model's context; only explicitly logged/returned values are visible, with optional automatic PII tokenization. 7. State Persistence: Agents can save intermediate results to files and resume work later, enabling long-running tasks and incremental progress tracking. 8. Reusable Skills: Agents can save working code as reusable functions (with SKILL .MD documentation), building a library of higher-level capabilities over time. This approach is complex and it's not perfect, but it should enhance the efficiency and accuracy of your AI agents across the board. anthropic. com/engineering/code-execution-with-mcp
55
227
11
1,493
Benjamin Lesné retweeted
new RegExp(): ❌types 😴tired arkregex: ✅types 🫨wired
2
10
118
Benjamin Lesné retweeted
Today, we're launching Templates. A new way to personalize emails. Anyone on your team, from designers to marketers to developers, can create templates with our modern email builder.
Benjamin Lesné retweeted
Get localized country & language names with Intl.DisplayNames #JavaScript
2
5
48
Benjamin Lesné retweeted
Dice UI dropped new shadcn component A high-performance editable data grid component with virtualization, keyboard navigation, and cell editing capabilities. Built with Tanstack table
30
67
5
1,357
0
Benjamin Lesné retweeted
Ever since I first saw this I wanted to try implementing it in TypeGPU, and I finally got around to it while testing the new 0.8 release. You can try out the Jelly Slider here: docs.swmansion.com/TypeGPU/e… Had a lot of fun brainstorming optimisations with @iwoplaza and the team, and it should run well on most modern devices. Built entirely with TypeGPU, no extra libraries, with all shaders written in TypeScript. The prototyping speed with features like console.log on the GPU and “bindless” resources made the process really smooth.
〰️ Jelly Slider
Benjamin Lesné retweeted
Turn design into code with Claude Code + @figma. Through MCP, Claude sees your mockup at the data level—component hierarchies, design tokens, auto-layout rules—and translates it into production-ready code.
Benjamin Lesné retweeted
ok my mind is blown 🤯 when you install the @figma mcp to claude code, it adds a command to generate a design system. insanely useful bc a design system will organize the frontend code so anything you add and change makes it easier for the agent to follow a pattern. less slop. but even more mind blowing is this is now the bar for all mcps: it's not only context to other tools and data, but comes with built in prompts. HUGE workflow upgrade imo.
49
127
9
2,348
Benjamin Lesné retweeted
Had maybe my coolest AI coding moment this morning. I had an intractable bug in my video pipeline that caused my audio and video to go out of sync on long videos. I'd tried fixing this myself, AND with the help of AI, but no dice. So, I decided to scale up my efforts. I told Claude Code to do this sequence of moves: > Plan 10 potential fixes for the bug > Run check-pipeline.ts (to run the pipeline) > Check the resulting file using ffprobe > If that didn't work, try the next fix And let it run for 40 mins or so. On the 9th go round, it fixed the bug. And my video pipeline runs faster. AI + Lossless feedback loop = Profit
Benjamin Lesné retweeted
This is the perfect Claude Code statusline: - repo - branch - Git staged/unstaged/added - Context used Undefeated
Benjamin Lesné retweeted
Replying to @zeeg
It certainly doesn't help Swapping the GitHub MCP server for GitHub CLI has saved me a ton of tokens over many sessions
3
3
103
Benjamin Lesné retweeted
This is what happen when you enable React compiler in Nextjs 16
26
53
4
1,032
0
Benjamin Lesné retweeted
who is still using useEffect for fetching data?
Benjamin Lesné retweeted
Claude Code Skills use a genius 3-layer context system. Save this, you'll want it when building Skills. - Layer 1: Main context - project configuration, always loaded - Layer 2: Skill metadata - YAML frontmatter only, ~100-200 tokens per skill - Layer 3: Active skill context - SKILL. md and referenced docs loaded on demand Supporting files like scripts and templates are not pre-loaded into context. They're accessed directly when used, consuming zero tokens. This architecture allows dozens of Skills without hitting context limits. Building Skills? Check aitmpl.com/skills
31
135
11
1,093
Benjamin Lesné retweeted
It's more like 60/40 Coding agents could never work as workflows Lots of workflows I run would be much worse as agents But it's true that most people underestimate workflows
Workflows are better than agents in 99% of use cases
Benjamin Lesné retweeted
I've been using the crap out of Claude Code recently And lots of you have been asking me my tips So, here goes - 10 minutes of me using Claude Code to implement a feature.
Benjamin Lesné retweeted
Ever wondered why the longer your chat grows, the stupider the AI becomes? It might be because you don't understand how context windows work. Let me enlighten you:
Benjamin Lesné retweeted
Hope this can run npm scripts Without feedback loops all coding agents are garbage
Introducing Claude Code on the web. You can now delegate coding tasks to Claude without opening your terminal.
20
6
1
270