Here are some fun ways to use your Claude CLI at the hackathon!
python cli.py ask "What's wrong with this code: def hello() print('hi')"python cli.py ask "Explain APIs like I'm 5 years old"python cli.py ask "Give me 5 unique hackathon project ideas using AI"python cli.py ask "I'm getting 'TypeError: 'str' object is not callable'. What does this mean?"python cli.py ask "Show me Python code to read a CSV file"Help beginners learn by reviewing their code!
How to build:
- Read code file with
analyze_file() - Ask Claude to review it
- Show suggestions for improvement
Example command:
python cli.py analyze mycode.pyQuiz yourself on any topic!
How to build:
- Add a
quizcommand - Ask Claude to generate questions
- Check answers and give feedback
Example:
python cli.py quiz "Python basics"Create stories from prompts!
How to build:
- Add a
storycommand - Send creative writing prompts to Claude
- Save output to file
Example:
python cli.py story "A robot who learns to paint"Translate text or code comments!
How to build:
- Add a
translatecommand - Specify source and target language
- Use Claude for natural translation
Example:
python cli.py translate "Hello world" --to spanishGet recipes from ingredients!
How to build:
- Add a
recipecommand - List available ingredients
- Claude suggests recipes
Example:
python cli.py recipe "chicken, rice, tomatoes"Generate good git commit messages!
How to build:
- Read
git diffoutput - Ask Claude to write a commit message
- Copy to clipboard
Example:
python cli.py commitdef teach(self, topic):
"""Teach a topic step by step"""
system_prompt = """You are a patient teacher who explains things clearly.
Use simple language and lots of examples. Break complex topics into small steps."""
question = f"Teach me about {topic}. Start with the basics."
return self.ask(question, system_prompt)def explain_code(self, code):
"""Explain what code does line by line"""
question = f"""Explain this code line by line in simple terms:
{code}
Format:
Line 1: [explanation]
Line 2: [explanation]
etc.
"""
return self.ask(question)def interview_practice(self, topic):
"""Practice interview questions"""
system_prompt = """You are a friendly interviewer. Ask one question at a time.
After each answer, give constructive feedback."""
question = f"Ask me an interview question about {topic}"
return self.ask(question, system_prompt)def summarize_url(self, url):
"""Summarize content from a URL"""
# You'd need to fetch the content first (using requests library)
# This is just the Claude part:
system_prompt = "Summarize in 3 bullet points. Be concise."
question = f"Summarize this:\n\n{content}"
return self.ask(question, system_prompt)- Use
speech_recognitionlibrary - Speak questions to Claude
- Use text-to-speech for responses
- Integrate with Slack API
- Answer team questions automatically
- Schedule reminders
- Fetch PR diffs from GitHub
- Ask Claude to review changes
- Post comments automatically
- Respond to Discord messages
- Answer questions in your server
- Moderate conversations
- Use Flask to create REST API
- Accept questions via HTTP
- Return Claude's responses as JSON
You: python cli.py chat
You: I'm new to Python. What's a variable?
Claude: A variable is like a labeled box where you can store information...
You: Can you show me an example?
Claude: Sure! Here's a simple example:
name = "Alice"
age = 25
...
You: What about lists?
Claude: Lists are collections of items...
You: python cli.py ask "Why does 'name = input()' wait forever?"
Claude: The input() function waits for you to type something and press Enter.
It's not frozen - it's waiting for your input! Try typing something and pressing Enter.
You: python cli.py chat
You: I want to build a todo app. Where do I start?
Claude: Great choice! Here's a simple roadmap:
1. Start with basic file storage (save todos to a text file)
2. Add commands: add, list, complete, delete
3. Later: add dates, priorities, etc.
You: How do I save to a file?
Claude: Use Python's built-in file operations...
Try these in your code to give Claude different personalities:
system_prompt = "You are an expert programmer with 20 years of experience. Give detailed, professional advice."system_prompt = "You are a friendly, encouraging mentor. Use simple language and lots of positive reinforcement."system_prompt = "You are a code reviewer who points out problems and suggests improvements. Be thorough but constructive."system_prompt = "You are a creative writer. Make responses engaging, vivid, and imaginative."system_prompt = "Explain everything like I'm 5 years old. Use simple words and fun analogies."- "Explain Python decorators with a simple example"
- "Review this function and suggest improvements: [code]"
- "Generate 5 test cases for a login function"
- "What's the difference between a list and a tuple in Python?"
- "Help me"
- "Code"
- "Explain programming"
- "What should I do?"
- Be specific: The more details, the better the response
- Provide context: Mention your skill level or what you've tried
- Ask for examples: "Show me an example" gets you working code
- Iterate: Ask follow-up questions to dig deeper
- Set the format: "Explain in 3 steps" or "Give me bullet points"
Try building these during your hackathon:
- Fortune Teller: Ask Claude to predict your coding future
- Haiku Generator: Generate haikus about programming
- Code Golf: Ask for the shortest possible solution
- Rubber Duck: Explain your code problems out loud to Claude
- Time Traveler: Ask "What was programming like in 1990?"
- Cool UI: Add colored terminal output (use
coloramalibrary) - Progress Bars: Show thinking status (use
tqdm) - Save History: Keep a log of all conversations
- Export Results: Save responses to markdown files
- Add Emojis: Make it fun and visual!
Example with colors:
from colorama import Fore, Style
print(f"{Fore.GREEN}β Success!{Style.RESET_ALL}")
print(f"{Fore.RED}β Error!{Style.RESET_ALL}")Remember: The best hackathon project is one that solves a problem YOU have!
What frustrates you? What would make your life easier? Build that! π