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

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
博客园_首页
博客园 - 【当耐特】
V
Visual Studio Blog
博客园 - 叶小钗
月光博客
月光博客
美团技术团队
J
Java Code Geeks
小众软件
小众软件
Y
Y Combinator Blog
博客园 - Franky
Martin Fowler
Martin Fowler
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
Microsoft Security Blog
Microsoft Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG

Crazyrouter Blog (English)

Ideogram AI Guide 2026: Product Mockups, Text Rendering, and API Automation Akool AI Voice Generator Review 2026: API Alternatives for Developers GLM 4.6 API Guide 2026: Build Chinese-English Agents with Tool Calling Google Veo3 API Guide 2026: Batch Video Generation, QA, and Fallbacks Claude Opus 4.8 vs Opus 4.7: Real API Benchmark Results for Developers Opus 4.8 vs Opus 4.7 Coding Test: What Changed for Developers? Opus 4.8 vs Opus 4.7 for Agents: JSON, Tool Use, and Structured Output Gemini 2.5 Flash-Lite for RAG, Agent Routing, and Cost per Successful Task Gemini 2.5 Flash-Lite for Support Automation and Ticket Triage Gemini 2.5 Flash-Lite Use Cases: The Practical Automation Tier for Developers Claude Jupiter v1-p vs GPT-5.5 Benchmark: Real API Test on Reasoning and Coding Claude Jupiter v1-p vs Claude Opus 4.7 vs Sonnet 4.6: Live API Test Claude Jupiter v1-p vs Claude Opus 4.7 vs Sonnet 4.6: Live API Test Claude Code Pricing 2026: Pro vs Max vs Team vs API Costs Claude Opus 4.7 vs DeepSeek V4 Pro: Real API Compatibility and Coding Benchmark Gemini CLI Complete Guide 2026: Repo Automation, CI Agents, and Multi-Model Routing Ideogram AI Guide 2026: Brand Design Automation, API Workflows, and Alternatives GLM 4.6 API Guide 2026: Agents, RAG, Tool Calling, and Bilingual Apps WAN 2.2 Animate Tutorial 2026: Character Consistency, Shot Control, and API Workflows Google Veo3 API Guide 2026: Production Video Pipelines, Prompts, Pricing, and Fallbacks AI API Pricing Comparison 2026: Text, Image, Video, Caching, and Router Costs Codex CLI Installation Guide 2026: Windows, macOS, Linux, Proxies, and CI Setup How to Get a Claude API Key in 2026: Secure Setup for Teams, CI, and Alternatives Gemini Advanced Review 2026: Is It Worth It for Coding, Research, and API Teams? Claude Code Pricing Guide 2026: Team Agent Budgets, API Fallbacks, and Cost Control Seedance 2.0 Pricing: Convert 46 CNY per Million Tokens to Cost per Second Qwen2.5-Omni Guide 2026: Real-Time Voice, Vision, and Multimodal Agents Kimi K2 Thinking Guide 2026: Reasoning Workflows, Evals, and Cost Control Google Veo3 API Guide 2026: Batch Video Pipelines, Pricing, and Fallbacks Codex CLI Installation Guide 2026: macOS, Linux, WSL, Proxies, and Dev Containers
11|Claude Code with Crazyrouter Series 11: Chapter 8: Pr...
Crazyrouter Team · 2026-06-10 · via Crazyrouter Blog (English)

11|Claude Code with Crazyrouter Series 11: Chapter 8: Prompt Optimization Techniques#

This is the 11th article in the Crazyrouter Claude Code series. This article focuses on “Claude Code with Crazyrouter Series 11: Chapter 8: Prompt Optimization Techniques,” with an emphasis on Chapter 8: Prompt Optimization Techniques, 8.1 How to Clearly Express Requirements, and specific, explicit instructions.

Unified integration approach: Claude Code / Anthropic native clients use ANTHROPIC_BASE_URL=https://cn.crazyrouter.com; OpenAI-compatible SDKs, HTTP requests, and frontend/backend applications use base_url=https://cn.crazyrouter.com/v1.

