smcreader 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/README.md +6 -1
- package/lib/intercept-hook.js +4 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smcreader",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "SMC Reader (Save My Context Reader): large tool outputs are spilled to disk and replaced by a short pointer; the model pulls only the lines it needs via reader_ask / reader_peek.",
|
|
5
5
|
"author": { "name": "bulatko" },
|
|
6
6
|
"homepage": "https://github.com/bulatko/SMCReader",
|
package/.mcp.json
CHANGED
package/README.md
CHANGED
|
@@ -230,7 +230,12 @@ received, not from what it said: (1) the Bash `tool_result` contains `[READER ct
|
|
|
230
230
|
## Limitations
|
|
231
231
|
|
|
232
232
|
- Needs a Claude Code version that applies `hookSpecificOutput.updatedToolOutput` from command
|
|
233
|
-
hooks (verified on 2.1.282). Older versions call the hook but keep the original output.
|
|
233
|
+
hooks (verified on 2.1.282 and 2.1.310). Older versions call the hook but keep the original output.
|
|
234
|
+
- Claude Code itself saves a `Bash` output above `BASH_MAX_OUTPUT_LENGTH` (30 000 characters by
|
|
235
|
+
default) to a file and shows the model a preview with the path. SMC Reader leaves such outputs
|
|
236
|
+
alone, so it covers outputs between `READER_THRESHOLD` and that limit.
|
|
237
|
+
- A failed command (non-zero exit) is not intercepted: Claude Code reports it through
|
|
238
|
+
`PostToolUseFailure`, which cannot replace the output (Claude Code shortens it itself).
|
|
234
239
|
- Supported output shapes: string, `{stdout,…}` (Bash), `{content:[…]}` (MCP), `{output}`,
|
|
235
240
|
`{file:{content}}` (Read), arrays of content blocks. Unknown shape → passed through untouched.
|
|
236
241
|
- `Read` is not intercepted by default — `Edit` needs exact bytes. Use the read guard instead.
|
package/lib/intercept-hook.js
CHANGED
|
@@ -143,6 +143,10 @@ function createInterceptHook({ store, threshold = DEFAULT_THRESHOLD, allowlist =
|
|
|
143
143
|
try {
|
|
144
144
|
const toolName = input?.tool_name;
|
|
145
145
|
if (!toolName || !allowed.has(toolName)) return {};
|
|
146
|
+
// Claude Code already moved a big output to a file: tool_response holds a stdout truncated to
|
|
147
|
+
// BASH_MAX_OUTPUT_LENGTH plus persistedOutputPath, and the model gets a preview with the path.
|
|
148
|
+
// Intercepting it would store the truncated text and put our pointer in place of that preview.
|
|
149
|
+
if (input.tool_response && typeof input.tool_response === 'object' && input.tool_response.persistedOutputPath) return {};
|
|
146
150
|
|
|
147
151
|
const { text, shape } = extractText(input.tool_response);
|
|
148
152
|
if (!text || text.length < threshold) return {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smcreader",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "SMC Reader (Save My Context Reader): pull-model reading of large tool outputs for Claude Code. A PostToolUse hook spills big outputs to disk and leaves a short pointer; an MCP server returns only the lines or answers the model asks for.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "bulatko",
|