Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Codex SDK, Automation and Cost: Programmatic Use, Scheduled Tasks and a Comparison with Claude Code
The Codex SDK starts local Codex threads from code; letting the workflow collect the data and running the thread read-only and without network lowers both risk and usage. A weekly dependency update plan with the TypeScript SDK, GitHub Actions versus a desktop app scheduled task, ChatGPT plans, five-hour window estimates, Fast and Ultrafast multipliers and a short, documentation-based feature comparison with Claude Code.
Code Review and CI with Codex on GitHub: `@codex review`, Automatic Review, `codex exec` and codex-action
On GitHub Codex reviews PRs with @codex review and automatic review and applies the Code Review Rules section in AGENTS.md, but it does not replace human approval. The read-only default of codex exec, JSONL and --output-schema output, the --trust behaviour in 0.169, why the API key must not sit at job level, and a codex-action workflow that reviews Bookstore's EF Core queries with a read-only profile and posts the result from a separate job.
Parallel Tasks with Codex Cloud: Cloud Environments, Setting Up .NET + Angular and Turning Work into PRs
In Codex Cloud every task runs in its own isolated workspace; you prepare and publish a reusable environment in a conversation with Codex, but putting a secret as a plain variable into an environment with full internet access opens the door to prompt injection. A .NET 10 and Angular setup script for Bookstore, NuGet missing from the package manager preset, network secrets versus environment variables, parallel attempts with --attempts and turning the result into a PR with codex apply.
The Local Workflow with Codex: Model and Effort, Worktrees, Subagents and Hooks
Codex has worktrees and subagents for parallel work, but a worktree opens with only the files Git tracks, and matching hooks start concurrently, not in order. Choosing the model and reasoning effort, side chats and plan mode, the local environment setup script in the desktop app, custom agents that inherit the sandbox, and a hash-trusted PreToolUse hook that protects Bookstore's committed migrations.
Sandbox and Approvals in Codex: Read-Only, Workspace-Write, Full Access and Auto-Review
In Codex the sandbox decides what can be done and the approval policy decides when to ask: Full access removes both, while Approve for me hands the prompts to a reviewer agent without widening the boundary. The MXC, elevated and unelevated sandboxes on native Windows, the network proxy and domain rules, protected paths, trust-gated project settings and a rules file that puts Bookstore's SQL Server tests behind an approval.
Teaching Codex Your Project: The AGENTS.md Chain, config.toml, Skills and MCP
Codex chains its instructions from the global AGENTS.md through every directory from the repo root to the working directory; the closer file comes later and wins, and anything after 32 KiB in total never reaches the model. In Bookstore: root and subfolder AGENTS.md files, a shared instruction strategy with Claude Code, the trust-gated project config.toml layer, profiles in separate files, a migration skill with implicit invocation turned off and a version-pinned MCP server.
Getting Started with OpenAI Codex: Desktop App, CLI, IDE Extension, Cloud and Installation on Windows
The first decision when starting with Codex is the sign-in method: Codex Cloud and GitHub code review work only with a ChatGPT account, while an API key gives local use only. Installing on Windows with the standalone installer, npm and WSL 2, the difference between the desktop app, CLI, IDE extension and cloud surfaces, why you should open the session at the repo root, and a first small, test-verified change in Bookstore.
Taking the Claude API to Production: Errors, Rate Limits, Cost Tracking, OpenTelemetry and the IChatClient Bridge
When you take the Claude API to production you separate the SDK's typed exceptions starting with the most specific, keep retries in one layer (the SDK), tell the spend cap apart from rate limits, and produce a cost metric from each response's usage. The SDK 13.8 error hierarchy, 529 and 429 retry behavior, double retries with Polly, the cache's effect on ITPM, OpenTelemetry spans and the IChatClient bridge that ignores temperature.
An Overview of Claude Managed Agents: Agents, Environments, Sessions and When to Choose Them
In Claude Managed Agents you create the agent once as a versioned definition and open a session pinned to that version on every run; Anthropic manages the loop, the container and the event history, and credentials go into a vault, not the prompt. client.Beta.Agents and Sessions in the C# SDK, agents and cron deployments from files with ant apply, session-hour pricing, and a comparison with your own loop or Agent Framework.
Skills, Code Execution and the MCP Connector in the Claude API: Using Ready-Made Capabilities and Remote MCP Servers
To produce files such as Excel in the Claude API you send the xlsx skill in container.skills together with the code execution tool and download the file_ids returned from $OUTPUT_DIR with the Files API; a remote MCP server is connected through the mcp_servers and mcp_toolset pair with a beta header. Sandbox limits and pricing, uploading a custom SKILL.md, pause_turn and the container, allowlists, token scope, and the SDK's null and list behavior.
Message Batches and the Files API: Running Bulk Jobs at Half Price and Uploading Files Once
You send thousands of non-urgent Claude requests at a 50% discount with the Message Batches API, match results by custom_id rather than order, and store the batch id so nothing is sent twice; with the Files API you upload a file once and use it by file_id. Four result types, a nightly BackgroundService job, the 24-hour and 29-day limits, expires_in_seconds, file_id security and caching the document block.
Prompt Caching in Claude: Cache Breakpoints, TTL and Cutting Costs by up to 90%
For prompt caching in Claude you put stable content (tools, system) first, end it with a cache_control breakpoint and add top-level automatic caching for the conversation; you confirm the cache works with cache_read_input_tokens in usage and with cache diagnostics. 5-minute and 1-hour TTL prices, the 512-token minimum, a cost calculation for 1,000 requests, silent breakers such as DateTime.Now, compaction and context editing.