Free courses
Claude, Gemini and ChatGPTIntermediateFree
Working with Claude: Prompting, Projects and API
Write prompts that tell Claude exactly what you need, organise repeated work with Projects, and call the API from Python. You will build a command-line tool that summarises a text file with your own prompt.
6 lessons 35 minNo account needed
Start lesson 1What you will learn
- Write prompts that give Claude the role, task and output format.
- Use Projects to store files and instructions for a repeating task.
- Call the Claude API from a Python script and read the response.
- Adjust API parameters such as temperature and maximum output tokens.
- Build a command-line tool that summarises a text file with your prompt.
Before you start
- Use a computer and a web browser
- Write and run a simple Python script
- Use a terminal or command prompt
Lessons
- Lesson 1: Write a first prompt in Claude chatAsk Claude to explain a short technical text and read the answer to see how the model responds to a simple request.5 min
- Lesson 2: Give Claude a role, task and output formatImprove that prompt by telling Claude who it is, what to produce, and how to format the result, then test it on the same text.5 min
- Lesson 3: Store context in a ProjectCreate a Project, add your improved prompt as project instructions, and upload the text file so repeated requests use the same background.5 min
- Lesson 4: Call the API with a Python scriptSend your refined prompt to the Claude API from a Python script and print the model's text response.7 min
- Lesson 5: Add parameters and read a fileAdd parameters for temperature and maximum output length, and read the text to summarise from a file path given on the command line.6 min
- Lesson 6: Build your summariser toolCombine the prompt, file handling and API call into a single script that takes a file path and prints a summary.7 min