展示 HN:Cck ClaudeCode 文件变更跟踪与自动生成 Claude.md

3作者: takawasi大约 1 个月前原帖
每个 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:&#x2F;&#x2F;github.com&#x2F;takawasi&#x2F;claude-context-keeper" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;takawasi&#x2F;claude-context-keeper</a> &amp;&amp; cd claude-context-keeper &amp;&amp; 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 &amp; 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&#x2F;main.py 15:22:30 + src&#x2F;utils&#x2F;helper.py 15:20:12 ~ tests&#x2F;test_main.py ```<p>Claude sees exactly what you just edited. No more &quot;I just changed X&quot; explanations.<p>Built from 300+ Claude Code sessions. Zero AI calls, pure static analysis.<p>GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;takawasi&#x2F;claude-context-keeper" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;takawasi&#x2F;claude-context-keeper</a>