From my-workflow
Detects external changes from git commits, file mods, and GitHub activity, then syncs workflow data like sessions and decisions to Obsidian vault. Supports detect, vault, acknowledge subcommands.
npx claudepluginhub mwguerra/claude-code-plugins# Sync Command Detect changes made outside Claude Code and sync with Obsidian vault. ## Usage ## Database Location ## External Change Detection ### Git Changes Detect commits/changes made outside this session: ### File Changes Track file modification times vs last session: ### GitHub Changes If gh CLI available, check for new activity: ## Recording External Changes ## Vault Sync ### What Gets Synced 1. **Sessions** → `workflow/sessions/YYYY-MM-DD-*.md` 2. **Decisions** → `workflow/decisions/YYYY-MM-DD-*.md` 3. **Commitments** → `workflow/commitments/*.md` 4. **Revi...
/syncSyncs database records to Obsidian vault markdown notes, commits/pushes vault changes to git, detects external changes. Supports vault/git/detect/acknowledge/full modes.
/session-saveSaves current session context and work summary as a structured Markdown note to Obsidian vault under 작업기록/세션기록, auto-discovers related docs, and commits to git if repo.
/syncSyncs CLAUDE.md incrementally with manual file changes detected by git. Filters .claude/ and memory files, writes dirty-files list, spawns memory-updater agent.
/obsManages Obsidian agent memory vault — initialize, analyze projects, recap sessions, scaffold projects, create notes, update TODOs, lookup knowledge, manage relationships.
/syncBootstraps session by reading project context (README.md, AGENTS.md, CLAUDE.md, PLAN.md), restores .claude/session-cache.json state, shows status. Supports --verbose, --diff, --git, --status.
/safe-clearSaves session notes to Obsidian (if available with user choice), updates PROGRESS.md with per-file changelogs, then clears context for fresh start.
Share bugs, ideas, or general feedback.
Detect changes made outside Claude Code and sync with Obsidian vault.
/workflow:sync # Full sync (detect + vault)
/workflow:sync detect # Only detect external changes
/workflow:sync vault # Only sync to Obsidian vault
/workflow:sync acknowledge # Mark all changes as seen
/workflow:sync acknowledge X-001 # Mark specific change as seen
DB_PATH="$HOME/.claude/my-workflow/workflow.db"
VAULT_CONFIG="$HOME/.claude/obsidian-vault.json"
Detect commits/changes made outside this session:
# Get commits not logged in our activity_timeline
git log --since="$(sqlite3 $DB_PATH "SELECT MAX(timestamp) FROM activity_timeline WHERE activity_type='commit'")" \
--format="%H|%h|%s|%an|%ci" 2>/dev/null
Track file modification times vs last session:
# Find files modified since last session
find . -type f -newer "$LAST_SESSION_FILE" \
-not -path "./.git/*" \
-not -path "./node_modules/*" \
2>/dev/null | head -50
If gh CLI available, check for new activity:
# New comments on your PRs
gh api notifications --jq '.[] | select(.reason == "comment") | .subject.title'
# Issues assigned to you (not in our cache)
gh issue list --assignee @me --json number,title,updatedAt
INSERT INTO external_changes (
id, change_type, source, description,
details, project, file_path,
detected_at, relevance_score
) VALUES (
:id, :type, :source, :description,
:details_json, :project, :file_path,
datetime('now'), :relevance
);
workflow/sessions/YYYY-MM-DD-*.mdworkflow/decisions/YYYY-MM-DD-*.mdworkflow/commitments/*.mdworkflow/reviews/review-YYYY-MM-DD.mdworkflow/goals/*.mdVAULT_PATH=$(jq -r '.vaultPath' ~/.claude/obsidian-vault.json)
WORKFLOW_FOLDER="$VAULT_PATH/workflow"
# Ensure folder structure
mkdir -p "$WORKFLOW_FOLDER"/{sessions,decisions,commitments,reviews,goals,patterns}
SELECT id, project, started_at, ended_at, duration_seconds, summary
FROM sessions
WHERE vault_note_path IS NULL
AND status = 'completed'
ORDER BY started_at DESC;
For each, create note and update vault_note_path.
SELECT id, title, description, rationale, category, project, created_at
FROM decisions
WHERE vault_note_path IS NULL
AND status = 'active'
ORDER BY created_at DESC;
Note format:
---
title: "{title}"
decision_id: "{id}"
category: "{category}"
project: "{project}"
date: {date}
status: active
tags: [decision, {category}, {project}]
---
# {title}
**Date:** {date}
**Category:** {category}
**Project:** {project}
## Decision
{description}
## Rationale
{rationale}
## Alternatives Considered
{alternatives}
## Consequences
{consequences}
Only sync active/pending commitments:
SELECT id, title, description, due_date, priority, status, stakeholder
FROM commitments
WHERE vault_note_path IS NULL
AND status NOT IN ('completed', 'canceled')
ORDER BY due_date ASC;
# External Changes Detected
## Git (3 commits)
| Hash | Message | Author | When |
|------|---------|--------|------|
| abc123 | fix: resolve timeout | John | 2 hours ago |
| def456 | feat: add caching | John | 3 hours ago |
| ghi789 | docs: update README | Jane | 5 hours ago |
## Files Modified (8)
- `src/api/cache.ts` - modified 2 hours ago
- `src/config/settings.ts` - modified 3 hours ago
- `README.md` - modified 5 hours ago
- ... (5 more)
## GitHub (2 items)
- New comment on PR #45: "Looks good, but..."
- Issue #67 assigned to you: "Bug in login flow"
---
*Use `/workflow:sync acknowledge` to mark as seen*
# Vault Sync Complete
## Synced Items
### Sessions (3)
- Created: `workflow/sessions/2024-01-27-1030-claude-code-plugins.md`
- Created: `workflow/sessions/2024-01-27-1400-api-service.md`
- Created: `workflow/sessions/2024-01-27-1630-website.md`
### Decisions (2)
- Created: `workflow/decisions/2024-01-27-use-redis-caching.md`
- Created: `workflow/decisions/2024-01-27-adopt-conventional-commits.md`
### Commitments (5)
- Updated: `workflow/commitments/C-0015-review-api-design.md`
- Created: `workflow/commitments/C-0020-implement-caching.md`
- ... (3 more)
## Skipped (already synced)
- 12 sessions
- 8 decisions
- 15 commitments
---
*Vault location: ~/guerra_vault/workflow/*
Eventually support reading changes from vault notes back to DB: