惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
美团技术团队
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
月光博客
月光博客
宝玉的分享
宝玉的分享
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
J
Java Code Geeks
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
Vercel News
Vercel News
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Claude Sonnet 4.5 vs 4.6: What Changed and Which Should Y...
Tony Spiro · 2026-05-29 · via DEV Community

Anthropic shipped Claude Sonnet 4.6 in February 2026, roughly five months after Sonnet 4.5 launched in September 2025. Both carry the same API pricing ($3 input / $15 output per million tokens), but the gap in capability is meaningful. If you're picking a model to build on right now, the choice matters.

This post breaks down exactly what changed, which use cases favor each model, and how to connect either one to a real content layer using the Cosmic JavaScript SDK.


What Changed: Sonnet 4.5 to 4.6

Coding

Sonnet 4.5 was already a strong coding model when it launched. Anthropic called it "the best coding model in the world" at the time, and it led SWE-bench Verified at 77.2% (averaged across 10 trials). It introduced the Claude Agent SDK and showed it could maintain focus across 30+ hour autonomous coding sessions.

Sonnet 4.6 improves on this across the board. In Claude Code, users preferred 4.6 over 4.5 roughly 70% of the time. Testers reported that 4.6 more effectively reads context before modifying code, consolidates shared logic instead of duplicating it, and follows instructions more consistently over long sessions. One customer reported going from a 9% error rate on Sonnet 4 to 0% on an internal code editing benchmark after switching to 4.6. Another saw planning performance increase by 18% and end-to-end eval scores improve by 12%.

The headline SWE-bench number for 4.6 is 80.2% with a prompt modification, up from 77.2% on 4.5.

Computer Use

This is where 4.6 makes the biggest leap. Sonnet 4.5 led the OSWorld benchmark at 61.4% when it launched. Sonnet 4.6 pushes further: early users are reporting human-level capability on tasks like navigating complex spreadsheets and completing multi-step web forms. Anthropic also specifically calls out that 4.6 is a major improvement over 4.5 on prompt injection resistance.

Long-Context Reasoning and Agent Planning

Sonnet 4.6 ships with a 1M token context window in beta. That's enough to hold an entire codebase, dozens of research documents, or long contracts in a single request. Sonnet 4.5 didn't offer this.

Knowledge Work and Document Understanding

Claude Sonnet 4.6 matches Opus 4.6 performance on OfficeQA, which tests how well a model reads enterprise documents (charts, PDFs, tables) and reasons from them.

Design and Frontend Output

Multiple customers who tested 4.6 independently described its visual outputs as "notably more polished" with better layouts, animations, and design sensibility.


Side-by-Side Summary

Capability Sonnet 4.5 Sonnet 4.6
SWE-bench Verified 77.2% 80.2%
Context window 200K 1M (beta)
Long-horizon planning Strong Significantly improved
Document comprehension Strong Matches Opus 4.6 on OfficeQA
Frontend/design output Good Noticeably more polished
API pricing $3 / $15 per M tokens Same

Which Model Should You Use?

Use Sonnet 4.6 if:

  • You're building a production coding agent or agentic workflow
  • You need to process or reason over large documents, codebases, or research corpora
  • You're using computer use in any production context
  • You're building frontend generation tools or design automation
  • You want the best available Sonnet performance at the same price point

Sonnet 4.5 may still be fine if:

  • You've already built and tested against it and your production system is stable
  • You're running a constrained context window by design

For new projects: start with 4.6. For existing projects: migrate. The pricing is identical, and the capability uplift is real.


Using Claude with the Cosmic SDK

bun add @cosmicjs/sdk @anthropic-ai/sdk

import { createBucketClient } from '@cosmicjs/sdk';
import Anthropic from '@anthropic-ai/sdk';

const cosmic = createBucketClient({
  bucketSlug: 'your-bucket-slug',
  readKey: 'your-read-key',
  writeKey: 'your-write-key',
});

const anthropic = new Anthropic();

async function generateAndStoreBlogPost(topic: string) {
  const message = await anthropic.messages.create({
    model: 'claude-sonnet-4-6',
    max_tokens: 2048,
    messages: [{
      role: 'user',
      content: `Write a developer-focused blog post about: ${topic}. Include code examples where relevant. Format in markdown.`,
    }],
  });

  const content = message.content[0].type === 'text' ? message.content[0].text : '';

  const { object } = await cosmic.objects.insertOne({
    type: 'blog-posts',
    title: topic,
    status: 'draft',
    metadata: {
      markdown_content: content,
      published_date: new Date().toISOString().split('T')[0],
    },
  });

  console.log(`Draft created: ${object.slug}`);
  return object;
}


The Bottom Line

Sonnet 4.5 was an excellent model. Sonnet 4.6 is better in almost every measurable way at the same price. For new projects, default to 4.6. For existing deployments, the migration is a single string change.

Start building free on Cosmic or book a 30-minute intro with Tony.

Originally published at cosmicjs.com