Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(devex): streamline codex commands (#71699)

Raúl Negrón-Otero57eda7753242
diff --git a/.codex/config.toml b/.codex/config.toml
index 56caeeb903a8..f2c895fb63bb 100644
--- a/.codex/config.toml
+++ b/.codex/config.toml
@@ -1,12 +1,12 @@
developer_instructions = """
-Run commands that depend on PostHog's development environment through
-`bash "$(git rev-parse --show-toplevel)/.codex/with-flox" <command> [args...]`.
+Run commands that depend on PostHog's development environment from the repository
+root through `.codex/with-flox <command> [args...]`.
This includes hogli, Python and uv, Node.js and pnpm, Rust and Go, and local-stack
commands. Basic filesystem, Git, and GitHub commands can run directly. Never use
-a dependency executable inherited from another checkout. If the wrapper reports
-that setup or a dependency change needs elevated execution, rerun that same
-wrapper command with elevated permissions. Dependency changes also apply the
-existing dev sandbox.
+a dependency executable inherited from another checkout. Request elevated
+execution on the first attempt for environment preparation, dependency changes,
+and local-stack lifecycle commands. Dependency changes also apply the existing
+dev sandbox.
"""
[sandbox_workspace_write]
diff --git a/.codex/environments/environment.toml b/.codex/environments/environment.toml
index 7f26237e56f9..bb1e6339ed2d 100644
--- a/.codex/environments/environment.toml
+++ b/.codex/environments/environment.toml
@@ -2,4 +2,4 @@ version = 1
name = "posthog"
[setup]
-script = "bash .codex/with-flox --prepare true"
+script = ".codex/with-flox --prepare true"
diff --git a/.codex/with-flox b/.codex/with-flox
old mode 100644
new mode 100755
index 56d4432fc29f..6f0593af44f9
--- a/.codex/with-flox
+++ b/.codex/with-flox
@@ -9,7 +9,7 @@ if [[ "${1:-}" == "--prepare" ]]; then
fi
if (($# == 0)); then
- echo "usage: bash .codex/with-flox [--prepare] <command> [args...]" >&2
+ echo "usage: .codex/with-flox [--prepare] <command> [args...]" >&2
exit 2
fi
@@ -187,7 +187,7 @@ fi
if [[ "$prepare" -eq 0 ]]; then
if [[ ! -f "$env_file" ]]; then
- echo "error: Codex environment is not prepared; run 'bash $repo_root/.codex/with-flox --prepare true'" >&2
+ echo "error: Codex environment is not prepared; run '$repo_root/.codex/with-flox --prepare true'" >&2
exit 1
fi
@@ -221,7 +221,7 @@ if [[ "$prepare" -eq 0 ]]; then
cached_variables=$((cached_variables + 1))
done < "$env_file"
if [[ "$cached_variables" -eq 0 || "$cached_fingerprint" != "$(environment_fingerprint)" ]]; then
- echo "error: Codex environment is stale; run 'bash $repo_root/.codex/with-flox --prepare true'" >&2
+ echo "error: Codex environment is stale; run '$repo_root/.codex/with-flox --prepare true'" >&2
exit 1
fi