Skip to content

Commit

Permalink
Add CLAUDE.md to document critical file operation requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdots committed Dec 4, 2024
1 parent 549f65b commit bea5054
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Critical Operational Requirements for Claude

This document outlines critical operational requirements when using Claude to interact with this repository through the GitHub API.

## File Operations

### Use `push_files` Instead of `create_or_update_files`

- ALWAYS use the `push_files` function for file operations
- The `create_or_update_files` function is currently non-functional and should not be used
- Example:
```json
{
"command": "push_files",
"owner": "wrale",
"repo": "wrale-charts",
"branch": "main",
"message": "Update documentation",
"files": [{"path": "docs/example.md", "content": "Full content here..."}]
}
```

### Never Use Content Placeholders

- ALWAYS include the complete file content when pushing changes
- NEVER use placeholders that point to old content (e.g., "..." or "rest of file remains the same")
- If you use placeholders, the pointed-to content will be overwritten and lost
- Data loss would require manual recovery from older commits

### Single File Operations

- Push only ONE file per MCP call
- This helps prevent hitting maximum message length limits
- Breaking up multi-file changes into individual pushes prevents having to restart entire operations
- If multiple files need updating, make separate push_files calls for each

## Best Practices

1. Before modifying a file:
- Always fetch the current content first
- Review the entire file content
- Keep track of the full context

2. When pushing changes:
- Include complete file content
- Use clear, descriptive commit messages
- Verify content before pushing

3. For multi-file changes:
- Plan the sequence of updates
- Push files one at a time
- Verify each push completes successfully

These requirements help maintain data integrity and prevent accidental data loss when Claude interacts with the repository.

0 comments on commit bea5054

Please sign in to comment.