Push Configuration Changes to GitHub

VerifiedCaution

Pushes local configuration changes to a GitHub repository. Checks for a git remote, commits with an optional custom message (defaults to 'Update Claude Code configuration'), and pushes the current branch. Helps when you need to manually sync your Claude Code settings to a remote repository.

Sby Skills Guide Bot
DevelopmentBeginner
6/2/2026
Claude Code
#claude-code#github-sync#configuration#push

Recommended for

Automated summary

This skill pushes local configuration changes for Claude Code to a GitHub repository.

Strengths

  • Automates syncing Claude Code configuration to GitHub.
  • Handles commits with customizable messages.
  • Checks authentication and remote repository existence.
  • Provides a summary of changed files after the push.

Limitations

  • Requires prior setup of a git repository in ~/.claude.
  • Works only with GitHub (no other git hosting services).
  • Depends on the `gh` CLI for some verification steps.
When to use it

Use this skill when you want to back up and version control your Claude Code configuration on GitHub.

When not to use it

Avoid using it if you do not want to version control your configuration or if you use a different git host.

Security analysis

Caution
Quality score85/100

The skill automates pushing local configuration to GitHub using git and gh CLI. While the operations are legitimate and well-contained, they involve network communication and file staging that could accidentally expose sensitive data if misconfigured. No destructive or obfuscated actions are present.

Findings
  • •Runs multiple bash commands including git push, which could publish local files to a remote repository
  • •Uses `git add -A` which stages all changes in ~/.claude, potentially including unintended files
  • •Relies on external CLI tools (gh, git) that may not be available or authenticated
How this analysis is made

Examples

Push with default message
/claude-github-sync:push
Push with custom message
/claude-github-sync:push "Updated settings for new project"

name: push description: Push configuration changes to GitHub

Push Configuration

Push local configuration changes to GitHub.

Usage

/claude-github-sync:push
/claude-github-sync:push "Custom commit message"

Configuration Reference

| Item | Path | Description | |------|------|-------------| | Config file | ~/.claude/sync-config.json | Sync configuration (repo URL, setup method) | | Git remote | ~/.claude/.git/config | Primary check - git origin remote URL | | Sync settings | ~/.claude/settings.sync.json | Shared settings (synced to GitHub) | | Local settings | ~/.claude/settings.local.json | Machine-specific settings (gitignored) | | Merged output | ~/.claude/settings.json | Auto-merged result of sync + local |

Instructions

Step 1: Check git remote (primary check)

The sync is configured if ~/.claude has a git remote. Config file (~/.claude/sync-config.json) is optional fallback.

cd ~/.claude

# Primary check: git remote
REPO_URL=$(git remote get-url origin 2>/dev/null)
if [ -n "$REPO_URL" ]; then
    echo "✅ Remote configured: $REPO_URL"
else
    # Fallback: check config file
    CONFIG_FILE="$HOME/.claude/sync-config.json"
    if [ -f "$CONFIG_FILE" ]; then
        echo "⚠️  Config exists but no git remote"
        echo "Run: /claude-github-sync:setup to fix"
        exit 1
    else
        echo "❌ Not configured"
        echo ""
        echo "Run one of:"
        echo "  /claude-github-sync:setup       - Interactive setup (recommended)"
        echo "  /claude-github-sync:init <url>  - Manual setup with URL"
        exit 1
    fi
fi

Step 2: Verify gh CLI and authentication

# Check if gh CLI is available (for better error messages)
if command -v gh &>/dev/null; then
    if ! gh auth status --hostname github.com &>/dev/null 2>&1; then
        echo "⚠️  GitHub CLI not authenticated"
        echo "   Run: gh auth login"
        echo ""
        echo "Attempting push anyway (may fail)..."
    fi
fi

Step 3: Verify remote repository exists (optional)

# REPO_URL already set in Step 1
# Verify remote exists only if gh CLI is available
if command -v gh &>/dev/null; then
    REPO_PATH=$(echo "$REPO_URL" | sed -E 's|.*github.com[:/]||' | sed 's|\.git$||')

    if ! gh repo view "$REPO_PATH" &>/dev/null 2>&1; then
        echo "⚠️  Cannot verify remote: $REPO_PATH"
        echo "   (May still work if repo exists)"
    fi
fi

Step 4: Stage and commit

Extract optional commit message from $ARGUMENTS. Default: "Update Claude Code configuration"

cd ~/.claude

# Get current branch
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")

# Stage all changes
git add -A

# Check if there are changes to commit
if git diff --cached --quiet; then
    echo "✅ Nothing to push - already in sync"
    exit 0
fi

# Commit with message
MESSAGE="${ARGUMENTS:-Update Claude Code configuration}"
git commit -m "$MESSAGE"
echo "✅ Committed: $MESSAGE"

Step 5: Push to remote

# Push with upstream tracking
if git push -u origin "$BRANCH" 2>&1; then
    echo "✅ Pushed to GitHub ($BRANCH)"
else
    echo ""
    echo "❌ Push failed"
    echo ""
    echo "Troubleshooting:"
    echo "  1. Check authentication: gh auth status"
    echo "  2. Pull first if remote has changes: /claude-github-sync:pull"
    echo "  3. Check network connection"
    echo ""
    echo "For detailed git error, run:"
    echo "  cd ~/.claude && git push -u origin $BRANCH"
    exit 1
fi

Step 6: Show summary

Show what was pushed, including file changes and commit details.

echo ""
echo "📊 Push Summary:"
echo ""
echo "--- Commit ---"
git log --oneline -1
echo ""
echo "--- Files changed ---"
git diff --stat HEAD~1..HEAD 2>/dev/null || echo "  (first commit)"
echo ""
echo "Remote: $REPO_URL"

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/push-configuration-changes-to-github-mm78no1e/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/push-configuration-changes-to-github-mm78no1e' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/push-configuration-changes-to-github-mm78no1e/download' --output '.skill-downloads/push-configuration-changes-to-github-mm78no1e/SKILL.md.part' && mv '.skill-downloads/push-configuration-changes-to-github-mm78no1e/SKILL.md.part' '.skill-downloads/push-configuration-changes-to-github-mm78no1e/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/push-configuration-changes-to-github-mm78no1e/SKILL.md' && test -s '.skill-downloads/push-configuration-changes-to-github-mm78no1e/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/push' && cp -R '.skill-downloads/push-configuration-changes-to-github-mm78no1e' '.claude/skills/push'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/push-configuration-changes-to-github-mm78no1e'

openskills read 'push-configuration-changes-to-github-mm78no1e'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/push-configuration-changes-to-github-mm78no1e/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills