Skip to content

feat: Full Claude Code CLI integration #1

@adsathye

Description

@adsathye

Summary

Synctx currently has full GitHub Copilot CLI integration but only partial Claude Code CLI support. Session data syncing (staging, secret scanning, push) works for Claude Code CLI directories, but several features are missing or incomplete compared to the Copilot CLI experience.

Current State

Feature Copilot CLI Claude Code CLI
Session file staging & sync Done Done
Secret scanning (Gitleaks) Done Done
Automatic hooks (5 events) Done Partial (2 via setup.js)
hooks.json integration Done Not available
Restore + auto-launch Done Restore only, no launch
current keyword Done Not supported (hardcoded to Copilot)
/resume flow Done No equivalent in Claude Code CLI
Standalone install (no Copilot) N/A Blocked (Copilot CLI is required)

Gaps to Close

1. Hooks — Missing 3 of 5 lifecycle events

hooks.json only contains Copilot CLI hooks. scripts/setup.js installs 2 Claude Code hooks (PostToolUse, SessionEnd) into ~/.claude/settings.json, but 3 are missing:

  • sessionStart — auto-setup on Claude Code session open
  • userPromptSubmitted — push after each prompt
  • errorOccurred — preserve context before crash

Files: hooks.json, scripts/setup.js

2. Restore — No auto-launch for Claude Code CLI

After restoring a Copilot session, Synctx launches copilot --resume <id>. There is no equivalent for Claude Code CLI — users must manually navigate to the restored session.

File: scripts/sync-engine.js (restore command, ~line 755)

3. current keyword — Hardcoded to Copilot

synctx restore current resolves to the most recent Copilot session by scanning ~/.copilot/session-state/. Claude Code sessions are not considered.

File: scripts/lib/commands/list.js (findSession, ~line 145)

4. Installation gates on Copilot CLI

install.js requires copilot --version to succeed (line 97). Claude-only users cannot install Synctx.

File: install.js

5. Documentation references Copilot-only features

  • commands/restore.md references /resume <session-id> which is Copilot-specific
  • skills/restore/SKILL.md instructs using /resume with no Claude alternative
  • GUIDE.md restore section mentions "Prepare for /resume" with no Claude path

Files: commands/restore.md, skills/restore/SKILL.md, GUIDE.md

6. .claude-plugin directory unused

The .claude-plugin/plugin.json exists but serves no functional purpose. Claude Code plugin architecture may differ from Copilot CLI.

File: .claude-plugin/plugin.json

Proposed Approach

  1. Add Claude Code lifecycle hooks to setup.js (sessionStart, userPromptSubmitted, errorOccurred)
  2. Extend findSession("current") to also check ~/.claude/projects/
  3. Remove Copilot CLI as a hard requirement in install.js — allow Claude-only installs
  4. Add Claude Code restore guidance in docs (since auto-launch may not be possible)
  5. Investigate Claude Code CLI plugin architecture for native hooks.json support

Labels

Enhancement, Claude Code CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions