Codex CLI / Gemini CLI is similar to Claude Code's user experience

This is Ohara (@No_oLimits) from the Service Reliability Group (SRG) of the Media Headquarters.
#SRG(Service Reliability Group) is a group that mainly provides cross-sectional support for the infrastructure of our media services, improving existing services, launching new ones, and contributing to OSS.
This article is an introduction to Codex CLI and Gemini CLI to bring the user experience closer to Claude Code.

Introduction


What is your favorite AI agent? I use Claude Code, Codex CLI, and Gemini CLI, and I mainly use Claude Code.
Claude Code has usage limits such as 5-hour limits and weekly limits. When I hit these limits, I consider working with other tools, or I use other tools to work on my projects to avoid unnecessarily consuming tokens with Claude Code.
When faced with situations like this, wouldn't it be great if you could maintain as much of the same experience as possible with Codex CLI or Gemini CLI?
I would like to introduce some ideas for achieving a consistent development experience across tools.
 

Memory file aggregation


My Claude Code has several global memory files that are the culmination of years of blood, sweat, and tears, and these files basically contain instructions that are common to all project directories I'm working in. CLAUDE.md has a reference to an entry point md (LOCALRULES.md), which in turn references several other memory files.
customrules
Then move the memory file to the customrules directory and modify the path to the memory file in the entry point of CLAUDE.md.
 
Similarly, create symbolic links for Codex CLI and Gemini CLI and write AGENTS.md and GEMINI.md.
For now, I've set it up as follows:
In this way, by referencing a common directory, it is possible to give the same context to any agent that is started.
 

Check if memory is readable


As a test, let’s load an issue in a repository in the SRG org. The issue itself is just a link to Claude Code’s Github issue.
Claude Code's memory has instructions to retrieve GitHub issue URLs using gh cli. This also applies to Codex CLI and Gemini CLI.
The terminal on the left is Gemini CLI and the terminal on the right is Codex CLI.
Looking at the running log, I saw that it was being checked with the gh command. It looks good.
By the way, before setting up the shared memory, both tools responded with "Could not load because it is a private repository."
 
This will enable common global memory management across the three tools.
 

Implementing Subagent functionality


One of the great attractions of Claude Code is the subagent feature, which separates a task and runs it in a separate session. This feature allows you to investigate and fix the task without taking up space in the main session's context window. It's very convenient and I use it often.
In order to reproduce this Subagent with Codex CLI and Gemini CLI, we introduced a mechanism to launch a new session from the main session and allow sessions to communicate with each other.
 

Codex CLI implementation


Codex CLI has an option to prompt you with the launch command and return the answer. Recently, the skills feature was added, so we will describe how to execute these commands in skill format to achieve a pseudo-Subagent function.
The first time you run it, use the following command:
To resume work, save the session ID included in the initial response in the main session and resume with the following command.
 
skill-creator
This skill can also be loaded using the Codex CLI.
 
After discussing with skill-creator, I created SKILL.md as follows.
SKILL.md
 
A new session must be started in order for the skill to be recognized. If you resume a session, the skill will not be recognized and the subagent will not be able to run. Please be careful.
The prompt includes "subagent," so we can see that it's checking the subagent's SKILL.md. There's an error when starting a new subagent session, but let's leave that aside for now. It makes good use of session resumption and gives a good response. It looks good.
codex resume
 

Implementation with Gemini CLI


Gemini CLI does not have a skills function, so you can write procedures in global memory.
To start a session with Gemini CLI:
When resuming, specify the session ID to continue.
 
GEMINI_SUBAGENT.md
The contents also contain instructions on how to run the Codex CLI subagent, so we will modify it for Gemini CLI. Start Gemini CLI and modify the session start/restart commands.
GEMINI_SUBAGENT.md
 
Let's check the operation of subagent with Gemini CLI. Let's ask a similar question.
It looks good. I'll try the resume feature while I'm at it.
The resume function was also confirmed.
 

Conclusion


We have created an environment where you can work with Codex CLI and Gemini CLI while maintaining the feel of Claude Code.
Increasing commonality across multiple AI tools will make collaborating with AI more stress-free.
 
SRG is looking for people to work with us.
If you are interested, please contact us here.