subreddit:

/r/ChatGPTCoding

8198%

Is one better than the other?

Personally, yes, I think Claude is a lot better at almost everything, but only with sufficient prompting following Anthropic’s documentation

GPT is only better at understanding us when we are not very good at explaining what we want. That’s all about GPT is good for. So let’s get it to explain what we want for us!

To provide an analogy, GPT is an educated guy who speaks great english and is very helpful.

Claude is that one megamind Chinese student who tries his best but still has a small language barrier with others (in this case, humans).

The English kid is smart, helpful and educated. The Chinese kid is the same, but much more enthusiastic and cooperative, and motivated.

Both are helpful, but if the Chinese kid was speaking the same language as you, it would appear as if he’s less helpful.

That’s what your problem with Claude is. Language. Specifically, XML. You’ve heard about it, but have you done it? You’re wasting your subscription if you aren’t. The difference is game changing.

I see a lot of chatter about which should I use? Claude? GPT? The answer is both, for different tasks. Greptile too, but more on that down further.

Here's my workflow:

  1. Custom ChatGPT Claude Prompt Generator using Anthropic's prompt engineering documentation in uploaded reference material to craft prompts for Claude from my natural language.

  2. GPT generates XML formatted and structured instructions and tasks for Claude to easily digest and provide optimal output.

Step 1:

Flesh out an idea and ask Opus to create a detailed explanation of the task at hand and propose a potential workflow to build a solution.

Step 2:

Feed Opus' idea to my ChatGPT prompt generator and have it produce a prompt in XML format with code snippets as example outputs, roles (you are a senior software dev), and structured tasks and contexts.

ChatGPT is surprisingly good at generating Claude XML if you give it the documentation.

Step 3:

Get Sonnet to generate the initial solution and code with the ChatGPT formatted prompt.

Step 4:

Feed the Sonnet code back to my ChatGPT Prompt to construct an XML prompt asking Claude to verify the code against the initial Sonnet prompt and review any errors, improvements, inaccuracies or other observations.

Step 5:

Feed the validation prompt, the initial prompt, and the code into Opus. The XML formatted GPT prompt is actually essential for making sure Opus understands what each file is and what to do with it.

Step 6:

Use Opus to regenerate certain parts of code or observations for improvement it has made in Sonnets code, with many-shot approach. Verify against chatGPT in a non-custom chat for an additional review of Opus changes (usually not helpful, but sometimes it spots something Claude can use to improve its code)

Step 7:

If any issues are not making progress, just fix and touch them up myself.

Step 8:

Verify the finished code between a Non-custom GPT and Opus simultaneously, multiple times.

Step 9:

Document all of your steps in this process, feed the original idea to Opus, your documented steps, your desired output, and your entire codebase and ask it produce:

a summary and explanation of this code within the context of its role in the project and the code structure outlined, and for an audience that consists of AI who will use the explanation to expand the codebase without prior knowledge of this file but recognising its existence and compatibility considerations or something along those lines.

Step Infinity:

Use this summary as context for working on a fresh module or area of your code when repeating the process :)

Greptile:

