agentgrasp

io.github.damejerasv0.1.0更新于 Oct 1, 2026

Yes/no questions about local files, and relevant-file search, with TypeSafe Jev

概览

AI 生成的概览

将冗长的 Bash 输出保存到文件而不占用编码代理的上下文,并支持对这些文件进行是/否提问和相关文件搜索。

功能
agentgrasp 会包装每条 Bash 命令,把冗长的输出写入文件,代理只看到简短摘要和文件路径。ask 工具可对文件回答是/否问题,search 工具返回相关文件和行范围而不返回源文本。两个工具都使用 TypeSafe 的 Jev 是/否模型。
适用场景
当编码代理运行的命令产生非常长的输出,而你希望保持上下文精简同时仍能查询这些输出时适用。适合 Claude Code 工作流中需要提出针对性是/否问题或定位相关文件,而不是阅读整份日志的场景。
运行要求
作为本地进程运行,可通过安装脚本、npm install -g agentgrasp 或 npx agentgrasp mcp 安装。必须在启动 Claude Code 的环境中设置 TYPESAFE_API_KEY 环境变量;否则 ask 和 search 会返回 provider_unavailable。Claude Code 沙箱必须允许写入 agentgrasp 状态目录。
安装前请注意
ask 和 search 会把文件内容发送给 TypeSafe,TypeSafe 将 Jev 定价为每十亿输入 token 42 美元,因此调用会产生费用。这些工具可以读取 MCP 根目录内的任何文件,包括被 Read 拒绝规则阻止的文件。状态目录会不断增长直到你删除文件,失控的命令可能填满磁盘直到超时将其停止。在默认和 acceptEdits 模式下每次 Bash 调用都会请求批准。

安装

在 SourceWeft 中

  1. 打开 控制台中的 agentgrasp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agentgrasp

agentgrasp keeps long command output out of a Claude Code agent's context. Claude Code still runs every Bash command. When the output is long, agentgrasp saves it to a file and the agent sees a short summary with the file path. The agent can then read the file, or ask yes/no questions about it with the ask tool. The search tool finds the files and line ranges that are relevant to a question, without returning source text.

ask and search use Jev, TypeSafe's yes/no model.

Install

sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/damejeras/agentgrasp/releases/latest/download/agentgrasp-installer.sh | shclaude plugin marketplace add damejeras/agentgraspclaude plugin install agentgrasp@agentgrasp

Instead of the installer, npm install -g agentgrasp installs the same binary, and npx agentgrasp mcp runs the MCP server without a global install.

The plugin calls agentgrasp from PATH. Set TYPESAFE_API_KEY in the environment that starts Claude Code; without it, ask and search return provider_unavailable.

Settings

agentgrasp runs each Bash command inside a { ... } group that sends its output to files. Claude Code asks for approval of every command that holds such a group, also when your allow rules allow the command, and no allow rule changes that. So in Claude Code's default and acceptEdits permission modes, every Bash call asks for approval. In bypassPermissions mode the calls run without a prompt. Your deny rules still block a command in every mode.

When the Claude Code sandbox is on, let Bash write the agentgrasp state directory. Without this, the output cannot go to its files, the shell prints the error, and the command does not run:

json
{  "sandbox": {    "filesystem": {      "allowWrite": ["~/.local/state/agentgrasp"]    }  }}

Use $XDG_STATE_HOME/agentgrasp instead when XDG_STATE_HOME is set.

Costs and risks

  • ask and search send file content to TypeSafe. TypeSafe lists Jev at $42 per billion input tokens. Each call writes the tokens it used to its record under ~/.local/state/agentgrasp/asks/ or searches/.
  • ask and search can read any file inside the MCP roots, which are the project directory and the directories you add. This includes files that your Read deny rules block. When you allow these tools, you allow that.
  • The state directory grows until you delete files from it. agentgrasp never deletes them.
  • A runaway command can fill the disk until Claude Code's timeout stops it.

Links

  • MCP Registry name: mcp-name: io.github.damejeras/agentgrasp

来源:README.md,提交 f979585

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.0最新Oct 1, 2026