davila7/claude-code-templates · warning
Warning: Error loading user permissions
Error message
Warning: Error loading user permissions
What it means
loadUserPermissions reads the user-level Claude Code settings to extract which components the user has explicitly allowed, warning and returning partial/empty results if reading or parsing fails. Like the other dashboard warnings, it is non-fatal: the dashboard continues but the user-permissions view will be incomplete.
Source
Thrown at cli-tool/src/plugin-dashboard.js:459
}
}
}
// Load user-level MCPs
const userMcpFile = path.join(this.claudeDir, '.mcp.json');
if (await fs.pathExists(userMcpFile)) {
const mcpData = JSON.parse(await fs.readFile(userMcpFile, 'utf8'));
for (const [name, config] of Object.entries(mcpData.mcpServers || {})) {
permissions.mcps.push({
name,
source: 'User',
plugin: null,
config
});
}
}
} catch (error) {
console.warn(chalk.yellow('Warning: Error loading user permissions'), error.message);
}
return permissions;
}
async loadPluginPermissions(plugin) {
const permissions = {
agents: [],
commands: [],
hooks: [],
mcps: []
};
try {
// Load plugin agents
const agentsDir = path.join(plugin.path, 'agents');
if (await fs.pathExists(agentsDir)) {
const agentFiles = await fs.readdir(agentsDir);View on GitHub (pinned to a0851ed10c)
Solutions
- Run `jq . ~/.claude/settings.json` to verify the file parses
- Repair the JSON (or remove the file to let Claude Code regenerate defaults) and re-run the dashboard
- Confirm HOME is set correctly in headless/CI environments
- Keep permissions entries as arrays of strings to match the expected schema
Example fix
// before
// ~/.claude/settings.json: { "permissions": { "mcps": null } }
// after
{ "permissions": { "mcps": [] } } Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs-extra');
async function userSettingsReadable(settingsPath) {
if (!(await fs.pathExists(settingsPath))) return false;
try { JSON.parse(await fs.readFile(settingsPath, 'utf8')); return true; }
catch { return false; }
} Try / catch
catch (error) {
console.warn(`User permissions unavailable (${error.message}); continuing with empty set`);
return permissions;
} Prevention
- Verify HOME is set in CI/containers before running the dashboard
- Lint ~/.claude/settings.json after any manual edit
- Let Claude Code regenerate the file rather than hand-restoring partial copies
When it happens
Trigger: Calling loadUserPermissions when ~/.claude/settings.json (or the configured user settings path) is unreadable or invalid JSON, or when fields like permissions.agents/commands/hooks/mcps have unexpected types that break the spread/push logic.
Common situations: Malformed user settings.json from manual editing; settings file truncated by a crash during write; HOME unset or pointing somewhere unexpected in CI/containers so the settings path resolves oddly; schema drift after a Claude Code upgrade.
Related errors
- Warning: Error loading permissions
- Warning: Error loading plugin permissions for ${plugin.name}
- Invalid session file - corrupted or not a Claude Code sessio
- Failed to load permissions
- Warning: Could not read agents directory ${agentsDir}:
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/d8ff2c2b78ce7ff0.
Report an issue: GitHub.