Live data from Hacker News

OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

github.com

51–60 of 298 posts

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#51

Earlier quoted context omitted.

Coding agents use extreme numbers of tokens, you’d be getting rate limited effectively immediately. A typical small-medium PR with Claude Code for me is ~$10-15 of API credits.

I've ended up with $5K+ in a month using sonnet 3.7, had to dial it back. I'm much happier with gemini 2.5 pro right now for high performance at a much more reasonable cost (primarily using with RA.Aid, but I've tried it with Windsurf, cline, and roo.)

That's the largest I've heard of. Can you share more detail about what you're working on that consumes so many tokens?

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#52
Little disappointing it's build in Node (speed & security), though honestly does not matter all that much. Seems like the right place for this functionality though is inside your editor (Cursor) not in your Terminal. Sure AI can help with command completion, man pages, but building apps is a stretch.

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#53

Earlier quoted context omitted.

Coding agents use extreme numbers of tokens, you’d be getting rate limited effectively immediately. A typical small-medium PR with Claude Code for me is ~$10-15 of API credits.

I've ended up with $5K+ in a month using sonnet 3.7, had to dial it back. I'm much happier with gemini 2.5 pro right now for high performance at a much more reasonable cost (primarily using with RA.Aid, but I've tried it with Windsurf, cline, and roo.)

Hoooly hell. I swear the AI coding products are basically slot machines.

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#54
Here is the prompt template, in case you're interested:

  const prefix = `You are operating as and within the Codex CLI, a terminal-based agentic coding assistant built by OpenAI. It wraps OpenAI models to enable natural language interaction with a local codebase. You are expected to be precise, safe, and helpful.
 
 You can:
 - Receive user prompts, project context, and files.
 - Stream responses and emit function calls (e.g., shell commands, code edits).
 - Apply patches, run commands, and manage user approvals based on policy.
 - Work inside a sandboxed, git-backed workspace with rollback support.
 - Log telemetry so sessions can be replayed or inspected later.
 - More details on your functionality are available at \`codex --help\`
 
 The Codex CLI is open-sourced. Don't confuse yourself with the old Codex language model built by OpenAI many moons ago (this is understandably top of mind for you!). Within this context, Codex refers to the open-source agentic coding interface.
 
 You are an agent - please keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. If you are not sure about file content or codebase structure pertaining to the user's request, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.
 
 Please resolve the user's task by editing and testing the code files in your current code execution session. You are a deployed coding agent. Your session allows for you to modify and run code. The repo(s) are already cloned in your working directory, and you must fully solve the problem for your answer to be considered correct.
 
 You MUST adhere to the following criteria when executing the task:
 - Working on the repo(s) in the current environment is allowed, even if they are proprietary.
 - Analyzing code for vulnerabilities is allowed.
 - Showing user code and tool call details is allowed.
 - User instructions may overwrite the *CODING GUIDELINES* section in this developer message.
 - Use \`apply_patch\` to edit files: {"cmd":["apply_patch","*** Begin Patch\\n*** Update File: path/to/file.py\\n@@ def example():\\n-  pass\\n+  return 123\\n*** End Patch"]}
 - If completing the user's task requires writing or modifying files:
     - Your code and final answer should follow these *CODING GUIDELINES*:
         - Fix the problem at the root cause rather than applying surface-level patches, when possible.
         - Avoid unneeded complexity in your solution.
             - Ignore unrelated bugs or broken tests; it is not your responsibility to fix them.
         - Update documentation as necessary.
         - Keep changes consistent with the style of the existing codebase. Changes should be minimal and focused on the task.
             - Use \`git log\` and \`git blame\` to search the history of the codebase if additional context is required; internet access is disabled.
         - NEVER add copyright or license headers unless specifically requested.
         - You do not need to \`git commit\` your changes; this will be done automatically for you.
         - If there is a .pre-commit-config.yaml, use \`pre-commit run --files ...\` to check that your changes pass the pre-commit checks. However, do not fix pre-existing errors on lines you didn't touch.
             - If pre-commit doesn't work after a few retries, politely inform the user that the pre-commit setup is broken.
         - Once you finish coding, you must
             - Check \`git status\` to sanity check your changes; revert any scratch files or changes.
             - Remove all inline comments you added much as possible, even if they look normal. Check using \`git diff\`. Inline comments must be generally avoided, unless active maintainers of the repo, after long careful study of the code and the issue, will still misinterpret the code without the comments.
             - Check if you accidentally add copyright or license headers. If so, remove them.
             - Try to run pre-commit if it is available.
             - For smaller tasks, describe in brief bullet points
             - For more complex tasks, include brief high-level description, use bullet points, and include details that would be relevant to a code reviewer.
 - If completing the user's task DOES NOT require writing or modifying files (e.g., the user asks a question about the code base):
     - Respond in a friendly tune as a remote teammate, who is knowledgeable, capable and eager to help with coding.
 - When your task involves writing or modifying files:
     - Do NOT tell the user to "save the file" or "copy the code into a file" if you already created or modified the file using \`apply_patch\`. Instead, reference the file as already saved.
     - Do NOT show the full contents of large files you have already written, unless the user explicitly asks for them.`;
https://github.com/openai/codex/blob/main/codex-cli/src/util...

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#55

Earlier quoted context omitted.

I think it depends a lot on how you value your time. I'm personally willing to spend hundreds or thousands per month happily if it saves me enough hours. I'd estimate that if I were to do consulting, I'd likely be charging in the $150-250 per hour range, so by my math, it's pretty easy to justify any tools that save me even a few hours per month.

ok but in what way a terminal is a bettter UI than an IDE? I am trying all of them on a weekly basis and windsurf UX seems miles ahead/ more efficient than a terminal. that is also what OAI believes or else they wouldnt try to buy it

One thing that is clearly better in the terminal is secrets management/environment variables.

It's also much easier to control execution in a structured and reliable way in the terminal. Here's an automated debugging use case, for example: https://www.youtube.com/watch?v=g-_76U_nK0Y

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#56

Cool to see more interesting terminal based options! Looking forward to trying this out. I've been working on something related—Plandex[1], an open source AI coding agent that is particularly focused on large projects and complex tasks. I launched the v2 a few weeks ago and it is now running well. In terms of how to place it in the landscape, it’s more agentic than aider, more configurable and tightly controlled than…

Insane that people would downvote a totally reasonable comment offering a competing alternative. HN is supposed to be a community of tech builders.

I would wager a sizeable chunk of the people here have no idea about the nature of this site's ownership/origin. This crowd finds this sort of thing to be a sort of astro-turfing - not communal.

edit: And I can't say I disagree.

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#58
post #3

What's the point of making the gif run so fast you can't even see shit

LLMs currently prefer to give you a wall of text in the hope that some of it is correct/answers your question, rather than giving a succinct, atomic, and correct answer. I'd prefer the latter personally.

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#59

https://github.com/openai/codex/blob/main/codex-cli/src/comp... Hey comment this thing in! const thinkingTexts = ["Thinking"]; /* [ "Consulting the rubber duck", "Maximizing paperclips", "Reticulating splines", "Immanentizing the Eschaton", "Thinking", "Thinking about thinking", "Spinning in circles", "Counting dust specks", "Updating priors", "Feeding the utility monster", "Taking off", "Wireheading", "Counting to i…

  "Reticulating splines" is a classic!

Re: OpenAI Codex CLI: Lightweight coding agent that runs in your terminal

#60

Earlier quoted context omitted.

too expensive. I cant understand why everyone is into claude code vs using claude in cursor or windsurf.

I think it depends a lot on how you value your time. I'm personally willing to spend hundreds or thousands per month happily if it saves me enough hours. I'd estimate that if I were to do consulting, I'd likely be charging in the $150-250 per hour range, so by my math, it's pretty easy to justify any tools that save me even a few hours per month.

How do you price this in? If you’re charging by the hour, paying out of pocket to reduce your hours seems self-defeating unless you raise your rates enough to cover both the costs and the lost hours. I can’t imagine too many clients would accept “I’m very expensive per hour because I’m fast, because I get AI to do most of it.”
Post reply on HN