---
title: "Using Anthropic: Best Practices & Large Context Windows — PromptHub"
url: https://stacklist.com/card/42a4daaf-6b33-4c18-9f1f-4f4ee266961b
source_url: "https://www.prompthub.us/blog/using-anthropic-best-practices-parameters-and-large-context-windows"
stack: https://stacklist.com/c/technology/stack/e16dcdcb-06b9-481c-aef9-40b6d73a5c8e
summary: "This guide covers best practices for using Anthropic's Claude 2 model, including its 100k context window, API pricing comparisons with GPT-4, and prompt engineering techniques such as scratchpads and relevant examples. It also details key Anthropic parameters like temperature, top_p, max tokens, and stop sequences, along with findings from experiments on optimizing information recall from large documents."
tags: "anthropic, claude-2, prompt-engineering, large-context-windows, best-practices, llm-parameters, api-pricing"
key_entities: "Anthropic (organization), Claude 2 (technology), OpenAI (organization), GPT-4 (technology), PromptHub (organization), context window (concept), prompt engineering (concept), scratchpad (concept), Claude 1.2 (technology)"
classification: "tutorial"
content_hash: "sha256:81e7f570d6228e43c131084437e488bf59b93d263daef2d3f455b48689e63639"
acp_version: "0.2"
token_counts_approximate: 1827
visibility: public
agent_accessible: true
status: "final"
---

# Using Anthropic: Best Practices & Large Context Windows — PromptHub

