Shaike1 Claude Code
Overview
This node integrates with the Claude Code AI platform to perform AI-powered coding tasks through conversational interactions. It supports continuing an existing conversation with Claude Code, allowing users to send prompts or instructions and receive AI-generated code, explanations, or other programming-related outputs.
Common scenarios include:
- Incrementally developing or debugging code by continuing a prior conversation.
- Automating code generation or modification based on iterative instructions.
- Using AI assistance for complex coding tasks that require multiple back-and-forth exchanges.
Practical example:
- A user starts a conversation asking Claude Code to write a Python function to parse CSV files.
- Later, using this node's "Continue" operation, the user sends follow-up prompts to refine or extend the function, request tests, or debug issues, maintaining context from previous messages.
Properties
| Name | Meaning |
|---|---|
| Prompt | The instruction or message sent to Claude Code to continue the conversation. Required and cannot be empty. |
| Model | The Claude model to use: ⢠Sonnet ā Fast and efficient for most tasks ⢠Opus ā More capable for complex tasks |
| Max Turns | Maximum number of conversation turns (back-and-forth exchanges) allowed in this session. |
| Timeout | Maximum time in seconds to wait for Claude Code to complete the response before aborting. |
| Project Path | Directory path where Claude Code should run commands or access files. If empty, uses the current working directory. Useful for project-specific context. |
| Output Format | How to format the output data: ⢠Structured ā Returns an object with messages, summary, result, and metrics ⢠Messages ā Returns raw array of all exchanged messages ⢠Text ā Returns only the final result text |
| Allowed Tools | Built-in tools Claude Code is permitted to use during execution. Options include Bash, Edit, Exit Plan Mode, Glob, Grep, LS, MultiEdit, Notebook Edit/Read, Read, Task, Todo Write, Web Fetch/Search, Write. Defaults to a subset including web and task tools. |
| Additional Options | Collection of extra settings: ⢠System Prompt ā Additional context or instructions for Claude Code ⢠Require Permissions ā Whether tool usage requires explicit permission ⢠Debug Mode ā Enables debug logging |
Output
The node outputs JSON data structured according to the selected output format:
Structured: An object containing:
messages: Array of all exchanged messages (user, assistant, system).summary: Counts of user messages, assistant messages, tool uses, presence of results, and available tools.result: The final result or error message from Claude Code.metrics: Performance data such as duration in milliseconds, number of turns, total cost, and usage statistics.success: Boolean indicating if the operation succeeded.
Messages: Raw array of all messages exchanged during the conversation continuation, including types and content.
Text: Only the final result text or error string returned by Claude Code.
If the node receives binary data (not indicated here), it would typically represent files or artifacts generated or modified by Claude Code, but this node focuses on JSON message data.
Dependencies
- Requires an API key credential for authenticating with the Claude Code service.
- Uses the official Claude Code SDK (
@anthropic-ai/claude-code) to interact with the AI backend. - Supports setting a working directory path for file operations, so appropriate filesystem permissions may be necessary.
- The node relies on n8n's AbortController support to handle timeouts.
Troubleshooting
- Empty Prompt Error: The prompt must not be empty; ensure you provide a valid instruction.
- Timeouts: If the operation times out (default 300 seconds), consider increasing the timeout value in the node settings.
- Permission Issues: If tool usage fails, verify whether "Require Permissions" is enabled and if the necessary permissions are granted.
- API Errors: Network or authentication errors will cause execution failure; check your API key and network connectivity.
- Debugging: Enable "Debug Mode" to get detailed logs in the n8n console for troubleshooting.
Common error messages:
"Prompt is required and cannot be empty": Provide a non-empty prompt."Operation timed out after X seconds": Increase timeout or optimize prompt complexity."Claude Code execution failed: <error>": Check API credentials and input parameters.