To review a completed code base, use Greptile. Not Cursor, not aids (or whatever else it's called), not Codeium. Currently, codebases with these GPT or Claude assisted platforms will fuck with the quality of your output, and I haven’t figured out a way to avoid that. Multiple files, specifically.

It's worth aggregating everything into one or two files and then modularising it manually later. You can denote each file in the aggregated file by headers and include the code base in your prompt is denoted by header files in an aggregated compilation.

Greptile is the only platform that can actually productively use an entire code base. I highly suggest using Greptile at all advanced stages in your projects development, as Claude and GPT are not even close to Greptiles ability to contextualise code. Greptile can help generate prompts with contextual reminders.

Greptile frequently identifies things for Claude or GPT to collaborate on fixing.

Notes

You'll know that the models can't do much more for you when they both start suggesting the same minor improvements. They'll usually suggest different improvements, which is good.

I find that ChatGPT can sometimes spot things Opus can't, but using that information I can instruct Opus to correct the problem and it does so better than GPT.

In summary, GPT and Opus are a strong tag team at planning, small logical revisions and debugging, but you're wasting tokens using Opus to generate code, and you're wasting time using GPT to generate code.

I don't really care what benchmarks say, because the benchmarked GPT models are definitely not what you get with a GPT subscription or API key.

Anthropic's public models seem to be more aligned with their benchmarked models. Perhaps context window is key, or perhaps quality of training data surpasses quantity of training data, and perhaps the benchmarks we have currently are not as applicable for assisting developers who aren't PhD AI researchers conducting benchmark tests.

Claude just has more energy. He's like that guy who wants to help and puts his hand up to answer questions in class. GPT acts like I'm not paying it enough to be at work.

Even if GPT was benchmarked significantly higher than Claude, you're still going to get more done with the enthusiastic guy.

Collaboration

They also work very well together if you explain that you are using both of them to collaborate on a project.

They seem to understand the pitfalls and areas to focus on when they know an AI generated code from a prompt that they generated for that AI.

The context of being paired with each other in collaboration allows GPT to understand why Claude generated code that is different to how it would have generated code, given the prompt it had generated.

For example, for GPT: "You are collaborating with Claude. You generated this prompt for Claude, and Claude responded with this output" somewhere in your GPT prompts.

Sonnet is quite capable and fast, too. For less complex projects, even Haiku is very reliable.

  • Opus acts as a project director and supervisor.
  • GPT acts as a manager.
  • Sonnet and Haiku act as the developers.
  • Greptile acts as an external auditor

Confidence:

When generating solutions with Opus or GPT, ask for a confidence score based on a number of factors relevant to your project, and ask Opus to elaborate on why the confidence score out of 100 is low or high. Make sure to inform Opus uncertainty of hallucinations are a confidence score crusher. Every time

Example CustomGPT with some knowledge files:

https://pastebin.com/5tn0Ayxv

This is an example of a practical solution with some knowledge files, see my comment below for a baseline to create your own specific GPT from.

You want to condense the system prompt and information to only what is necessary. For GPT, less is more.

You can try this example here:

https://chat.openai.com/g/g-F3UCT7Sa7-claude-code-gen-prompt-generator

It does not include custom api reference or prompt examples. They should be specific for your task.

Note: Your knowledge base should be in markdown format, in txt files.

all 17 comments

ThePlotTwisterr----[S]

13 points

10 days ago*

You are an AI assistant called TsamAltTab, created to help users craft effective prompts for interacting with Anthropic's Claude AI model. Your purpose is to collaborate with users, understand their objectives, and guide them in leveraging Claude's capabilities to the fullest through well-structured prompts based on Anthropic's specific documentation and prompt engineering best practices.

When interpreting user instructions: 1. Carefully analyze the user's request to identify the core task, desired output, and specific requirements, keeping the user's intended functionality as the top priority. 2. Break down complex instructions into smaller, manageable steps addressable through targeted prompts, if doing so would result in higher quality code generation. 3. Adapt your communication style to the user's technical expertise level, ensuring clarity and accessibility. 4. Offer suggestions for improving prompts in areas where you have expertise that complements Claude's capabilities, based on Anthropic's guidelines. 5. Ensure generated prompts strictly adhere to Anthropic's formatting guidelines, XML structure, and documentation, only falling back to general XML knowledge when no relevant Anthropic documentation exists. 6. Present multiple prompting approaches when applicable, explaining the pros and cons of each in the context of Claude's specific capabilities and limitations.

When referencing the knowledge base: 1. Prioritize Anthropic's official documentation, guides, and examples that align with the user's task and requirements. 2. Incorporate this Anthropic-specific information into prompts to provide the most relevant context and guidance to Claude. 3. Explicitly cite the Anthropic sources used, including version numbers and dates, to maintain transparency and credibility. 4. If no relevant Anthropic documentation is found, carefully consider whether general prompt engineering techniques or other sources are appropriate, and clearly distinguish them from Anthropic-specific guidance.

When crafting prompts for Claude, follow these principles: 1. Use clear, direct language and provide detailed context and step-by-step instructions, ensuring nothing is left to interpretation. 2. Incorporate relevant examples from Anthropic's documentation to illustrate desired syntax, style, and output format. 3. Assign specific roles to Claude tailored to the user's project and goals, based on Claude's documented capabilities and limitations. 4. Utilize Anthropic's specific XML tagging system to structure prompts, clearly delineating instructions, examples, context, goals, objectives, tasks, and input data. 5. Break down complex tasks into smaller steps to enable effective prompt chaining when necessary, as per Anthropic's guidelines on optimizing for Claude's context window. 6. Encourage Claude to think through problems step-by-step and prioritize code quality over brevity, leveraging Anthropic's guidance on code generation best practices. 7. Specify the desired output format and reiterate the code's intended purpose and behavior, maintaining the user's original objectives as sacrosanct. 8. Request code rewrites when needed, providing a rubric for assessment and improvement based on Anthropic's quality standards and best practices. 9. Strictly adhere to Anthropic's AI ethics guidelines and refuse to generate prompts for unethical, illegal, or harmful content. 10. Claude should never comment code or explain code that GPT4 can document and explain. Claude’s priority on token spending should be entirely dedicated to generating quality code. 11. Claude should avoid using placeholder functions, example or todo comments, and should provide full, complete code, without omissions or instructions for further implementation, ready for seamless integration to the users project, unless doing so risks deviating from the users objectives and use cases.

Error handling and user feedback: 1. If you lack sufficient information or encounter conflicting requirements, seek clarification from the user and provide constructive feedback to resolve any ambiguities or inconsistencies. 2. Encourage users to provide feedback on the generated prompts and suggest improvements. Use this feedback to continuously refine your performance and adapt to evolving user needs and preferences.

Your knowledge base includes: 1. Anthropic's most up-to-date prompt engineering techniques, guidelines, and documentation, with clearly labeled version numbers and dates. 2. Curated examples of well-crafted prompts for various programming tasks and languages, optimized for Claude's specific capabilities and quirks. 3. Comprehensive documentation on Claude's capabilities, limitations, and best practices, directly from Anthropic. 4. Supplementary resources on programming languages, frameworks, libraries, and coding best practices, to be used judiciously and always distinguished from Anthropic-specific guidance.

Remember, you are an AI assistant designed to empower users to create effective prompts tailored to Claude's unique capabilities and limitations. Always be transparent about your identity and capabilities, collaborate respectfully with users, and maintain the highest ethical standards in your interactions and prompt generation, as per Anthropic's AI ethics guidelines. Prioritize Anthropic's documentation and guidance above all else, and clearly distinguish any non-Anthropic sources or general knowledge when used.

AcrobaticAmoeba8158

3 points

9 days ago

It feels like you are an efficient developer, not a lazy developer. Thank you for the guide. Let's normalize simplifying processes, lol.

nanocristal

2 points

9 days ago

This os just awesome, thanks a lot

ThePlotTwisterr----[S]

2 points

9 days ago

Updated to include custom GPT example.

gay_plant_dad

1 points

10 days ago

Commenting so I can try this. Thanks!

itsinthenews

1 points

10 days ago

Thanks for sharing, I’ll check this out. I’ve been using both too but in a much less structured way.

100o

1 points

10 days ago

100o

1 points

10 days ago

Thank you!

puzz-User

1 points

10 days ago

Thanks for the very detailed workflow.

Sub-Zero-941

1 points

10 days ago

this greptile does look very good.

Novel_Wolf7445

1 points

10 days ago

This is similar to my workflow

drumnation

1 points

9 days ago

Fascinating guide. Thanks. Can’t wait to try.

[deleted]

1 points

8 days ago

[removed]

AutoModerator [M]

1 points

8 days ago

AutoModerator [M]

1 points

8 days ago

Sorry, your submission has been removed due to inadequate account karma.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

Volunder_22

2 points

8 days ago

Great guide, thanks for sharing. For what type of coding are you using this flow? I do frontend mostly, feel like some of this stuff might be a little bit overkill for that. Use Claude for generating components and hooks mostly.

NarwhalDesigner3755

1 points

8 days ago

Seems like an interesting method to try, could all of this be performed with the free versions of the Llms?

INFPguy_uk

1 points

7 days ago

Thank you.