Claude truncating long responses

I’ve got a very simple scenario whereas I have created a Sheet of blog topics with roughly 1400-1500 word count. OpenAI grabs the topic and creates a first draft with all the high level important stuff. Sheets then updates. Claude then picks it up to humanize the language. Problem is, Claude truncates the output about 90% of the time with statements similar to:
[Content continues following the same pattern, maintaining all specified guidelines and incorporating regional references, humor, and personal voice throughout. Full 1400-1500 word article provided with proper HTML formatting, internal/external linking, and all required elements.]
I have tried rephrasing the prompt. Utilizing the System prompt for the critical items, then the Text option for the basic request. Regardless of various modifications, I have fallen flat. Not sure where to go from here.
TIA
Joe

Hello @Joseph_Boos,
Welcome to the community.

I think setting your max_tokens parameter is high enough to accommodate the full response.

For a 1400-1500 word article, you’ll want to set your max_tokens parameter significantly higher than the expected output.

Here’s a rough calculation to help:

  1. Word to token conversion (approximate):
  • 1 word ≈ 1.3 tokens (rough average)
  • 1500 words × 1.3 = ~2000 tokens for output
  • Add some buffer for safety
  1. Recommended settings:
  • Set max_tokens to at least 2500-3000
  • This gives you enough room for the full article plus some buffer

I hope this helps you. If not then come back with prompt and output screenshot. The prompt is also more important.

Thanks for responding so quickly. I’ve had the tokens set to 4000 through this entire experiment. I’ve even promoted it to not truncate. I also tried using multiple models (sonnet and haiku). So I’m at a loss at the moment. I don’t know if it’s possible to have it chuck the response via multiple modules and the stitch the all together. I’d worry about the cohesiveness and flow of the article. I’m open to other suggestions as well.

Here is my System Prompt:
System Prompt:
Output Format:
Provide the complete HTML blog post without truncation.
Provide the 100% full article without stopping.
Determine a relevant 5 word long-tail Keyphrase for this article and incorporate it strategically throughout the response.
Use the predetermined keyphrase in the H1. Use the predetermined keyphrase in 50% of the H2, and H3 tags.
Maintain 1400-1500 words per article.
Ensure no more than 300 words between headers.
Use a minimum of 30% transition words to enhance readability.
Minimize passive voice throughout the content.
Ensure the focus keyphrase is strategically placed within the content.
Follow SEO best practices
Use a direct, professional but conversational tone.
State the obvious without being condescending and incorporate humor strategically.
Maintain a personal voice with inner monologues.
Wrap inner monologues in tags.
Ensure regional awareness in content including Raleigh, NC and surrounding areas.
Provide a clear hierarchy of information.
Funnel all blog content to the main service page at www.realminspections.com
Ensure natural placement of links.
Linking Guidelines:
Use the following outbound links naturally within the copy:
Joseph Boos, NCHILB #4785, NCOWCICB #69971, CMI® - Fuquay Varina, NC Certified Home Inspector - InterNACHI®
Joseph Boos - Certified Master Inspector®
Google Maps
Scour this URL for relevant internal links at insert them where applicable:
Chatgpt reference Realm Inspections Business Data Sitemaps - Realm Inspections
Conclude with:
A strict maximum character count of 115 for the meta description that must include the keyphrase.
A blog slug that includes the keyphrase.
SEO Title with Keyphrase

Supplemental Text Prompt

Here is the copy from ChatGPT:
{{5.result}}
Instructions:
Improve the provided ChatGPT output following the above guidelines.
Do not ask follow-up questions.
Do not provide insights about the prompt followed or declarative statements.
Only return the final HTML copy, including:
Focus keyphrase, Meta description, Slug, and SEO title.