affaan-m/ECC · error

Value for ${argument} is too long.

Error message

Value for ${argument} is too long.

What it means

Each value for --harness, --claude-scope, --claude-hooks, and --profile is capped at 256 characters. A longer value is rejected to guard against absurd or hostile input before it is stored in the options object.

Source

Thrown at scripts/install-guided.js:84

    profile: undefined,
    yes: false,
  };
  const valueFlags = new Map([
    ['--harness', 'harnesses'],
    ['--claude-scope', 'claudeScope'],
    ['--claude-hooks', 'claudeHooks'],
    ['--profile', 'profile'],
  ]);

  for (let index = 0; index < argv.length; index += 1) {
    const argument = argv[index];
    if (valueFlags.has(argument)) {
      const value = argv[index + 1];
      if (!value || value.startsWith('--')) {
        throw new Error(`Missing value for ${argument}`);
      }
      if (value.length > 256) {
        throw new Error(`Value for ${argument} is too long.`);
      }
      const key = valueFlags.get(argument);
      options = key === 'harnesses'
        ? { ...options, harnesses: [...options.harnesses, value] }
        : { ...options, [key]: value };
      index += 1;
    } else if (argument === '--all-harnesses') {
      options = { ...options, allHarnesses: true };
    } else if (argument === '--yes' || argument === '-y') {
      options = { ...options, yes: true };
    } else if (argument === '--dry-run') {
      options = { ...options, dryRun: true };
    } else if (argument === '--json') {
      options = { ...options, json: true };
    } else if (argument === '--help' || argument === '-h') {
      options = { ...options, help: true };
    } else {
      throw new Error('Unknown argument. Run guided install with --help to see valid options.');

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Shorten the value to a single, valid token (e.g. claude, user, standard, core)
  2. Check the shell variable you are interpolating is not accidentally huge
  3. Pass harnesses one at a time with repeated --harness flags instead of one long value
Defensive patterns

Strategy: validation

Validate before calling

const VALUE_FLAGS = new Set(['--harness','--claude-scope','--claude-hooks','--profile']);
for (let i = 0; i < argv.length; i++) {
  if (VALUE_FLAGS.has(argv[i])) {
    const v = argv[i + 1] || '';
    if (v.length > 256) throw new Error(`Value for ${argv[i]} exceeds 256 chars`);
  }
}

Type guard

function isWithinValueLimit(value, max = 256) {
  return typeof value === 'string' && value.length > 0 && value.length <= max;
}

Try / catch

try { parseInstallGuidedArgs(argv); }
catch (err) {
  if (/is too long/.test(err.message)) {
    console.error(err.message);
    process.exit(2);
  }
  throw err;
}

Prevention

When it happens

Trigger: Passing a pathological value such as a 300-character string after one of the value flags, or accidentally glob-expanding a huge path into a flag value.

Common situations: A shell expansion or variable that unexpectedly contains a very long string, or a copy-paste of a file path list where a single value is expected.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/7fdd20430786045d. Report an issue: GitHub.