Unbreak Now:使用Git的回退
你在咖啡休息前启用了YOLO模式,现在一半的源代码树是一个很大的语法错误?不懂!
一个MCP服务器,维护一个仅可追加的git审计跟踪。因为在人工智能代理“在判断中犯下灾难性错误”和开发人员“不理解自己的代码”之间,需要有人跟踪实际发生的事情。
安装
快速设置(NPX)
直接从GitHub运行,无需安装:
npx github:XTheocharis/unfugit /path/to/projectMCP服务器设置
克劳德代码(推荐)
单线设置:
claude mcp add unfugit -- npx -y github:XTheocharis/unfugit验证安装:
claude mcp list克劳德桌面
添加到您的Claude Desktop配置中:
{
"mcpServers": {
"unfugit": {
"command": "npx",
"args": ["-y", "github:XTheocharis/unfugit", "/path/to/project"]
}
}
}配置位置:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 视窗:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
本地安装
git clone https://github.com/XTheocharis/unfugit
cd unfugit
npm install
npm run build
# Run directly
node dist/unfugit.js /path/to/project
# Or add to MCP config
claude mcp add unfugit -- node /absolute/path/to/unfugit/dist/unfugit.js为什么要单独审计存储库?
AI代理喜欢在出现问题时删除.git目录。unfogit将审计跟踪分开,这样他们就无法销毁证据。
建筑
- 主动/被动模式:通过基于租约的锁定防止并发修改
- 文件监视器:基于Chokidar的更改自动提交(300ms去抖动)
- Git集成:直接执行git命令以实现可靠操作
- 资源:短暂内容,TTL为15分钟
MCP工具
unfugit_history-使用分页浏览提交历史记录unfugit_diff-比较提交之间的更改unfugit_show-显示提交详细信息unfugit_get-从任何提交中检索文件内容unfugit_find_by_content-按内容搜索提交(git pickaxe)unfugit_restore_preview-预览还原操作unfugit_restore_apply-通过安全检查应用恢复unfugit_stats-存储库和服务器统计信息unfugit_ignores-管理忽略模式unfugit_timeline-跨重命名跟踪文件历史记录unfugit_trace_lines-在历史中遵循特定路线
测试
# Unit tests
npm test
# Test against any git repository
node scripts/test-any-repo.js /path/to/repo
# Interactive REPL
node scripts/test-interactive.js /path/to/repo
# Test read-only operations
node scripts/test-git-repos.js /path/to/repo配置
审核存储库 ~/.local/share/unfugit/repos/ (或系统等效物),按项目路径哈希组织。自定义忽略通过 .unfugit-ignore 文件或 unfugit_ignores 工具。
技术细节
- Types/ES模块,MCP协议版本
2025-06-18(把这个寄进来initialize请求: - 通过空字节启发式进行二进制检测
- 基于光标的大型历史分页
发展
npm run dev # Watch mode
npm run typecheck # Type checking
npm run lint # Linting
npm run format # Code formatting实施工作正在进行中 src/unfugit.ts (约3700行)。寻找 // --- Section Name --- 在各部分之间导航的标记。
上下文
为这样一个世界而构建,在这个世界里,人工智能代理删除生产数据库,说“我在几秒钟内毁掉了你几个月的工作”,当他们被黑客攻击时,“零手写代码”的程序员发布“伙计们,我受到了攻击”。
“我不是技术人员,所以这比平时要花更长的时间来弄清楚”\ --一位AI构建的SaaS受到攻击的vibe编码器
Unfogit不会评判。它只是记录了一切。
许可证
麻省理工学院
