davila7/claude-code-templates · warning

Warning: Could not fetch agents, using fallback list

Error message

Warning: Could not fetch agents, using fallback list

What it means

This is the top-level fallback for getAvailableAgents(): every strategy to fetch the agent list from GitHub failed, so the CLI prints this warning and returns a hardcoded fallback list of well-known agents. Functionality continues but the list may be stale/incomplete relative to the live repo.

Source

Thrown at cli-tool/src/index.js:1513

            for (const categoryItem of categoryContents) {
              if (categoryItem.type === 'file' && categoryItem.name.endsWith('.md')) {
                agents.push({
                  name: categoryItem.name.replace('.md', ''),
                  path: `${item.name}/${categoryItem.name.replace('.md', '')}`,
                  category: item.name
                });
              }
            }
          }
        } catch (error) {
          console.warn(`Warning: Could not fetch category ${item.name}:`, error.message);
        }
      }
    }
    
    return agents;
  } catch (error) {
    console.warn('Warning: Could not fetch agents, using fallback list');
    // Comprehensive fallback list if all methods fail
    return [
      { name: 'frontend-developer', path: 'development-team/frontend-developer', category: 'development-team' },
      { name: 'backend-developer', path: 'development-team/backend-developer', category: 'development-team' },
      { name: 'fullstack-developer', path: 'development-team/fullstack-developer', category: 'development-team' },
      { name: 'api-security-audit', path: 'api-security-audit', category: 'root' },
      { name: 'database-optimization', path: 'database-optimization', category: 'root' },
      { name: 'react-performance-optimization', path: 'react-performance-optimization', category: 'root' }
    ];
  }
}

async function installIndividualSkill(skillName, targetDir, options) {
  console.log(chalk.blue(`💡 Installing skill: ${skillName}`));
  const startTime = Date.now();

  try {
    // Skills can be in format: "skill-name" or "category/skill-name"

View on GitHub (pinned to a0851ed10c)

Solutions

  1. Check connectivity: `curl -I https://api.github.com` and `curl -I https://raw.githubusercontent.com`.
  2. Set GITHUB_TOKEN (or GITHUB_ACCESS_TOKEN) to raise rate limits if the failure is 403-based.
  3. Configure proxy env vars (HTTPS_PROXY) if behind a corporate proxy.
  4. Accept the fallback list — it exists precisely so the CLI keeps working offline; update your CLI version to get a fresher hardcoded list.
Defensive patterns

Strategy: fallback

Validate before calling

// probe connectivity before relying on live agent list
const reachable = await fetch('https://api.github.com', { method: 'HEAD' }).then(r => r.ok).catch(() => false);

Try / catch

catch { console.warn('Could not fetch agents, using fallback list'); return FALLBACK_AGENTS; }

Prevention

When it happens

Trigger: All fetch attempts fail: no network (offline machine), DNS failure for raw.githubusercontent.com/api.github.com, HTTP 403 rate limit on every category request, or a proxy blocking all outbound HTTPS.

Common situations: Air-gapped or proxied corporate environments, airplane/offline usage, CI without network egress, or exhausting the unauthenticated GitHub API quota.

Related errors


AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28). Data as JSON: /api/errors/89c3fff7fa34c187. Report an issue: GitHub.