Getting Started

Set up ContextMark and start syncing your Claude Code contexts in minutes.

Step 1: Install ContextMark

$ npm install -g @grazulex/contextmark

Requires Node.js 18 or higher.

Step 2: Initialize Your Library

$ contextmark init-library
✓ Created ~/.contextmark
✓ Created config.yml
✓ Created projects/, blocks/, profiles/, global/

This creates your context library at ~/.contextmark. All your configs will be stored here.

Step 3: Register a Project

$ cd ~/projects/my-project
$ contextmark init
✓ Project registered
✓ Created .contextmark.yml

This registers your project with ContextMark. If you have an existing CLAUDE.md, it will be kept as-is.

Step 4: Push to Library

$ contextmark push
✓ Pushed to library:
✓ CLAUDE.md
✓ .claude/

Your project's CLAUDE.md and .claude/ directory are now saved in the library.

Step 5: Pull on Another Machine

# After a fresh clone or on another machine:
$ cd ~/projects/my-project
$ contextmark pull
✓ Restored from library:
✓ CLAUDE.md
✓ .claude/

Instantly restore your Claude Code context from the library.

Step 6: Sync Global Config

# Sync your global ~/.claude/ config:
$ contextmark push --global
✓ Pushed global config to library
 
# On another machine:
$ contextmark pull --global
✓ Restored global config

Use --global to sync your global Claude config (CLAUDE.md, rules/, skills/) across machines.

Step 7: Check Status & Diff

$ contextmark status
my-project: synced
 
$ contextmark diff
Comparing local vs library...
CLAUDE.md: identical

Check sync status and compare local files with the library at any time.

Step 8: Sync Library via Git

# Push library changes to remote:
$ contextmark sync push
✓ Committed and pushed to remote
 
# Pull library changes from remote:
$ contextmark sync pull
✓ Pulled latest from remote

Use sync push/pull to keep your library synchronized across machines via Git.

Advanced: Blocks & Profiles

For power users who want to compose contexts from reusable blocks:

# Create reusable blocks:
$ contextmark block create laravel/base
$ contextmark block create style/code
 
# Create a profile combining blocks:
$ contextmark profile create my-stack
 
# Initialize project with profile:
$ contextmark init --profile my-stack
✓ Generated CLAUDE.md with 2 blocks

Blocks and profiles are optional. Use them when you need to compose contexts from modular pieces.

Next Steps