What This Article Covers#

  • Who this is for: Developers who are using Claude Code, preparing to integrate domestic models, or want to unify team calls through Crazyrouter.
  • What you will learn: How to configure environment variables according to the Crazyrouter documentation, organize workflows, and avoid the /v1/v1/... issue caused by an incorrect Base URL.
  • Recommended preparation: First create a separate API Token in the Crazyrouter console, then follow the Claude Code integration documentation to complete the basic setup.

Chapter 8: Prompt Optimization Techniques#

8.1 How to Clearly Express Requirements#

When communicating with Claude Code, clearly expressing your requirements is the key to getting high-quality responses. Learning how to ask effectively helps the AI better understand your intent and provide more accurate answers.

Specific and Explicit Instructions#

Avoid Vague Wording#

Use specific, explicit instructions:

Vague wording (not recommended):

Specific wording (recommended):

Provide Complete Information#

Provide enough information so the AI can understand what you need:

Incomplete information (not recommended):

Complete information (recommended):

Specify the Output Format#

Tell the AI clearly what output format you want:

Unclear format (not recommended):

Clear format (recommended):

Provide Necessary Context#

Provide Background Information#

Provide relevant background information to help the AI understand the scenario:

No background information (not recommended):

With background information (recommended):

Explain the Use Case#

Explain how the content will be used so the AI can adjust the wording:

No use-case description (not recommended):

With use-case description (recommended):

Describe the Audience#

Describe the audience for the content so the AI can adjust the tone and style:

No audience description (not recommended):

With audience description (recommended):

Use Examples to Guide the Output#

Provide Reference Examples#

Provide reference examples so the AI can understand what you expect:

No example (not recommended):

With an example (recommended):

Provide Format Examples#

Provide a format example so the AI can output content according to your requirements:

No format example (not recommended):

With a format example (recommended):

Provide Style Examples#

Provide style examples so the AI can imitate a specific expression style:

No style example (not recommended):

With a style example (recommended):

Practical Tips#

Ask Step by Step#

For complex tasks, ask step by step:

All-in-one request (not recommended):

Step-by-step request (recommended):

Iterate and Improve#

If the first result is not satisfactory, iterate and improve it:

First request:

Improved request:

Generate Multiple Versions#

Ask for multiple versions and choose the best one:

Single version (not recommended):

Multiple versions (recommended):

Case Examples#

Case: Vague vs Clear#

Compare the effects of vague wording and clear wording:

Scenario: You need to write a meeting notice

Vague wording:

Possible AI response:

Clear wording:

AI response:

Case: No Context vs With Context#

Compare the effect of including or omitting context:

Scenario: You need to reply to a customer email

No context:

Possible AI response:

With context:

AI response:

Tips#

  1. Use structured wording: organize your requirements with numbers, lists, and similar formats
  2. Clarify priorities: if you have multiple requirements, state which are mandatory and which are optional
  3. Provide constraints: specify word limits, format requirements, and other constraints
  4. Describe the expected outcome: explain what kind of result you want
  5. Be patient: if the first result is not ideal, adjust your request and try again
  6. Save effective prompts: keep a record of prompts that work well so you can reuse them later

Now, try asking Claude Code questions in a clear way!

8.2 Common Prompt Templates#

Prompt templates can help you get high-quality responses quickly. Below are some commonly used prompt templates. You can adapt them to your actual needs.

Text Generation Templates#

Product Description Template#

Ad Copy Template#

Social Media Content Template#

Email Writing Template#

Data Analysis Templates#

Data Statistics Template#

Trend Analysis Template#

Comparative Analysis Template#

Document Processing Templates#

Document Summary Template#

Document Rewriting Template#

Excel Processing Templates#

Data Cleaning Template#

Data Filtering Template#

Data Analysis Template#

Meeting Minutes Template#

Meeting Notice Template#

Study Notes Template#

Knowledge Point Summary Template#

Creative Templates#

Brainstorming Template#

Story Generation Template#

Usage Suggestions#

