AI编码
dev.to ·
@Hermes Labs
Hermeneutic 将 AI 纠正记录转化为后续任务的上下文
Hermes Labs 推出 Hermeneutic,可读取 Claude Code、Codex 和 OpenAI 格式日志,识别用户纠正型对话轮次,并记录“请求→Agent 响应→纠正→修复响应”的完整片段,形成本地纠正语料。其 bucket 命令可查看反复出现的纠正类别,如遗漏约束、目标错误、多余确认等,并在类似任务出现时给出相关指引。
AI推荐理由 Hermes Labs 的 Hermeneutic 从 Claude Code、Codex 和 OpenAI 格式日志中挖掘用户纠正,构建本地纠正语料并在相似任务中复用,属于 Agent 记忆与上下文工程的具体工具方向;但正文仅为项目自述,未提供评测数据、准确率或实际使用效果,价值需进一步验证。
62
正文
You ask a coding agent to review a function. It starts refactoring. You steer it back to the review you requested.
That exchange contains useful information about your intended scope.
Hermeneutic, built by Hermes Labs, mines corrections from agent conversations and surfaces relevant guidance when similar tasks come up. In this example, a later code-review request could receive guidance about staying within the requested scope—drawn from your earlier corrections.
Your conversation history becomes a source of context for new work.
How correction memory works
Hermeneutic reads supported Claude Code, Codex, and OpenAI-format logs. It recognizes correction-shaped user turns and records the surrounding exchange when available:
your request → agent response → your correction → repaired response
Enter fullscreen mode
Exit fullscreen mode
The resulting local corpus preserves the episode around each correction. The bucket command lets you inspect recurring categories, including missed constraints, wrong targets, unnecessary confirmation, and scope expansion.
Retrieval makes those records useful during another task. Using Ollama embeddings, Hermeneutic matches a new prompt against earlier prompts in the corpus. Relevant matches supply correction categories, which become a compact guidance preamble through category templates. Each advice bullet cites its supporting correction records.
For a release task, that might surface your prior guidance to cite command output when reporting completion. For a similar review task, it might surface guidance about respecting the requested scope.
Put your own history to work
With Python 3.10+ and Ollama available:
python -m pip install hermeneutic==0.1.12
hermeneutic mine ~/.claude/projects \
--format claude-code \
--glob '**/*.jsonl' \
--out ~/.hermeneutic/triples.jsonl
hermeneutic bucket ~/.hermeneutic/triples.jsonl
ollama pull nomic-embed-text
hermeneutic compile-index --triples ~/.hermeneutic/triples.jsonl
hermeneutic compile 'Review this function and report your findings.'
Enter fullscreen mode
Exit fullscreen mode
When matching corrections meet the relevance threshold, the final command emits guidance for that prompt. Use it directly in your workflow, or install the optional Claude Code hook to supply retrieved guidance as prompt context:
hermeneutic install-compile-hook
Enter fullscreen mode
Exit fullscreen mode
Start with the corrections you already made. Try Hermeneutic on GitHub, follow the memory setup, and star the repository to follow its development.
What correction do you keep repeating to your coding agent?
Built by Hermes Labs. Prepared by our agent infrastructure from the project README and documentation.