{"record":{"id":"5d9b0ed351287313","repo":"Yeachan-Heo/oh-my-codex","slug":"tmux-hook-config-missing-run-omx-tmux-hook-init","errorCode":null,"errorMessage":"tmux-hook config missing. Run: omx tmux-hook init","messagePattern":"tmux-hook config missing\\. Run: omx tmux-hook init","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/tmux-hook.ts","lineNumber":179,"sourceCode":"\n  return {\n    enabled: parsed.enabled,\n    target: { type: targetObj.type, value: targetObj.value },\n    allowed_modes: allowedModes,\n    cooldown_ms: cooldown,\n    max_injections_per_session: maxInjections,\n    prompt_template: promptTemplate,\n    marker,\n    dry_run: parsed.dry_run,\n    log_level: parsed.log_level,\n    skip_if_scrolling: parsed.skip_if_scrolling === false ? false : true,\n  };\n}\n\nasync function readValidatedConfig(cwd = process.cwd()): Promise<TmuxHookConfig> {\n  const configPath = tmuxHookConfigPath(cwd);\n  if (!existsSync(configPath)) {\n    throw new Error('tmux-hook config missing. Run: omx tmux-hook init');\n  }\n  const content = await readFile(configPath, 'utf-8');\n  return parseConfig(JSON.parse(content));\n}\n\nasync function loadConfigForCommand(\n  commandName: 'status' | 'validate' | 'test',\n  cwd = process.cwd(),\n): Promise<{ config: TmuxHookConfig; initResult: InitConfigResult | null }> {\n  const configPath = tmuxHookConfigPath(cwd);\n  let initResult: InitConfigResult | null = null;\n\n  if (!existsSync(configPath)) {\n    initResult = await initTmuxHookConfig({ silent: true, cwd });\n    if (initResult.created) {\n      console.log(`No tmux-hook config found. Created ${initResult.configPath}.`);\n      if (initResult.detectedSession) {\n        console.log(`Detected tmux session: ${initResult.detectedSession}`);","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/tmux-hook.ts#L161-L197","documentation":"readValidatedConfig could not find the tmux-hook config file on disk (the existsSync check failed), so the command cannot proceed. The error message directs the user to run the init subcommand that scaffolds the config.","triggerScenarios":"Running `omx tmux-hook install` (or any config-requiring subcommand) before `omx tmux-hook init`; deleting or moving the .omx/tmux-hook config; running from a directory without an initialized .omx root.","commonSituations":"Fresh clones or new machines where init was never run; wrong working directory (config path is cwd-relative); clean scripts that wipe local state.","solutions":["Run omx tmux-hook init to scaffold the config, then retry","Verify you are in the project root where .omx/ lives","If config exists elsewhere, run from the directory containing the .omx directory"],"exampleFix":"# before\nomx tmux-hook install  # Error: config missing\n# after\nomx tmux-hook init && omx tmux-hook install","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync(join(cwd, '.omx', 'tmux-hook.json'))) {\n  await exec('omx tmux-hook init');\n}","typeGuard":null,"tryCatchPattern":"try { await hookCommand(); } catch (e) { if (e instanceof Error && e.message.includes('config missing')) { await exec('omx tmux-hook init'); await hookCommand(); } else throw e; }","preventionTips":["Run omx tmux-hook init once per project after clone","Run omx from the project root containing .omx/","Include init in setup scripts for new machines"],"tags":["config","missing-file","init","tmux-hook"],"backgroundTag":"missing-config-file","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}