Blog Pricing Log in Book Demo Sign up Using Anthropic: Best Practices, Parameters, and Large Context Windows Last updated on January 15, 2025 Contents Since we just integrated Anthropic’s models into PromptHub, I thought it would be good timing to put together a handbook of best practices and other information. The focus will mostly be on Claude 2 given its superior performance. What is Claude 2? Claude 2 is Anthropic’s most performant model, comparable to GPT-4 for OpenAI. Its most notable feature is its 100k context window. To put that in perspective, &#x27;The Great Gatsby,&#x27; is 72k tokens long. This makes Claude 2 a great option when your prompts need a lot of tokens. Maybe you&#x27;re generating long chapters, maybe you&#x27;re feeding in a lot of data. You can try out Claude 2 in a chat window (like ChatGPT) at Claude.ai Is Claude 2 free? You can try out Claude 2 for free via a chat window like ChatGPT at claude.ai . Claude&#x27;s API pricing is listed below. I also put together a quick comparison to GPT-4. Interestingly Claude 2 is much cheaper. GPT-4 (OpenAI) costs per 1,000 tokens: Cost of Prompt: $0.03 Cost of Completion: $0.06 Claude 2 (Anthropic) costs per 1,000 tokens: Cost of Prompt: $0.01102 Cost of Completion: $0.03268 ‍ Here&#x27;s an example breakdown between the 2 models with a prompt of 200 tokens and an output of 1,000 tokens. ‍ Model/Provider Prompt (200 tokens) Completion (1000 tokens) Total Cost Claude 2 (Anthropic) $0.002204 $0.03268 $0.034884 GPT-4 (OpenAI) $0.006 $0.06 $0.066 ‍ Pricing as of September 27, 2024 ‍ Best practices for prompt engineering with Anthropic&#x27;s models Anthropic ran two experiments to evaluate prompting techniques for optimizing Claude’s ability to accurately recall specific information from large (Government) documents. The documents were roughly 75,000 and 90,000 tokens long. They examined prompt performance across a few situtions: Adding examples from the document Adding unrelated examples Using a “scratchpad” ‍ A scratchpad essentially allows the model to jot down its thoughts during the process. ‍ The results ‍ Takeaways Relevant examples plus the scratchpad led to the best performance Instructions should be placed at the end of the prompt, after the long document. This increases the likelihood that the model remembers what its supposed to do. The scratchpad is helpful in helping the model recall relevant information to accomplish the task. This introduces some latency, but faster models like Claude 1.2 shouldn’t be affected too much. Generic examples don’t improve performance. Make sure your examples are contextually relevant. Link to the full study Here are a few other best practices, from Anthropic themselves ( source ): Communicate with Claude using natural language Give examples of your desired output as part of your prompt Use XML &lt;tags&gt; to focus its attention and divide sections Feed Claude the starting words of your desired output using the “Assistant:” notation Break down complex tasks step-by-step and ask Claude to recite the details of the task ‍ A lot of prompting best practices are the same across models. For my info on best practices, check out out guide: 10 Best Practices for Prompt Engineering with Any Model Anthropic Parameters Anthropic shares many of the same parameters as OpenAI. We put together a whole run down on OpenAI&#x27;s parameters, which you can check out here. Max Tokens (integer) Max tokens set the absolute limit on the number of tokens to generate.The model may stop before reaching this maximum. Stop sequences (array of strings) Sequences of text that will cause the model to stop generating text. Temperature (number between 0-1) The amount of randomness in the model&#x27;s outputs. The higher the temperature, the more creative the response will be. Top_p (number) Top_p sets a threshold for token probability, allowing tokens to be selected as the next token in the sequence if their cumulative probability is below this threshold. Don&#x27;t edit Top_p and temperature at the same time. Top_k (integer) Only sample from the top K options for each subsequent token. Used to remove low probability responses. ‍ You can also use metadata and stream to pass data with your request or to receive streamed responses via server-sent events when integrating Anthropic&#x27;s models into your product. Putting Claude 2’s Long Context Window to work with a PromptHub Form Let’s say we operate an apartment services company in New York City. We help tenants and landlords with issues that may arise in their building (burst pipes, rats, etc). Part of our job is being knowledgable of the local laws to accurately determine liability when things go wrong. ‍ Objective We want to create and embed a PromptHub form, powered by Claude 2, onto our site as a lead magnet. This will allow our website visitors to input their property-related questions and get instant legal information regarding who is on the hook for repairs. Claude 2 is perfect for this type of task because we will need to search through various, long, documents to find answers to specific questions. Step 1: Gather information First we will gather the necessary documentation, including local ordinances, building codes, local laws etc. We’ll create a variable for each specific document ( e.g., {{Manhattan_Plumbing_Codes}} ) and simply copy and paste the entire text content into it. ‍ You can insert any type of text data into a variable by copying and pasting the content ‍ Step 2: Write the prompt Next, we’ll write a quick prompt that will power the form. The prompt will consider the user’s question and then read through the documentation to find the specific answer. ‍ ‍ ‍ ‍ Step 3: Configure the Form and deploy! Next, we&#x27;ll configure the form by selecting which variables should be editable and adding instructions and our branding. Once it is looking good, we can flip the switch to deploy it, grab the embed code and it’s ready to go. ‍ A form that can serve as a standalone link or embedded into a site ‍ Conclusion Claude 2’s 100k context window opens up a ton of opportunities for companies and individuals using AI. There are some best practices to keep in mind, but if you’ve been working with OpenAI’s models, your prompts will stay pretty similar. Whether you’re patching together dense legal documents, or leveraging your own data, the combination of Claude 2’s extensive context window and PromptHub’s user-friendly forms can enable you to build powerful AI applications, fast. Dan Cleary Founder Get the week&#x27;s best prompt engineering and AI content Join thousands of AI builders Collaborate with thousands of AI builders to discover, manage, and improve prompts—free to get started. Start for free Schedule a demo More from the PromptHub Blog LLMs Are Eating the Context Layer October 23, 2025 OpenAI DevDay 2025 Roundup: Apps, Agents, and the New AI Stack October 13, 2025 Everything You Need to Know about Claude 4.5 October 2, 2025 Product Resources Prompt Chaining Latency Newsletter Evaluations Customers Prompt Versioning Documentation Forms Live Sessions Chat Testing Blog Prompt Generator LLM Model Directory Prompt Enhancers PromptLab Batch Testing Weekly newsletter Pipelines © 2025 Tethered Software Inc. Terms of Service Privacy Policy
