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

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

Crazyrouter Blog (English)

暂无文章

11|Claude Code with Crazyrouter Series 11: Chapter 8: Prompt Optimization Tips
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.