Thank you for your interest in contributing to Claude Code Sync! This document provides guidelines for contributing to the project.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/claude-code-sync.git - Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Test your changes thoroughly
- Submit a pull request
- Follow existing bash script conventions
- Use
set -efor error handling - Always save and restore
ORIGINAL_DIRin scripts - Use configuration variables from
lib-claude-sync.sh(never hardcode paths) - Add helpful error messages with next steps
- Include
--versionsupport in new commands
Before submitting a PR, test on:
- Fresh install (no
~/.claudeexists) - Existing conversations (merge scenario)
- With encryption enabled
- With non-standard
CLAUDE_DATA_DIR
When adding new commands:
- Source
lib-claude-sync.shfor configuration - Add
--versionflag support (check existing commands for pattern) - Save/restore
ORIGINAL_DIR(return user to starting directory) - Use
$CLAUDE_DATA_DIRinstead of hardcoded~/.claude - Make script executable:
chmod +x claude-new-command - Update
README.mdwith command documentation - Update
CLAUDE.mdwith development notes - Update
CHANGELOG.mdwith changes
Always use these variables from config:
$CLAUDE_DATA_DIR- Claude's data directory$CLAUDE_SYNC_REMOTE- Git remote URL$CLAUDE_SYNC_BRANCH- Git branch$CLAUDE_SYNC_ENCRYPTION- Encryption enabled?$CLAUDE_BACKUP_RETENTION_DAYS- Backup retention$CLAUDE_SYNC_VERBOSE- Verbose output
- Update
README.mdfor user-facing changes - Update
CLAUDE.mdfor development context - Update
CHANGELOG.mdfor all changes - Include examples in documentation
This project uses Semantic Versioning (SemVer):
- MAJOR: Breaking changes (incompatible API changes, config format changes)
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes and small improvements
We provide a helper script to streamline the release process:
git status
# Commit any pending changes firstFor patch release (bug fixes):
./claude-release patchFor minor release (new features):
./claude-release minorFor major release (breaking changes):
./claude-release majorOr specify exact version:
./claude-release 1.2.3The claude-release script will:
- Read current version from
VERSIONfile - Calculate or use the new version number
- Update
VERSIONfile - Add new section to
CHANGELOG.md - Prompt you to edit the changelog
- Create a git commit:
Release vX.Y.Z - Create a git tag:
vX.Y.Z
Edit CHANGELOG.md to document changes in the new release:
## [1.2.0] - 2026-01-15
### Added
- New feature X that does Y
- Support for platform Z
### Changed
- Improved performance of sync operation
- Updated documentation for clarity
### Fixed
- Fixed bug where X would fail when Y
- Corrected typo in error message# Push commits and tags
git push origin master --tagsUsing GitHub CLI:
gh release create v1.2.0 \
--title "Version 1.2.0" \
--notes-file CHANGELOG.mdOr manually on GitHub:
- Go to https://github.com/porkchop/claude-code-sync/releases/new
- Select the tag you just created
- Copy the changelog section for this version
- Publish release
If you prefer to release manually:
-
Update VERSION file:
echo "1.2.0" > VERSION
-
Update CHANGELOG.md: Add new section at the top with today's date and changes
-
Commit changes:
git add VERSION CHANGELOG.md git commit -m "Release v1.2.0" -
Create tag:
git tag -a v1.2.0 -m "Version 1.2.0" -
Push:
git push origin master --tags
1.0.0→1.0.1(patch): Bug fix in backup script1.0.0→1.1.0(minor): Added new commandclaude-migrate-project1.0.0→2.0.0(major): Changed config file format (breaking change)
Before releasing:
-
Test on clean system:
# Remove existing setup rm -rf ~/.claude-sync-test # Test fresh installation
-
Test version flag:
./claude-sync-push --version ./claude-backup --version # Should show new version -
Test existing workflows:
- Fresh setup
- Sync with encryption
- Backup and restore
- Multi-machine sync
Use conventional commit format:
feat: add support for Windows WSLfix: correct tar exclusion for custom data dirdocs: update configuration examplesrefactor: simplify encryption key handling
Include:
- What: Brief description of changes
- Why: Reason for the change
- How: How you implemented it
- Testing: How you tested it
## What
Adds support for Windows WSL platform.
## Why
Many users run Claude Code in WSL and want to sync conversations.
## How
- Added WSL detection in configuration
- Updated documentation with WSL-specific instructions
- Added git-crypt installation for Ubuntu on WSL
## Testing
- Tested on WSL 2 with Ubuntu 20.04
- Verified sync works between WSL and native Linux
- Tested encryption key restorationAll PRs require:
- No breaking changes (unless major version bump)
- Tests pass (manual testing currently)
- Documentation updated
- Code follows existing style
- Scripts return to original directory
- Helpful error messages
- Open an issue: https://github.com/porkchop/claude-code-sync/issues
- Read the docs: https://github.com/porkchop/claude-code-sync#readme
- Check CLAUDE.md for development context
By contributing, you agree that your contributions will be licensed under the MIT License.