Overview
The node "Claude Code" integrates with the Claude Code SDK to perform AI-powered coding tasks within a specified project directory. It allows users to send prompts or instructions to an AI model that can generate code, create plans, approve and execute plans, continue conversations, or validate project paths.
The Test Project Path operation specifically validates whether a given directory path exists, is accessible, and has appropriate permissions for reading and writing. This helps ensure that subsequent operations involving file access or command execution in that directory will not fail due to invalid paths or permission issues.
Common scenarios where this node is beneficial:
- Validating that a project directory exists and is properly accessible before running automated code generation or modification tasks.
- Ensuring that the working directory for AI-driven coding assistants is correctly set up.
- Pre-checking environment setup in CI/CD pipelines or development workflows to avoid runtime errors related to file system access.
Practical example:
- Before triggering a complex AI-driven code refactoring plan, use the Test Project Path operation to confirm the target directory is valid and writable.
- In a multi-step workflow, verify the project path early to prevent failures downstream when the AI attempts to read or write files.
Properties
| Name | Meaning |
|---|---|
| Prompt | The instruction or prompt sent to Claude Code. (Not used in Test Project Path operation; hidden for it.) |
| Model | The Claude AI model to use: • Sonnet — Fast and efficient for most tasks • Opus — More capable for complex tasks |
| Max Turns | Maximum number of conversation turns allowed (not applicable for Test Project Path). |
| Timeout | Maximum time in seconds to wait for completion before aborting the operation. |
| Project Path | The directory path to validate. Must be a valid existing directory with read permission. Write permission is checked but only warns if missing. |
| Output Format | How to format the output data (not applicable for Test Project Path; defaults to structured). |
| Allowed Tools | List of built-in tools Claude Code is allowed to use during execution (not applicable for Test Project Path). |
| Additional Options | Collection of extra options such as debug mode, system prompt, auto-execute plan, etc. Most are irrelevant for Test Project Path except Debug Mode which enables detailed logging during validation. |
Output
For the Test Project Path operation, the node outputs a JSON object containing:
test: A string"project_path_validation"indicating the type of test performed.originalPath: The user-provided project path string.resolvedPath: The absolute resolved path on the filesystem.valid: Boolean indicating if the path is valid (exists, is a directory, readable).error: Error message string if the path is invalid, otherwisenull.warning: Warning message string if there are permission concerns (e.g., no write permission), otherwisenull.systemContext: Object with environment details:currentWorkingDirectory: The current process working directory.processUser: The username under which the process runs.processUid: Numeric user ID if available, else null.platform: Operating system platform.nodeVersion: Node.js version string.
success: Boolean same asvalidindicating overall success.
This output helps users programmatically check the validity and accessibility of the project directory before proceeding.
Dependencies
- Requires access to the local filesystem to check directory existence and permissions.
- Uses Node.js core modules
fsandpathfor filesystem operations. - No external API calls or credentials are needed for the Test Project Path operation.
- Optional debug logging controlled by the "Debug Mode" property.
- Runs within the n8n environment with standard Node.js capabilities.
Troubleshooting
Common Issues
- Project directory does not exist: The provided path is incorrect or the directory has not been created yet.
- Path is not a directory: The path points to a file instead of a folder.
- No read permission: The node cannot access the directory contents due to insufficient permissions.
- No write permission warning: The node may not be able to create or modify files in the directory, which could cause failures in later operations.
Error Messages and Resolutions
- "Project directory does not exist": Create the directory at the specified path or correct the path input.
- "Project path is not a directory": Provide a valid directory path, not a file path.
- "No read permission for project directory": Adjust filesystem permissions to allow read access for the user running n8n.
- Warning about no write permission: While not fatal, consider granting write permissions if the node needs to modify files.
If the node times out, consider increasing the timeout value in the properties.
Links and References
- Node.js fs module documentation
- Node.js path module documentation
- n8n Documentation
- Anthropic Claude Code SDK (general info) (for context on the AI models)