Index: codex-rs/arg0/src/lib.rs
--- codex-rs/arg0/src/lib.rs.orig
+++ codex-rs/arg0/src/lib.rs
@@ -187,6 +187,9 @@ where
     let runtime = build_runtime()?;
     runtime.block_on(run_main_with_arg0_guard(
         path_entry_guard,
+        #[cfg(target_os = "openbsd")]
+        Some(PathBuf::from("${PREFIX}/bin/codex")),
+        #[cfg(not(target_os = "openbsd"))]
         std::env::current_exe().ok(),
         main_fn,
     ))
@@ -336,6 +339,9 @@ pub fn prepend_path_entry_for_codex_aliases() -> std::
         #[cfg(unix)]
         EXECVE_WRAPPER_ARG0,
     ] {
+        #[cfg(target_os = "openbsd")]
+        let exe = PathBuf::from("${PREFIX}/bin/codex");
+        #[cfg(not(target_os = "openbsd"))]
         let exe = std::env::current_exe()?;
 
         #[cfg(unix)]
@@ -382,7 +388,16 @@ pub fn prepend_path_entry_for_codex_aliases() -> std::
     }
 
     let paths = Arg0DispatchPaths {
-        codex_self_exe: std::env::current_exe().ok(),
+        codex_self_exe: {
+            #[cfg(target_os = "openbsd")]
+            {
+                Some(PathBuf::from("${PREFIX}/bin/codex"))
+            }
+            #[cfg(not(target_os = "openbsd"))]
+            {
+                std::env::current_exe().ok()
+            }
+        },
         codex_linux_sandbox_exe: {
             #[cfg(target_os = "linux")]
             {
