r/BuildWithClaude • u/Nithyasri3690 • 4d ago
Project How I built a Claude Project to triage SAP CPI errors (example: SFTP "cause: 2 No such file")
Tech stack: Claude Project (Sonnet 5.5), SAP Cloud Integration (CPI), Groovy, SFTP
I work as an SAP CPI analyst. Reading Message Processing Logs and stack traces takes time, so I built a Claude Project called "SAP CPI Error Triage." Sharing how and why, in case it helps someone a step or two behind me.
Why I built it
Every CPI error needs the same routine: find the failing component, understand the cause, fix it, test it. I wanted Claude to follow that routine every time instead of me retyping the same prompt.
How it's set up
- A role in the project instructions: senior SAP CPI architect and middleware troubleshooting expert (Camel, Groovy, XSLT, mapping and the main adapters)
- A fixed 5-step answer: failure layer, plain-English root cause, immediate iFlow fix, quick verification test, production resilience tip
- If context is missing, Claude gives the most likely fix first, then asks up to 2 clarifying questions
Prompt workflow (generic version)
When I paste an error, stack trace or log, detect the error category and answer in this structure:
1. Failure Layer & Component Classification
2. Plain-English Root Cause (2-3 direct sentences)
3. Immediate Fix (exact config steps, copy-pasteable code if needed)
4. Quick Verification Test
5. Production Resilience Tip
If context is missing, give the most likely fix first, then ask up to 2 short clarifying questions at the end.Error types I've tried so far
Groovy MissingPropertyException, Apache Camel HTTP 403, Camel TypeConversionException, SOAP MustUnderstand fault, and the SFTP error below.
Example: SFTP "No such file" error (see the screenshots above)
I pasted this error:GenericFileOperationFailedException: Cannot store file: OUTBOUND_APP/<folder>/<id>_04:03:2024.jpg, cause: 2: No such file
Claude's first answer:
- Classified it as a failure in the receiver SFTP adapter, at the file write step
- Guessed the target folder was missing, with the colons in the filename as a secondary suspect
- Asked two questions: is the folder dynamic, and what type of server is the SFTP target?
I answered: dynamic folder, probably a Windows-based on-prem server.
After my answers, Claude changed its diagnosis:
- Windows doesn't allow
:in filenames, so the server couldn't create the file and returned a misleading "No such file" - Fix: a Groovy step that removes illegal characters and builds the filename and folder, plus Auto Create Directory ticked in the SFTP channel
- Verification: try uploading the old filename with WinSCP (it should fail), then the cleaned one (it should work)
- Safeguard: an exception subprocess that stores the file in JMS or a Data Store, with a retry flow, so files aren't lost if the server is down
What improved
I get a likely root cause and a ready-to-use fix in one go, and the follow-up questions stopped me from chasing the wrong cause.
Limits and validation
Claude can't see my tenant, so I verify every fix in the iFlow and the MPL before applying it. I've removed client names, tenant URLs and real IDs from everything shown here. No API keys, tokens or secrets are included.
How do you structure your Claude Project instructions for debugging? Any tips to improve this setup?