Whenever I start a new chat with claude for code, I give it instructions for how I want it to work with me.

Here's a basic example:

----------------------

Hi Claude! I'm working on[coding project]. We've made great progress, and I want to continue working with you.

PROJECT CONTEXT:

- [technologies]

- [more about the technologies]

- [what I am trying to do]

WORKING PREFERENCES (for me and you to work together):

1. DEVELOPMENT PREFERENCES

1.A. Strongly prefer step-by-step approaches, breaking down complex problems into smaller, manageable pieces

1.B. Like to verify each step before moving to the next one

1.C. Appreciate clear explanations of "why" we're doing something, not just "what" to do

1.D. Learn best through an interactive process where I can ask questions and see results

1.E. Value confirmation of current state before making changes (like checking [tool specific info])

1.F. Prefer to understand potential risks or implications before executing commands

1.G. Like to see the "before and after" state of changes (like checking database structure)

1.H. Appreciate analogies and explanations that connect to broader concepts

1.I. Value clear, direct communication about errors or issues

1.J. Learn well through troubleshooting - using errors as learning opportunities

1.K. Like to work on one feature at a time

1.L. Bias towards action and reversible decisions

1.M. Like clean, minimal code first

1.N. Try to lead with "test driven development", so write tests first

1.O. Enjoy testing things in locally

1.P. Start with a clear, single action

1.Q. Please include verification steps

1.R. Please explain what we expect to see

1.S. Please provide context for why something might have failed

1.T. Please give me space to ask questions before proceeding

1.U. Need to understand database state and impacts across all environments (local, test, production)

1.V. Prefer to see concrete examples of what success looks like before starting

1.W. Like to commit and verify small changes before moving to next steps

1.X. Value understanding both the immediate fix and the underlying concepts

2. TROUBLESHOOTING PREFERENCE

2.A. Prefer to tackle one error at a time

2.B. Like to understand the full error message before proceeding with fixes

2.C. Value seeing the database/application state before and after troubleshooting steps

2.D. Appreciate understanding similar issues that might arise in the future

3. CODE STYLE:

3. A. [programming language specific likes/dislikes]

3. B. [what to include like comments etc]

3. C. [what to not include]

3. D. * Check before generating code *

3. E. Tests should be as simple as possible and only test one thing

[4 - redacted, very specific to the project I'm working on]

5. COMMUNICATION STYLE

5.A Prefer technical explanations broken down into digestible pieces"

5.B Value confirmation of understanding before proceeding"

5.C Appreciate acknowledgment when something is complex or potentially risky"

5.D Like to see the reasoning behind suggested approaches"

6. MY LEARNING STYLE

6.A Learn best through iterative problem-solving"

6.B Value seeing the connection between different parts of the system"

6.C Prefer to understand both the 'happy path' and potential failure modes"

6.D Appreciate real-world analogies and examples"

What do you need from me to get started?

----------------------

Because Claude re-reads the whole chat every time it responds to a chat, once it's in the chat, it keeps all of my preferences in mind every time it responds.

Then when I finish with the task/chat, I ask it what it found helped work with me and what my working style was like. Then, I update the above prompt and ask if anything is missing or if anything would be helpful for the next time we start a chat.

You can also setup a "Project" if you are doing a specific project to serve as a "coding" umbrella if you will. Within the project definition, you can "__Set project instructions__" - which is basically a test box in which you can "Provide Claude with relevant instructions and information for chats within Learnagon. This will work alongside user preferences and selected style in a chat." This is then present within all of the chats with the project.

Since I update my instructions for the coding every single chat based on preferences and what I learned and Claude learned about working with me the previous go around, I find it easier to have a text file that I update and keep track of my prompt so that each new chat gets the updated on.

I saw a new prompting strategy this evening on Twitter/X that I haven't tried, but will try the next time I'm using Claude => https://twitter.com/DaveShapi/status/1861924788761169926

If you try the X one, I'd love to hear your experience :)