
Set Up Claude Code
Use Anthropic's Claude directly in RiteMark's terminal for powerful document editing.
Claude Code is Anthropic's official CLI tool. It works exceptionally well with RiteMark because it can read and edit markdown files directly.
What You'll Get
After setup, you can:
- Ask Claude to edit your documents in natural language
- Restructure, expand, or rewrite entire sections
- Have Claude work on multiple files at once
- See changes appear live in your editor
Installation
Step 1: Install Claude Code
Open RiteMark's terminal (View → Terminal or Ctrl+`) and run:
npm install -g @anthropic-ai/claude-code
Or if you use Homebrew:
brew install claude-code
Step 2: Configure API Key
Get your API key from Anthropic Console:
- Create an account or sign in
- Go to API Keys
- Create a new key
- Copy the key (starts with
sk-ant-)
Set the key in your terminal:
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
To make it permanent, add to your ~/.zshrc:
echo 'export ANTHROPIC_API_KEY="sk-ant-your-key-here"' >> ~/.zshrc
source ~/.zshrc
Step 3: Verify
claude --version
Should show the installed version.
Basic Usage
Edit Current Document
With a document open in RiteMark:
claude "make this document more concise"
Claude Code detects the current file and edits it.
Edit Specific File
claude "in notes.md, add a summary section at the top"
Multiple Operations
claude "reorganize proposal.md: move conclusions to the end, add an executive summary"
Practical Examples
Polish Writing
claude "review draft.md and improve the writing style. Make it more professional."
Expand Content
claude "in blog-post.md, expand the 'Benefits' section with 3 more bullet points"
Restructure
claude "convert meeting-notes.md from paragraphs into a structured outline with headers"
Add Sections
claude "add a FAQ section to readme.md based on the content"
Fix Formatting
claude "clean up the markdown formatting in report.md"
Tips for Best Results
Be Specific
| Instead of | Say |
|---|---|
| "improve this" | "make the introduction more engaging" |
| "fix it" | "fix the bullet point formatting in the Features section" |
| "make it better" | "simplify the language for a non-technical audience" |
Reference the File
Always include the filename when you have multiple files open:
claude "in project-plan.md, add timeline estimates"
Review Before Committing
Claude Code can make significant changes. Review the diff before moving on:
git diff # if using version control
Use Version Control
Git is your safety net:
git add .
git commit -m "before AI edits"
# run claude commands
git diff # review changes
git commit -m "AI: improved writing" # or git checkout . to undo
Common Workflows
Writing a Document
- Create rough outline manually
- Ask Claude to expand sections
- Use built-in AI assistant for fine-tuning
- Manual polish and review
Editing Existing Work
- Commit current version (git)
- Ask Claude for improvements
- Review changes
- Iterate or revert
Converting Formats
# Notes to blog post
claude "convert notes.md into a blog post format with introduction and conclusion"
# Meeting notes to action items
claude "extract action items from meeting.md into a task list"
# Draft to email
claude "convert this draft into a professional email format"
Troubleshooting
"Command not found: claude"
# Check installation
which claude
# Reinstall if needed
npm install -g @anthropic-ai/claude-code
"Invalid API key"
# Check your key is set
echo $ANTHROPIC_API_KEY
# Reset if needed
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
"Rate limit exceeded"
Wait a few minutes and try again. Consider upgrading your Anthropic plan for higher limits.
Changes Not Appearing
- Save the file in RiteMark (Cmd+S)
- Or wait for auto-reload (1 second)
- Or reload window (Cmd+Shift+P → Reload Window)
Comparison with Built-in AI
| Task | Best Tool |
|---|---|
| Quick rephrase | Built-in AI Assistant |
| Full document rewrite | Claude Code |
| Add new section | Claude Code |
| Fix single paragraph | Built-in AI Assistant |
| Structural changes | Claude Code |
| Grammar fixes | Built-in AI Assistant |
Use both! They complement each other.
Cost
Claude Code uses your Anthropic API credits. Costs depend on:
- Document length (input tokens)
- Response length (output tokens)
- Model used (Claude 3.5 Sonnet default)
Typical document edit: $0.01-0.10
Check usage at Anthropic Console.
Related
- Terminal AI Integration - Overview of terminal AI
- AI Assistant - Built-in chat sidebar
- Getting Started - RiteMark basics