显示 HN:Claude 代码会话的持久内存
Show HN: Persistent memory for Claude Code sessions

原始链接: https://github.com/TonyStef/Grov

## Grov:面向工程团队的AI记忆 Grov通过捕获和重用AI推理,提升工程工作流程,节省时间和token成本,并结合Claude Code使用。通常,Claude在每个新会话中都会重新探索代码库,浪费资源。Grov拦截Claude的交互,提取关键架构决策和模式,并将这些“记忆”注入到后续会话中——使Claude能够跳过冗余探索。 安装简单:`npm install -g grov`,然后使用`init`进行配置,`proxy`运行。Grov通过监控Claude的操作,确保与初始目标一致并纠正偏差。 除了本地使用,Grov还提供通过云仪表板进行团队同步的功能(通过`grov login`和`sync`访问)。这允许团队共享学习到的见解,搜索过去的会话,并了解是谁发现了什么。 Grov还具有实验性的扩展缓存,以最大程度地减少Anthropic的提示缓存过期,并且需要Anthropic API密钥才能实现完整功能,包括偏差检测。它是一个开源项目,并且正在积极开发中,鼓励贡献。

## Grov:为Claude代码会话提供的持久记忆 一位开发者因为Claude代码反复重新分析代码库而感到沮丧,因此创建了**Grov**,一个本地代理工具,用于提高效率。Grov拦截Claude代码的API调用,使用LLM从会话中提取推理,将其存储在本地SQLite数据库中,并自动将相关上下文注入到未来的会话中。 测试表明,速度有了显著提升——原本需要10-11分钟的任务现在可以在1-2分钟内完成,无需Claude重新探索文件。与Claude的“恢复”功能(仅维护单个会话)不同,Grov聚合了所有过去会话的知识,甚至包括团队成员的会话,并根据文件路径和时间戳过滤相关性。 开发者强调Grov在团队协作方面的价值,允许开发者受益于彼此过去的推理。目前该项目仍处于早期阶段(v0.2.2),可在GitHub上获取,开发者正在寻求反馈。 类似利用时间图的项目也在出现。
相关文章

原文

grov logo

Collective AI memory for engineering teams.

npm version npm downloads license

WebsiteDashboardQuick StartTeam SyncContributing

Grov captures reasoning from your Claude Code sessions and injects it into future sessions. Your AI remembers what it learned.

Every time you start a new Claude Code session:

  • Claude re-explores your codebase from scratch
  • It reads the same files again
  • It rediscovers patterns you've already established
  • You burn tokens on redundant exploration

Measured impact: A typical task takes 10+ minutes, 7%+ token usage, and 3+ explore agents just to understand the codebase.*

Grov captures what Claude learns and injects it back on the next session.

grov demo

Real reasoning, not just file lists:

captured reasoning

Architectural decisions, patterns, and rationale - automatically extracted.

npm install -g grov   # Install
grov init             # Configure (one-time)
grov proxy            # Start (keep running)

Then use Claude Code normally in another terminal. That's it.

Session 1: Claude learns about your auth system
           ↓
        grov captures: "Auth tokens refresh in middleware/token.ts:45,
                        using 15-min window to handle long forms"
           ↓
Session 2: User asks about related feature
           ↓
        grov injects: Previous context about auth
           ↓
        Claude skips exploration, reads files directly
grov init         # Configure proxy URL (one-time)
grov proxy        # Start the proxy (required)
grov proxy-status # Show active sessions
grov status       # Show captured tasks
grov login        # Login to cloud dashboard
grov sync         # Sync memories to team dashboard
grov disable      # Disable grov
  • Database: ~/.grov/memory.db (SQLite)
  • Per-project: Context is filtered by project path
  • Local by default: Memories stay on your machine unless you enable team sync

Share memories across your engineering team with the cloud dashboard.

grov login                    # Authenticate via GitHub
grov sync --enable --team ID  # Enable sync for a team

Once enabled, memories automatically sync to app.grov.dev where your team can:

  • Browse all captured reasoning
  • Search across sessions
  • Invite team members
  • See who learned what

Memories sync automatically when sessions complete - no manual intervention needed.


Grov monitors what Claude does (not what you ask) and corrects if it drifts from your goal.

  • Extracts your intent from the first prompt
  • Monitors Claude's actions (file edits, commands, explorations)
  • Uses Claude Haiku to score alignment (1-10)
  • Injects corrections at 4 levels: nudge → correct → intervene → halt
# Test drift detection
grov drift-test "refactor the auth system" --goal "fix login bug"

Extended Cache (Experimental)

Anthropic's prompt cache expires after 5 minutes of inactivity. If you pause to think between prompts, the cache expires and must be recreated (costs more, takes longer).

grov proxy --extended-cache

What this does: Sends minimal keep-alive requests (~$0.002 each) during idle periods to preserve your cache.

Important: By using --extended-cache, you consent to Grov making API requests on your behalf to keep the cache active. These requests:

  • Use your Anthropic API key
  • Are sent automatically during idle periods (every ~4 minutes)
  • Cost approximately $0.002 per keep-alive
  • Are discarded (not added to your conversation)

This feature is disabled by default and requires explicit opt-in.

# Required for drift detection and LLM extraction
export ANTHROPIC_API_KEY=sk-ant-...

# Optional
export GROV_DRIFT_MODEL=claude-sonnet-4-20250514  # Override model
export PROXY_HOST=127.0.0.1                        # Proxy host
export PROXY_PORT=8080                             # Proxy port

Without an API key, grov uses basic extraction and disables drift detection.

{
  "task": "Fix auth logout bug",
  "goal": "Prevent random user logouts",
  "files_touched": ["src/auth/session.ts", "src/middleware/token.ts"],
  "reasoning_trace": [
    "Investigated token refresh logic",
    "Found refresh window was too short",
    "Extended from 5min to 15min"
  ],
  "status": "complete"
}
VERIFIED CONTEXT FROM PREVIOUS SESSIONS:

[Task: Fix auth logout bug]
- Files: session.ts, token.ts
- Extended token refresh window from 5min to 15min
- Reason: Users were getting logged out during long forms

YOU MAY SKIP EXPLORE AGENTS for files mentioned above.
  1. grov init sets ANTHROPIC_BASE_URL=http://127.0.0.1:8080 in Claude's settings
  2. grov proxy intercepts all API calls and:
    • Extracts intent from first prompt
    • Injects context from team memory
    • Tracks actions and detects drift
    • Saves reasoning when tasks complete

  1. Fork the repo and clone locally
  2. Install dependencies: npm install
  3. Build: npm run build
  4. Test locally: node dist/cli.js --help
npm run dev              # Watch mode
node dist/cli.js init    # Test CLI

Found a bug? Open an issue.

Apache License 2.0 - see LICENSE file for details.

联系我们 contact @ memedata.com