yamadashy/repomix · info
--sandbox has no effect without --mcp; it only confines the
Error message
--sandbox has no effect without --mcp; it only confines the MCP server.
What it means
runCli warns that the --sandbox option was given without --mcp. Sandbox confinement applies only to the spawned MCP server process, so in a normal packing run the flag has no effect and is ignored.
Source
Thrown at src/cli/cliRun.ts:370
} else {
logger.setLogLevel(repomixLogLevels.INFO);
}
// In stdout mode, set log level to SILENT
if (options.stdout) {
logger.setLogLevel(repomixLogLevels.SILENT);
}
// A positional argument can itself be a remote URL, and `options.remote` holds
// one by definition, so both are redacted before being dumped.
logger.trace('directories:', directories.map(redactUrl));
logger.trace('cwd:', cwd);
logger.trace('options:', redactOptionsForLog(options));
const sandboxed = options.sandbox != null && options.sandbox !== false;
if (sandboxed && !options.mcp) {
logger.warn('--sandbox has no effect without --mcp; it only confines the MCP server.');
}
if (options.mcp) {
// A string value of --sandbox is the workspace dir to confine to; otherwise use cwd.
const requestedRoot = typeof options.sandbox === 'string' ? path.resolve(cwd, options.sandbox) : cwd;
// Canonicalize the root so the guard/virtualization/error-scrubbing agree with the
// realpaths resolveWithinRoot returns. Runs before any agent connects, so surfacing
// the operator's own path in a resolution error is fine.
const sandboxRoot = sandboxed ? await canonicalizeSandboxRoot(requestedRoot) : requestedRoot;
const { runMcpAction } = await import('./actions/mcpAction.js');
return await runMcpAction({ sandboxed, cwd: sandboxRoot });
}
if (options.version) {
const { runVersionAction } = await import('./actions/versionAction.js');
await runVersionAction();
return;
}View on GitHub (pinned to f465ad9093)
Solutions
- If you want sandboxing, add --mcp so the MCP server actually runs confined.
- If you don't need it, remove --sandbox from the command line or config to silence the warning.
- For restricting what gets packed, use include/exclude patterns instead — --sandbox never limits pack scope.
- Pass a directory value (`--sandbox <dir>`) together with --mcp to choose the confined workspace root.
Example fix
// before $ repomix --sandbox ./workspace // after (sandbox actually applies) $ repomix --mcp --sandbox ./workspace
Defensive patterns
Strategy: validation
Validate before calling
if (args.includes('--sandbox') && !args.includes('--mcp')) console.warn('--sandbox requires --mcp to have any effect'); Prevention
- Only pair --sandbox with --mcp.
- Use include/exclude patterns, not --sandbox, to control what gets packed.
- Review generated scripts copied from MCP examples for stray flags.
When it happens
Trigger: CLI invoked like `repomix --sandbox` (boolean or with a dir) but without `--mcp`, making `sandboxed && !options.mcp` true at src/cli/cliRun.ts:370.
Common situations: Users assuming --sandbox restricts file access of the whole packing run; scripts combining flags copied from an MCP example; sandbox default set in config while only running a pack.
Related errors
- --skill-output can only be used with --skill-generate
- --force can only be used with --skill-generate
- --skill-project-name can only be used with --skill-generate
- --skill-output path cannot be empty
- --skill-project-name cannot be empty
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/34d986678c7015be.
Report an issue: GitHub.