<aside>
On this page:
</aside>
<aside>
🧠 Product Docs
🤖 Prompting Tips
💻 Use Cases
📚 Resources
🍄 About Expanse
</aside>
Coding with AI can dramatically accelerate your workflow, but poor prompting habits can lead to problematic code and long and frustrating conversations with the AI. Developing good AI coding habits will save you tokens, time and resources all while receiving fast and valuable AI responses to speed up your coding workflows.
<aside> 🥡
Key Takeaways
Every message you send provides the AI with the information and ‘context’ to generate a relevant response. However, each time you send a message, your entire chat history gets sent too**.** Therefore, longer conversations have a higher likelihood of confusing previous messages/contexts which can cause it to output broken or irrelevant code.
To combat this, keep your Threads concise and start new Threads at the start of every task. This way, you will reduce the likelihood of the AI incorrectly drawing on previous contexts.
If you need to draw on context from previous Threads, ask the AI for a summary at the end of a chat, then refine and reuse it in future conversations. Simply ask the AI to summarize your discussion, copy that summary to a fresh thread, and say "Let's continue from here." See the prompt below.
<aside> 💡
When you need to modify multiple files, or want to compare results, consider Editing the Message and branching the conversations.
Now, you can switch between results while preserving the same context from previous messages.
Giving the AI too much previous context in the form of multiple messages with long blocks of code can cloud it’s ability to generate relevant responses.
To keep your responses focused and relevant, use Expanse in Focus mode, this way, the AI will only respond to the current message sent without interpreting any of the previous messages in the Thread.
You can seamlessly switch modes by toggling the chat/focus button in the top left of the window.
Adjusting an LLM’s temperature controls the creativity of an AI’s responses. Since most coding workflows should not require much “creativity,” you should set your temperature to 0 to produce more focused, concise, and precise outputs.
Adjust your temperature by clicking on the LLM selector and dragging the slider to 0%. You can also set your default temperature by going to Space Settings.
When coding with AI, only share the files directly related to your current task to help the AI focus on what's important.
<aside> 💡
</aside>
"Below is a section of code from my weather app. Please refactor this code: {{CODE}}"
"Please add a feature to display the coordinates of eah location. Output only the new code and let me know where to paste it in the script"
"I think there is a naming error in my code. Please identify the issue and return the correctly named code."
<aside> 💡
</aside>
All the information in your Role gets directly attached to every message you send. This means, all the instructions and context you include in a Role will always be sent to the AI so it doesn’t forget the instructions.