Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
English
简体中文English
Prompts and workflows

Claude Sonnet 4.6 · configuration

Claude Sonnet 4.6: 1M Long Context and Context Compaction Architecture Configuration

Follow a task-specific guide for “Claude Sonnet 4.6: 1M Long Context and Context Compaction Architecture Configuration”; prerequisites, steps, checks, fixes, and source boundaries are explicit.

Source not verifiedClaude API, Claude Code, or an Anthropic-compatible runner

Prerequisites and inputs

  • Task-specific source files
  • Tool allowlist and permissions
  • Output schema
  • Acceptance evidence

Prerequisites\nLong-context compaction: number source sections and preserve decisions, interfaces, open items, and evidence links in a stage summary.\n\n## Task-specific steps\nTrigger compaction near budget, continue, and sample original passages to ensure no hard constraint was lost. Use external retrieval when detail matters.\n\n## Output and acceptance\nTrigger compaction near budget, continue, and sample original passages to ensure no hard constraint was lost. Use external retrieval when detail matters.\n\n## Source and boundary\nAnthropic Context Compaction documentation; beta limits and cost need a fresh check.

Read the source research notes

One-sentence takeaway

By configuring Prompt Caching breakpoints and a rolling Context Compaction strategy, Claude Sonnet 4.6 can maintain global memory and precise recall across 1M-token massive contexts or ultra-long-horizon agent tasks while significantly reducing latency and recomputation cost.

Use cases

  • Suitable tasks: Large codebase refactors that include full history, long-form legal or earnings-report comparative analysis, and autonomous agents that run for extended periods with hundreds of tool calls.

  • Unsuitable tasks: Single-turn short Q&A and instant transformation tasks that do not need to preserve context state.

  • Applicable model version: Claude Sonnet 4.6 (claude-sonnet-4-6).

  • Applicable clients, agents, or APIs: Anthropic Messages API (with anthropic-beta: context-compaction-2026-02-15 and prompt-caching-2024-07-31).

  • Recommended reasoning tier and parameters: For long-context retrieval, effort=medium is recommended; for code-understanding tasks, set max_tokens=8192.

Ready-to-use content

Production-grade API request configuration example

{
  "model": "claude-sonnet-4-6",
  "max_tokens": 8192,
  "output_config": {
    "effort": "medium"
  },
  "system": [
    {
      "type": "text",
      "text": "You are a senior engineer responsible for deep code analysis and system architecture audits. Using the full code context provided, analyze module dependencies and propose a refactoring plan.",
      "cache_control": { "type": "ephemeral" }
    }
  ],
  "context_management": {
    "strategy": "compaction",
    "compaction_trigger_tokens": 180000,
    "compaction_target_tokens": 60000,
    "preserve_recent_messages": 8,
    "summary_prompt": "Preserve key technical decisions, the list of file changes, failed test cases, and outstanding to-dos; discard raw output from intermediate tool calls."
  },
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "<codebase_context>\n... [insert codebase files injected via directory parsing here] ...\n</codebase_context>",
          "cache_control": { "type": "ephemeral" }
        },
        {
          "type": "text",
          "text": "Analyze all files that use legacy authentication logic, and output refactoring steps and test cases."
        }
      ]
    }
  ]
}

Test/workflow steps

  1. Structured context injection: Place static long text (such as a full-project codebase or documents) at the front of the user message, and mark the end with cache_control: {"type": "ephemeral"}.

  2. Place dynamic queries afterward: Put specific analysis instructions or query questions after the cached block so later multi-turn questions can hit the front-loaded cache.

  3. Monitor cache hit rate: Check cache_creation_input_tokens and cache_read_input_tokens in the response headers, and verify the hit rate reaches 85% or higher.

  4. Validate compaction triggers: When multi-turn interaction exceeds compaction_trigger_tokens (for example, 180k tokens), observe whether the server-side compaction output preserves key decisions.

Original evidence and data

  • Official documentation states that Prompt Caching delivers up to a 90% discount on long-context read cost for Sonnet 4.6 and reduces time to first token (TTFT) to 20%-30% of the original.

  • Official long-context benchmarks (Needle In A Haystack / RULER): Sonnet 4.6 reaches 98.4% recall accuracy within the 1M-token window, with highly consistent recall at extreme positions and mid-window positions.

  • Context Compaction can compress effective context usage in long-running sessions by 60%-70% while preserving key constraints and error-diagnosis information through summary_prompt.

Scope and limitations

  • The 1M-token context window is in Beta; billing tiers and rate limits (RPM/TPM) beyond 200k tokens may differ, and configuration should be adjusted according to account quotas.

  • Frequently changing effort or the system prompt within a session invalidates prefix caching; keep configuration stable within a single continuous session.

  • Automatic compaction drops minor details from conversation history that are not captured in the summary; if the full original trace must be retained, persist logs locally in a database.

Source excerpt or observation (short compliant paraphrase only)

Official documentation: "Context compaction allows long-horizon agents to run indefinitely without manual memory trimming or token overflow errors." (quote from official documentation)

Source and dates

Anthropic Platform Docs / Context Management & Compaction · Source date: 2026-02-17 · Edited: 2026-09-20

Read the original source
Variable checklist

No required variables

Related prompts

Clear Instructions, XML Context, and Self-Checking for Claude Sonnet 4.6Claude Sonnet 4.6: Computer Use Tool Definitions and Automated Closed-Loop WorkflowClaude Code: Sonnet 4.6 Engineering Architecture and Subagent DivisionClaude Sonnet 4.6: Effort and Tool-Triggering Configuration

Related reviews

Claude Sonnet 4.6 Official Release: Coding, Computer Use, and Agent BenchmarksOSWorld-Verified Independent Review: Claude Sonnet 4.6 Computer Use and GUI Task Deep AnalysisBrowser Use BU Benchmark: Sonnet 4.6 Browser Agent 62%Harvey Legal Agent Bench: Sonnet 4.6 Full-Pass Rate 4.2%

Read the full analysis

Overview · English

Claude Sonnet 4.6: What It Is, Pricing, Access, and the Sonnet 5 Migration Question

A sourced overview of Claude Sonnet 4.6’s 1M context, $3/$15 API pricing, active-legacy lifecycle, access routes, and migration trade-offs.

Claude Sonnet 4.6

Use Claude Sonnet 4.6 in Tabbit

Run this guide in the environment listed above. Downloading does not transfer the template or establish model availability for your account.