Skip to content

Commit 4192778

Browse files
authored
Remove Claude attachment probes (#18)
1 parent 6e6d732 commit 4192778

3 files changed

Lines changed: 11 additions & 192 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "cuey",
1010
"source": "./plugins/cuey",
1111
"description": "Cuey is an agentic financial intelligence system that analyzes prompts and Excel workbooks, improves decision accuracy through cross-checking and fact-checking, and delivers evidence-backed recommendations.",
12-
"version": "0.4.13",
12+
"version": "0.4.14",
1313
"author": {
1414
"name": "TensorBlock"
1515
},

plugins/cuey/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cuey",
3-
"version": "0.4.13",
3+
"version": "0.4.14",
44
"description": "Cuey is an agentic financial intelligence system that analyzes prompts and Excel workbooks, improves decision accuracy through cross-checking and fact-checking, and delivers evidence-backed recommendations.",
55
"author": {
66
"name": "TensorBlock",

plugins/cuey/skills/cuey/SKILL.md

Lines changed: 9 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,20 @@
11
---
22
name: cuey
3-
description: Run Cuey only when the user explicitly invokes /cuey. Cuey analyzes prompts and Excel workbooks, cross-checks key claims, fact-checks assumptions, and returns evidence-backed recommendations. Use /cuey probe or /cuey probe https only for attachment transport diagnostics.
3+
description: Run Cuey only when the user explicitly invokes /cuey. Cuey analyzes prompts and Excel workbooks, cross-checks key claims, fact-checks assumptions, and returns evidence-backed recommendations.
44
argument-hint: <question>
55
---
66

77
# Cuey
88

99
Run this skill only after the user explicitly invokes `/cuey`. Do not invoke Cuey automatically for financial decisions, model analysis, business assumptions, or any other request that does not include `/cuey`.
1010

11-
Before using any tool, classify the invocation using this routing table:
11+
When invoked, call the local MCP tool `cuey:ask_cuey`. Do not use bash, recall memory, search, or answer directly before calling the tool.
1212

13-
1. If `$ARGUMENTS` is exactly `probe https` or starts with `probe https `,
14-
this is an HTTPS attachment probe. You must follow **HTTPS Attachment Probe**
15-
and must not call `cuey:ask_cuey`.
16-
2. If `$ARGUMENTS` is exactly `probe`, starts with `probe `, or is an explicit
17-
attachment transport diagnostic request such as `attachment probe`, this is
18-
a probe request. You must follow **Attachment Probe** and must not call
19-
`cuey:ask_cuey`.
20-
3. Otherwise, this is a normal Cuey request. Follow **Ask Cuey** and call
21-
`cuey:ask_cuey`.
13+
Preserve Claude's normal attachment workflow. Users attach files in Claude's composer; Cuey consumes only files and attachment content that Claude already exposes in the current request. Do not search local paths, upload or send files separately, invent file handles, or replace available attachment content with Claude-generated summaries. Do not decide the merge route. Cuey backend chooses the final synthesis or artifact merge after fanout returns.
2214

23-
## HTTPS Attachment Probe
15+
If the request includes Claude-visible attachments of any type, read them with Claude's available file, spreadsheet, document, or vision capability and add compact, relevant attachment context to `context`. This applies to Excel, PDF, image, document, text, CSV, and other Claude-readable files. For each relevant attachment, include the filename, file type, extracted content or observations needed for the user's request, and any omitted sections when the file is too large to include fully. Do not include only a filename when actual attachment content is available.
2416

25-
This section applies only to `/cuey probe https`. It validates the direct,
26-
large-file transport path. Do not search for or call `cuey:ask_cuey`, do not
27-
build an Ask Cuey payload, and do not analyze the attachment.
28-
29-
Use exactly one raw attachment from the current user message. Never reuse an
30-
attachment from an earlier message. Claude must have a readable raw file path
31-
for that current attachment, normally under `/root/.claude/uploads/...`. If no
32-
such path is available, say that direct upload cannot be tested for this
33-
attachment and stop.
34-
35-
1. Read the file size with `stat -c%s` and SHA-256 with `sha256sum` in the
36-
Claude sandbox. Do not base64 encode or chunk the file.
37-
2. Call only `cuey:probe_claude_attachment_https` with:
38-
39-
```json
40-
{
41-
"action": "begin",
42-
"filename": "original filename",
43-
"mimeType": "original MIME type",
44-
"sizeBytes": 123,
45-
"sha256": "lowercase sha256"
46-
}
47-
```
48-
49-
3. From the returned `upload_url`, `headers`, and `probe_token`, use the
50-
following exit-safe `curl` command in the Claude sandbox to stream the exact
51-
original file. It preserves S3's error details without exposing the upload
52-
URL or probe token:
53-
54-
```bash
55-
response_headers="$(mktemp)"
56-
response_body="$(mktemp)"
57-
58-
set +e
59-
http_status="$(curl --http1.1 --fail-with-body --silent --show-error \
60-
--request PUT \
61-
--upload-file "$ATTACHMENT_PATH" \
62-
-H "Content-Type: $MIME_TYPE" \
63-
-H "x-amz-meta-cuey-sha256: $SHA256" \
64-
--dump-header "$response_headers" \
65-
--output "$response_body" \
66-
--write-out '%{http_code}' \
67-
"$UPLOAD_URL")"
68-
curl_exit=$?
69-
set -e
70-
71-
if [ "$curl_exit" -ne 0 ]; then
72-
s3_request_id="$(awk 'tolower($1) == "x-amz-request-id:" {gsub(/\r/, "", $2); print $2}' "$response_headers")"
73-
s3_host_id="$(awk 'tolower($1) == "x-amz-id-2:" {gsub(/\r/, "", $2); print $2}' "$response_headers")"
74-
s3_error_code="$(sed -n 's:.*<Code>\([^<]*\)</Code>.*:\1:p' "$response_body")"
75-
s3_error_message="$(sed -n 's:.*<Message>\([^<]*\)</Message>.*:\1:p' "$response_body")"
76-
printf 'cuey_s3_upload_failed\nhttp_status=%s\ncurl_exit=%s\ns3_error_code=%s\ns3_error_message=%s\ns3_request_id=%s\ns3_host_id=%s\n' \
77-
"$http_status" "$curl_exit" "$s3_error_code" "$s3_error_message" "$s3_request_id" "$s3_host_id"
78-
exit 0
79-
fi
80-
```
81-
82-
4. If and only if the command succeeded, call only
83-
`cuey:probe_claude_attachment_https` again:
84-
85-
```json
86-
{
87-
"action": "complete",
88-
"probeToken": "token returned by begin"
89-
}
90-
```
91-
92-
The upload URL and probe token are short-lived secrets. Use them only in tool
93-
calls and commands; never include either in the user-visible answer. On an
94-
upload failure, return only the printed `cuey_s3_upload_failed` diagnostic and
95-
stop; do not call `complete`. On success, return the completion result exactly
96-
and stop. This probe does not run fanout, persist a Cuey document, or produce a
97-
normal Ask Cuey answer.
98-
99-
## Attachment Probe
100-
101-
This section applies only to probe requests.
102-
103-
Do not search for `ask_cuey`. Do not call `cuey:ask_cuey`. Do not build an
104-
Ask Cuey payload. Do not summarize the attachments yourself.
105-
106-
Call only the local MCP tool `cuey:probe_claude_attachment`.
107-
108-
Do not analyze, summarize, transcribe, or transform uploaded files. The purpose
109-
of this diagnostic is to verify whether Claude can pass raw uploaded file
110-
references, paths, handles, bytes metadata, or attachment objects to MCP, and
111-
whether MCP can upload the same file bytes to Cuey backend.
112-
113-
Send only raw file/attachment values from the same user message that invoked
114-
this probe. Never use attachments from earlier turns, prior probes, chat
115-
history, memory, cached tool results, or previous Cuey responses. If the current
116-
message contains a visible image but Claude exposes no raw file bytes, path, or
117-
handle for that image, leave `attachments` and `files` empty and state that
118-
the current image was visible but no raw attachment transport was exposed.
119-
120-
Prefer actual file bytes whenever Claude can read them. For each
121-
current-message attachment, first use Claude's available file access to read the
122-
attachment bytes and include inline `base64`, `dataBase64`, or `contentBase64`
123-
content along with filename and MIME type. Apply this to any current-message
124-
attachment type Claude can expose, including documents, spreadsheets, images,
125-
PDFs, text files, CSVs, archives, and other binary files.
126-
127-
If Claude exposes a `/root/.claude/uploads/...` sandbox path, do not pass that
128-
path as the only transport. That path is readable by Claude's sandbox, but not
129-
by the local Cuey MCP runtime. First read that current-message file in Claude's
130-
sandbox and pass its bytes inline as base64. Include the path only as metadata
131-
alongside the base64.
132-
133-
Do not run a size preflight and then decide to send a sandbox path instead of
134-
bytes. For this probe, attempt the MCP call with inline base64 when Claude can
135-
read the current-message attachment bytes. If the attachment is too large for a
136-
single inline MCP tool call, stop and report that this file requires the direct
137-
HTTPS transport path. In that failure case, do not
138-
retry with a `/root/.claude/uploads/...` path-only payload.
139-
140-
Only if Claude exposes a non-sandbox file path or handle that the MCP runtime
141-
can read may you pass a path or handle without base64. If Claude exposes only
142-
extracted text and no raw file reference or bytes, leave `attachments` and
143-
`files` empty and put a short note in `note`.
144-
145-
Use this payload shape:
146-
147-
```json
148-
{
149-
"note": "what Claude can access about the uploaded files",
150-
"attachments": [
151-
{
152-
"filename": "example.png",
153-
"mimeType": "image/png",
154-
"path": "raw path or handle if available",
155-
"base64": "raw file bytes as base64 if Claude can expose them"
156-
}
157-
],
158-
"files": [],
159-
"context": "",
160-
"upload": true
161-
}
162-
```
163-
164-
Return the MCP result exactly. Do not add commentary. Stop immediately.
165-
166-
## Ask Cuey
167-
168-
This section applies only to normal Cuey requests. If this is a probe request,
169-
do not execute this section.
170-
171-
Call the local MCP tool `cuey:ask_cuey`. Do not use bash, recall memory, search,
172-
or answer directly before calling the tool.
173-
174-
Preserve Claude's normal attachment workflow. Users attach files in Claude's
175-
composer. For normal `/cuey` requests, Cuey receives compact context extracted
176-
by Claude, not raw uploaded files, paths, handles, bytes, or `sourceFiles`. Raw
177-
attachment transport is experimental and belongs only to `/cuey probe`.
178-
179-
If the request includes Claude-visible non-Excel attachments, add only compact,
180-
relevant context that Claude can already extract naturally. Include filename,
181-
file type, extracted text or observations needed for the user's request, and
182-
any omitted sections when the file is too large to include fully. Do not search
183-
local paths, upload or send files separately, invent file handles, or send raw
184-
file bytes in normal `/cuey`.
185-
186-
Do not decide the merge route. Cuey backend chooses the final synthesis or
187-
artifact merge after fanout returns.
188-
189-
If the request includes a native Claude `.xlsx` attachment, also build compact
190-
workbook context in `spreadsheet` containing:
17+
If the request includes a native Claude `.xlsx` attachment, also build compact workbook context in `spreadsheet` containing:
19118

19219
- workbook filename;
19320
- every sheet name;
@@ -203,7 +30,7 @@ Send this payload:
20330
{
20431
"mode": "ask | compare | verify | summarize",
20532
"question": "$ARGUMENTS",
206-
"context": "only relevant prior conversation context plus compact Claude-extracted context from non-Excel attachments",
33+
"context": "only relevant prior conversation context plus compact context extracted from Claude-visible non-Excel attachments",
20734
"spreadsheet": {
20835
"filename": "attached workbook filename, or empty when none",
20936
"context": "structured workbook context extracted from the attached .xlsx, or empty when none"
@@ -215,19 +42,11 @@ Send this payload:
21542

21643
Choose `compare` for comparisons, `verify` for risk or correctness checks, `summarize` for summaries, and `ask` otherwise.
21744

218-
Set `"worklog": true` only when the request is clearly a CFO, FP&A, finance,
219-
financial model, forecast, budget, board, investor, audit, reporting, variance,
220-
revenue, cost, cash, runway, or unit-economics task where generated artifacts
221-
should include candidate worklogs. For ordinary questions, normal summaries,
222-
and simple Excel generation, omit `worklog` or set it to `false`.
45+
Set `"worklog": true` only when the request is clearly a CFO, FP&A, finance, financial model, forecast, budget, board, investor, audit, reporting, variance, revenue, cost, cash, runway, or unit-economics task where generated artifacts should include candidate worklogs. For ordinary questions, normal summaries, and simple Excel generation, omit `worklog` or set it to `false`.
22346

224-
Do not send `sourceFiles`, `smart_merge`, `models`, `reasoningLevel`, agent
225-
names, or merge settings. Those choices belong to Cuey backend.
47+
Do not send `sourceFiles`, `smart_merge`, `models`, `reasoningLevel`, agent names, or merge settings. Those choices belong to Cuey backend.
22648

227-
Requests to create, generate, build, export, or return an Excel workbook are
228-
always `ask`, never `verify`. Do not change a workbook-generation request into a
229-
requirements analysis. Example: `Create a downloadable Excel workbook...`
230-
must be sent as `{"mode":"ask","question":"Create a downloadable Excel workbook..."}`.
49+
Requests to create, generate, build, export, or return an Excel workbook are always `ask`, never `verify`. Do not change a workbook-generation request into a requirements analysis. Example: `Create a downloadable Excel workbook...` must be sent as `{"mode":"ask","question":"Create a downloadable Excel workbook..."}`.
23150

23251
When there is no Excel attachment, omit `spreadsheet`. Keep non-Excel attachment context in `context`; never send `sourceFiles`.
23352

0 commit comments

Comments
 (0)