Generate multi-shot prompts of previous requests and successful outputs.
LLMs below Opus produce a surprisingly high rate of malformed bash commands that have to be corrected iteratively or just shown the right way from the beginning using aforementioned multishot prompting.
For claude web app the best way to have the agent remember things is to have it open up a running todo list in an artifact that you ask for it to frequently update.