
Writing documentation with Claude Code (useful, not just generated filler)
Claude Code makes documentation fast. The risk: "faster" can mean "more words, same amount of useful information." Here's how to get docs people actually use. The docstring prompt that works ❌ "Add docstrings to all functions." ✅: Write docstrings for these functions. For each one: - One sentence: what it does (start with a verb) - Parameters: name, type, what it represents (not just the type) - Return value: what it is, not just the type - One example showing a non-obvious use case - Any gotchas: what breaks if you call it wrong Don't restate the function name. Don't describe the implementation. The "don't describe the implementation" constraint is the key one. Most auto-generated docstrings translate code into prose instead of explaining intent. README structure Write a README for this project. 1. What it does (one sentence — what it does for the user, not what it is) 2. Who it's for 3. Quick start (minimum steps to get something working) 4. Configuration reference 5. Common patterns
Continue reading on Dev.to Webdev
Opens in a new tab



