Automatically updates PROJECT_STATE.md after each commit with recent git info and optional AI-generated summaries to track project status and next steps.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install project-context-sync或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install project-context-sync⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/project-context-sync/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
Keep a living project state document updated after each commit, so any agent (or future session) can instantly understand where things stand.
┌─────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Git Commit │ ──▶ │ Post-commit Hook │ ──▶ │ PROJECT_STATE.md │
│ │ │ │ │ (auto-updated) │
└─────────────┘ └──────────────────┘ └─────────────────────┘
After each commit, the hook:
PROJECT_STATE.md in the repo root# From the repo you want to enable:
cd /path/to/your/repo
/path/to/skills/project-context-sync/scripts/install.sh
Or if you have the skill in your path:
project-context-sync install
This will:
.git/hooks/.project-context.yml with default configPROJECT_STATE.mdPROJECT_STATE.md to .gitignorecd /path/to/your/repo
/path/to/skills/project-context-sync/scripts/uninstall.sh
Trigger an update without committing:
cd /path/to/your/repo
/path/to/skills/project-context-sync/scripts/update-context.sh
Edit .project-context.yml in your repo root:
project_context:
# Use AI to generate smart summaries (default: true)
ai_summary: true
# How many recent commits to include
recent_commits: 5
# Include diff stats in context
include_diff_stats: true
# Sections to include
sections:
- last_commit
- recent_changes
- current_focus # AI-generated
- suggested_next # AI-generated
With ai_summary: true (default):
With ai_summary: false:
AI mode uses Clawdbot's OpenAI-compatible endpoint (/v1/chat/completions). This is disabled by default for security. To enable:
// ~/.clawdbot/clawdbot.json
{
"gateway": {
"http": {
"endpoints": {
"chatCompletions": { "enabled": true }
}
}
}
}
Security notes:
bind: "loopback" (default), only local processes can connect~/.clawdbot/clawdbot.json automaticallyPROJECT_STATE.md will contain:
# Project State
*Auto-updated by project-context-sync*
## Last Commit
- **Hash:** abc123
- **Message:** Implement isPro check for app blocking
- **Branch:** feature/subscription-gating
- **When:** 2026-01-29 12:34
- **Files changed:** 3
## Recent Changes
- abc123: Implement isPro check for app blocking
- def456: Add PaywallPrompt component
- ...
## Current Focus
[AI-generated summary of what's being worked on]
## Suggested Next Steps
[AI-suggested based on commit patterns]
PROJECT_STATE.md is gitignored by default (regenerated locally)安装 Project Context Sync 后,可以对 AI 说这些话来触发它
Help me get started with Project Context Sync
Explains what Project Context Sync does, walks through the setup, and runs a quick demo based on your current project
Use Project Context Sync to automatically updates PROJECT_STATE
Invokes Project Context Sync with the right parameters and returns the result directly in the conversation
What can I do with Project Context Sync in my documents & notes workflow?
Lists the top use cases for Project Context Sync, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/project-context-sync/ 目录(个人级,所有项目可用),或 .claude/skills/project-context-sync/(项目级)。重启 AI 客户端后,用 /project-context-sync 主动调用,或让 AI 根据上下文自动发现并使用。
Project Context Sync 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Project Context Sync 可免费安装使用。请查阅仓库了解许可证信息。
Automatically updates PROJECT_STATE.md after each commit with recent git info and optional AI-generated summaries to track project status and next steps.
Project Context Sync 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my documents & notes tasks using Project Context Sync
Identifies repetitive steps in your workflow and sets up Project Context Sync to handle them automatically