How to Use These Templates#

  1. Choose the right template: select the template that best matches your needs
  2. Replace placeholders: replace the placeholders in square brackets with specific information
  3. Adjust the requirements: modify the requirements in the template based on your actual situation
  4. Provide detailed information: give enough context so the AI can understand your needs
  5. Iterate and improve: if the first result is not satisfactory, adjust your request and try again

Custom Templates#

  1. Save frequently used prompts: keep a record of prompts you use often
  2. Create a personal template library: build a template library that fits your workflow
  3. Update templates regularly: update and optimize templates based on your usage
  4. Share great templates: share effective templates with colleagues and learn from each other

Case Examples#

Example: Using a Product Description Template#

You:

Claude:

Example: Using a Data Analysis Template#

You:

Claude:

Tips#

  1. Adjust flexibly: templates are references, and you can adapt them to the actual situation
  2. Combine templates: you can combine multiple templates to complete complex tasks
  3. Track results: record which templates work well and which ones need improvement
  4. Keep optimizing: continuously improve templates based on usage feedback
  5. Share and discuss: share useful templates with colleagues and learn from each other

Now, try using these templates to complete your tasks quickly!

8.3 Improve Output Quality#

With a few techniques and methods, you can significantly improve the output quality of Claude Code and make the results better match your expectations.

Iteratively Refine Prompts#

First Attempt#

Start with a simple prompt:

You:

Claude:

Second Optimization#

Based on the AI's feedback, provide more information:

You:

Claude:

Third Optimization#

If you are still not satisfied with the result, keep refining it:

You:

Claude:

Adjust the Output Format#

Specify Format Requirements#

Clearly tell the AI what format you want:

You:

Claude:

Provide a Format Example#

Provide a format example so the AI outputs the result according to your requirements:

You:

Claude:

Output in Multiple Formats#

Ask the AI to provide output in multiple formats:

You:

Claude:

Feedback and Corrections#

Provide Specific Feedback#

Provide specific feedback and tell the AI what needs improvement:

You:

Claude:

Point Out Errors#

If the AI's response contains an error, point it out directly:

You:

Claude:

Ask for Regeneration#

If you are not satisfied with the result, you can ask it to regenerate:

You:

Claude:

Use Constraints#

Word Count Constraints#

State the word count requirement clearly:

You:

Claude:

Style Constraints#

State the style requirements clearly:

You:

Claude:

Content Constraints#

State the content requirements clearly:

You:

Claude:

Examples#

Example: Iteratively Improve Copy#

This shows how to improve copy quality through iteration:

First attempt:

Second optimization:

Third optimization:

Fourth optimization:

Example: Adjust the Output Format#

This shows how to adjust the output format:

Original output:

Adjust to table format:

Adjust to a table with percentage share:

Tips#

  1. Optimize step by step: Don't expect a perfect result in one try; gradual refinement works better
  2. Provide specific feedback: The more specific your feedback, the more accurately the AI can improve
  3. Make constraints explicit: Clearly define constraints such as word count, style, and format
  4. Compare multiple versions: Ask for several versions and choose the best one
  5. Save strong results: Save high-quality outputs for future reference
  6. Record effective prompts: Keep track of prompts that work well so you can reuse them next time

Now, try using these techniques to improve the output quality of Claude Code!


Start Connecting to Crazyrouter#

If you're ready to connect Claude Code, domestic models, or your own applications to Crazyrouter through a unified setup, follow this sequence:

  1. Go to the Crazyrouter console to create a dedicated API Token, and manage permissions separately by project or team.
  2. Claude Code uses the root domain: https://cn.crazyrouter.com; OpenAI-compatible SDKs use: https://cn.crazyrouter.com/v1.
  3. When you need to automatically check the environment or quickly write configuration, use the Crazyrouter Claude Code one-click configuration script.
  4. If debugging fails, check the console logs first, then verify the API Endpoint guide, focusing on whether an extra /v1 was added to the Base URL.

When you need to evaluate model costs or choose different models, first check the Crazyrouter pricing and models page, then add your commonly used models to the Token whitelist.