TA

thebnbrkr/agora-code

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

51 stars 13 forks 质量 83 趋势 21Apache-2.0

为AI编码代理提供持久内存和代码库智能,索引符号,跟踪会话,并通过MCP服务器暴露结构化项目知识,使代理停止重读文件,并且......

概览

为AI编码代理提供持续的内存和上下文减少。能够经受上下文窗口重置、新对话和代理重启的考验。 Python 3.10+ 和 pip。(在 macOS 上完全测试过。) (macOS 系统 Python 中常见)使用 --user 代替: 然后把二进制添加到你的PATH中——将这行添加到~/.zshrc或~/.bashrc: 在终端里运行——Claude Code 不需要打开。(macOS:用 Terminal.app。) 这会创建:- .claude/settings.json — 用 Claude 代码注册所有钩子 - .claude/hooks/*.sh — 自动触发的钩子脚本 - ~/.claude/skills/agora-code/SKILL.md — 全局启用 /agora-code(创建一次,所有仓库都能用) - .mcp.json — 注册内存 MCP 服务器 已经有 .claude/settings.json 吗?使用 --force: 将该仓库中的.cursor/目录复制到你的项目根目录中:

概述(AI 翻译)

为AI编码代理提供持续的内存和上下文减少。能够经受上下文窗口重置、新对话和代理重启的考验。


安装

先修条件: Python 3.10+ 和 pip。(在 macOS 上经过全面测试。)

步骤1 — 全局安装包一次

打开终端并运行:

请核实:

macOS 权限错误? (macOS 系统 Python 常见) 改用 --user 代替:

然后将二进制添加到你的PATH中——将这行添加到~/.zshrc或~/.bashrc:


第二步 — 建立一个项目

在 Claude Code 之外的终端运行 — Claude Code 不需要开启。(macOS:请使用 Terminal.app。)

克劳德代码:

这会产生:

  • .claude/settings.json — 用 Claude Code 注册所有钩子
  • .claude/hooks/*.sh — 自动触发的钩子脚本
  • ~/.claude/skills/agora-code/SKILL.md — 全局启用 /agora-code (创建一次,适用于所有仓库)
  • .mcp.json — 注册内存MCP服务器

已经有.claude/settings.json了吗?使用--force:

光标:

将该仓库中的.cursor/目录复制到你的项目根目录中:

或者克隆仓库并复制:

双子座CLI:

同样的方法——将.gemini/复制到你的项目根中:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

agora-code

Persistent memory and context reduction for AI coding agents. Survives context window resets, new conversations, and agent restarts.


Install

Prerequisites: Python 3.10+ and pip. (Fully tested on macOS.)

Step 1 — Install the package (once, globally)

Open a terminal and run:

pip install git+https://github.com/thebnbrkr/agora-code.git

Verify:

agora-code --version

macOS permission error? (common on macOS system Python) Use --user instead:

pip install --user git+https://github.com/thebnbrkr/agora-code.git

Then add the binary to your PATH — add this line to ~/.zshrc or ~/.bashrc:

export PATH="$(python3 -m site --user-base)/bin:$PATH"

Step 2 — Set up a project

Run this in a terminal outside of Claude Code — Claude Code does not need to be open. (macOS: use Terminal.app.)

Claude Code:

cd your-project
agora-code install-hooks --claude-code

This creates:

  • .claude/settings.json — registers all hooks with Claude Code
  • .claude/hooks/*.sh — the hook scripts that fire automatically
  • ~/.claude/skills/agora-code/SKILL.md — enables /agora-code globally (created once, works in all repos)
  • .mcp.json — registers the memory MCP server

Already have .claude/settings.json? Use --force:

agora-code install-hooks --claude-code --force

Cursor:

Copy the .cursor/ directory from this repo into your project root:

cp -r /path/to/agora-code/.cursor your-project/.cursor

Or clone the repo and copy:

git clone https://github.com/thebnbrkr/agora-code.git /tmp/agora-code
cp -r /tmp/agora-code/.cursor your-project/.cursor

Gemini CLI:

Same approach — copy .gemini/ into your project root:

cp -r /tmp/agora-code/.gemini your-project/.gemini

Restart your editor after setup.


Step 3 — Start using it (Claude Code)

Open Claude Code in your project. At the start of every session, type:

/agora-code

This loads the skill — it tells Claude when to summarize files, when to inject context, and when to save progress. Without it, Claude doesn’t know these rules exist.

Your previous session context is injected automatically on session start. To see what was loaded:

agora-code inject

What happens automatically

When you… agora-code automatically…
Start a session Injects last checkpoint + relevant learnings from recent commits
Submit a prompt Recalls relevant past findings, sets session goal
Read a file > 50 lines Summarizes it via AST — saves 75–95% of tokens
Edit a file Tracks the diff, re-indexes symbols
Run git commit Stores learnings derived from the commit
Context window compresses Checkpoints before, re-injects after
End a session Parses transcript → structured checkpoint in DB

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "agora-memory": { "command": "agora-code", "args": ["memory-server"] } } }