davila7/claude-code-templates · warning · Error
Invalid workflow hash format. Expected format: #hash
Error message
Invalid workflow hash format. Expected format: #hash
What it means
Thrown when parsing a workflow share-hash: the CLI strips a leading '#', and if the remainder is empty or shorter than 3 characters it rejects the input before attempting any fetch/decode. This guards against malformed share links like `#` or `#ab`.
Source
Thrown at cli-tool/src/index.js:2053
console.log(chalk.blue('Examples:'));
console.log(chalk.gray(' cct --agent api-security-audit'));
console.log(chalk.gray(' cct --agent deep-research-team/academic-researcher'));
console.log('');
}
/**
* Install workflow from hash
*/
async function installWorkflow(workflowHash, targetDir, options) {
console.log(chalk.blue(`🔧 Installing workflow from hash: ${workflowHash}`));
try {
// Extract hash from format #hash
const hash = workflowHash.startsWith('#') ? workflowHash.substring(1) : workflowHash;
if (!hash || hash.length < 3) {
throw new Error('Invalid workflow hash format. Expected format: #hash');
}
console.log(chalk.gray(`📥 Fetching workflow configuration...`));
// Fetch workflow configuration from a remote service
// For now, we'll simulate this by using a local storage approach
// In production, this would fetch from a workflow registry
const workflowData = await fetchWorkflowData(hash);
if (!workflowData) {
throw new Error(`Workflow with hash "${hash}" not found. Please check the hash and try again.`);
}
console.log(chalk.green(`✅ Workflow found: ${workflowData.name}`));
console.log(chalk.cyan(`📝 Description: ${workflowData.description}`));
console.log(chalk.cyan(`🏷️ Tags: ${workflowData.tags.join(', ')}`));
console.log(chalk.cyan(`📊 Steps: ${workflowData.steps.length}`));
View on GitHub (pinned to a0851ed10c)
Solutions
- Copy the full share hash from the dashboard share dialog (format #hash, typically much longer)
- Ensure no characters were truncated when copying/pasting
- If the hash contains '_', keep the encoded payload intact — do not edit it
- Pass at least 3 characters after the '#'
Example fix
// before
installFromHash('#ab'); // throws
// after
installFromHash('#a1b2c3_dEf...'); // full hash from dashboard Defensive patterns
Strategy: validation
Validate before calling
const h = workflowHash.replace(/^#/, '').trim();
if (!h || h.length < 3) {
console.error('Hash must be at least 3 chars after "#" — copy the full share link');
process.exit(1);
} Type guard
function isValidWorkflowHash(input) {
const h = input.startsWith('#') ? input.slice(1) : input;
return typeof input === 'string' && h.length >= 3;
} Prevention
- Copy hashes with the dashboard share button, not manual text selection
- Validate length before invoking the CLI
- Avoid trimming the hash beyond whitespace
When it happens
Trigger: Running the workflow-from-hash command with `#ab`, `#`, an empty string, or a hash of only 1-2 characters. Any value whose post-# length is <3 throws immediately.
Common situations: Truncated or typo'd share link pasted from the dashboard; user pastes only the '#' prefix; whitespace-stripped hash from messaging apps.
Related errors
- Invalid hash format: missing encoded data
- Workflow with hash "${hash}" not found. Please check the has
- Decompression failed: ${error.message}
- Failed to decode workflow data from hash
- Invalid workflow data structure in hash
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/d8d58a51b949ff2b.
Report an issue: GitHub.