展示 HN:Cck ClaudeCode 文件变更跟踪与自动生成 Claude.md
每个 Claude Code 会话都是全新的。你需要每次都重新解释你的项目结构、构建命令和约定。每一次,都是如此。
我开发了 cck 来解决这个问题。它有两种模式:
*1. 生成 CLAUDE.md*
```bash
git clone https://github.com/takawasi/claude-context-keeper && cd claude-context-keeper && pip install .
cck sync
```
该命令会扫描你的代码库,并生成 CLAUDE.md。Claude 在会话开始时会读取它。
*2. 每轮上下文注入(真正的强大之处)*
```bash
cck setup --cb-style
cck watch --with-history &
cck hook install --use-history
```
这个功能会在 SQLite 中跟踪每个文件的变化,并在每轮中注入最近的更改:
```
[CCK] 最近的更改:
15:23:45 ~ src/main.py
15:22:30 + src/utils/helper.py
15:20:12 ~ tests/test_main.py
```
Claude 可以准确看到你刚刚编辑的内容。不再需要“我刚刚更改了 X”的解释。
该工具基于 300 多个 Claude Code 会话构建而成。没有 AI 调用,纯粹的静态分析。
GitHub: [https://github.com/takawasi/claude-context-keeper](https://github.com/takawasi/claude-context-keeper)
查看原文
Every Claude Code session starts fresh. You re-explain your project structure, build commands, and conventions. Every. Single. Time.<p>I built cck to solve this. Two modes:<p>*1. CLAUDE.md Generation*
```bash
git clone <a href="https://github.com/takawasi/claude-context-keeper" rel="nofollow">https://github.com/takawasi/claude-context-keeper</a> && cd claude-context-keeper && pip install .
cck sync
```
Scans your codebase, generates CLAUDE.md. Claude reads it at session start.<p>*2. Per-Turn Context Injection (the real power)*
```bash
cck setup --cb-style
cck watch --with-history &
cck hook install --use-history
```
This tracks every file change in SQLite and injects recent changes on every turn:
```
[CCK] Recent changes:
15:23:45 ~ src/main.py
15:22:30 + src/utils/helper.py
15:20:12 ~ tests/test_main.py
```<p>Claude sees exactly what you just edited. No more "I just changed X" explanations.<p>Built from 300+ Claude Code sessions. Zero AI calls, pure static analysis.<p>GitHub: <a href="https://github.com/takawasi/claude-context-keeper" rel="nofollow">https://github.com/takawasi/claude-context-keeper</a>