|
| 1 | +--- |
| 2 | +title: "Claude Code setup" |
| 3 | +description: "Configure Claude Code for your documentation workflow" |
| 4 | +icon: "asterisk" |
| 5 | +--- |
| 6 | + |
| 7 | +Claude Code is Anthropic's official CLI tool. This guide will help you set up Claude Code to help you write and maintain your documentation. |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +- Active Claude subscription (Pro, Max, or API access) |
| 12 | + |
| 13 | +## Setup |
| 14 | + |
| 15 | +1. Install Claude Code globally: |
| 16 | + |
| 17 | + ```bash |
| 18 | + npm install -g @anthropic-ai/claude-code |
| 19 | +``` |
| 20 | + |
| 21 | +2. Navigate to your docs directory. |
| 22 | +3. (Optional) Add the `CLAUDE.md` file below to your project. |
| 23 | +4. Run `claude` to start. |
| 24 | + |
| 25 | +## Create `CLAUDE.md` |
| 26 | + |
| 27 | +Create a `CLAUDE.md` file at the root of your documentation repository to train Claude Code on your specific documentation standards: |
| 28 | + |
| 29 | +````markdown |
| 30 | +# Mintlify documentation |
| 31 | + |
| 32 | +## Working relationship |
| 33 | +- You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so |
| 34 | +- ALWAYS ask for clarification rather than making assumptions |
| 35 | +- NEVER lie, guess, or make up information |
| 36 | + |
| 37 | +## Project context |
| 38 | +- Format: MDX files with YAML frontmatter |
| 39 | +- Config: docs.json for navigation, theme, settings |
| 40 | +- Components: Mintlify components |
| 41 | + |
| 42 | +## Content strategy |
| 43 | +- Document just enough for user success - not too much, not too little |
| 44 | +- Prioritize accuracy and usability of information |
| 45 | +- Make content evergreen when possible |
| 46 | +- Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason |
| 47 | +- Check existing patterns for consistency |
| 48 | +- Start by making the smallest reasonable changes |
| 49 | + |
| 50 | +## Frontmatter requirements for pages |
| 51 | +- title: Clear, descriptive page title |
| 52 | +- description: Concise summary for SEO/navigation |
| 53 | + |
| 54 | +## Writing standards |
| 55 | +- Second-person voice ("you") |
| 56 | +- Prerequisites at start of procedural content |
| 57 | +- Test all code examples before publishing |
| 58 | +- Match style and formatting of existing pages |
| 59 | +- Include both basic and advanced use cases |
| 60 | +- Language tags on all code blocks |
| 61 | +- Alt text on all images |
| 62 | +- Relative paths for internal links |
| 63 | + |
| 64 | +## Git workflow |
| 65 | +- NEVER use --no-verify when committing |
| 66 | +- Ask how to handle uncommitted changes before starting |
| 67 | +- Create a new branch when no clear branch exists for changes |
| 68 | +- Commit frequently throughout development |
| 69 | +- NEVER skip or disable pre-commit hooks |
| 70 | + |
| 71 | +## Do not |
| 72 | +- Skip frontmatter on any MDX file |
| 73 | +- Use absolute URLs for internal links |
| 74 | +- Include untested code examples |
| 75 | +- Make assumptions - always ask for clarification |
| 76 | +```` |
0 commit comments