{"record":{"id":"337e65c5f757c035","repo":"gastownhall/beads","slug":"setting-up-stealth-mode-v-337e65","errorCode":null,"errorMessage":"setting up stealth mode: %v","messagePattern":"setting up stealth mode: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init_proxied_server.go","lineNumber":104,"sourceCode":"\t\tfmt.Fprintf(os.Stderr, \"Warning: failed to initialize config: %v\\n\", err)\n\t}\n\n\tif err := checkExistingBeadsData(in.prefix); err != nil {\n\t\treturn err\n\t}\n\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get current directory: %v\", err)\n\t}\n\n\tfsProvider := fs.NewFileSystemProvider(cwd, newBeadsDirTemplates(), newFileSystemAdapters())\n\tfsUseCase := fsProvider.BeadsDirFSUseCase()\n\tgitUC := git.NewGitProvider(cwd).GitUseCase()\n\n\tif in.stealth {\n\t\tif err := fsUseCase.SetupStealthMode(ctx, !in.quiet); err != nil {\n\t\t\treturn fmt.Errorf(\"setting up stealth mode: %v\", err)\n\t\t}\n\t\tin.skipHooks = true\n\t}\n\n\tprefix, err := resolveInitPrefix(in.prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tproxiedInit, err := fsUseCase.ResolveProxiedInit(ctx, domain.ResolveProxiedInitParams{\n\t\tPrefix: prefix,\n\t\tDBFlag: in.database,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolving proxied init: %v\", err)\n\t}\n\tbeadsDir, hasExplicitBeadsDir := proxiedInit.BeadsDir, proxiedInit.HasExplicit\n\tdbName, projectID := proxiedInit.DBName, proxiedInit.ProjectID","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init_proxied_server.go#L86-L122","documentation":"When --stealth is passed, runInitProxiedServer delegates to fsUseCase.SetupStealthMode to configure stealth (hidden .beads) layout. A failure there is wrapped with this message and init aborts; hooks are skipped because in.skipHooks is only set after stealth setup succeeds.","triggerScenarios":"SetupStealthMode(ctx, !in.quiet) returns an error while setting up the stealth-mode directory layout — typically filesystem permission or IO errors creating/renaming the stealth .beads structure.","commonSituations":"Read-only or restricted filesystems blocking the stealth layout changes, conflicts with an existing non-stealth .beads directory, or sandboxed environments that disallow the required renames.","solutions":["Read the wrapped cause after the colon to see whether it's permissions, conflicts, or IO.","Fix permissions on the repo root so stealth layout changes can be applied, then re-run.","Remove or resolve any conflicting existing .beads directory before using --stealth.","Retry without --stealth to confirm the failure is specific to stealth setup."],"exampleFix":"// before\nbd init --proxied-server --stealth  // setting up stealth mode: permission denied\n// after\nchmod u+w /path/to/repo/.beads  # or resolve conflicting .beads\nbd init --proxied-server --stealth","handlingStrategy":"try-catch","validationCode":"// Ensure repo root and .beads are writable before stealth setup\nif fi, err := os.Stat(\".beads\"); err == nil && fi.Mode()&0200 == 0 {\n    return errors.New(\".beads not writable for stealth setup\")\n}","typeGuard":null,"tryCatchPattern":"if err := fsUseCase.SetupStealthMode(ctx, !in.quiet); err != nil {\n    // wrapped as: setting up stealth mode: %v — inspect cause, fix perms/conflict, retry\n    return err\n}","preventionTips":["Resolve any pre-existing .beads directory before using --stealth.","Run init with write access to the repo root.","Test stealth setup outside sandboxes that block directory renames.","Retry without --stealth to isolate whether the failure is stealth-specific."],"tags":["filesystem","init","stealth"],"backgroundTag":"stealth-setup-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}