How to Set Up Codex Skills from Claude Code Commands in ai-berkshire
To set up Codex skills from Claude Code commands in ai-berkshire, clone the repository and run ./scripts/install-codex-skills.sh, which automatically converts the Markdown files in skills/ into Codex-compatible packages and installs them to $HOME/.codex/skills.
The ai-berkshire repository maintains investment-research commands as Claude Code-compatible Markdown files under skills/. When you set up Codex skills from these Claude Code commands, the repository's automation scripts generate platform-specific packages and configure your local Codex environment to recognize them.
Step-by-Step Installation Process
Clone the Repository
Start by cloning the ai-berkshire repository to access the skill definitions and automation scripts.
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire
Generate and Install Codex Skills
Run the main installation script to convert Claude Code commands into Codex skills. This script calls scripts/sync-codex-skills.py internally to parse the Markdown frontmatter and body from skills/*.md, then copies the generated packages to your Codex skills directory.
./scripts/install-codex-skills.sh
By default, the script installs skills to $HOME/.codex/skills, creating subdirectories like ~/.codex/skills/investment-research/ containing SKILL.md and supporting assets.
Install Optional Slash-Command Prompts
For a Claude Code-like slash command interface (/prompts:investment-research), install the optional prompt wrappers.
./scripts/install-codex-prompts.sh
This copies plain-text prompt files from codex-prompts/ into your Codex configuration, enabling invocation via the /prompts: prefix.
Restart Codex
After installation, restart your Codex CLI or reload your IDE's Codex extension to load the newly installed skills. You can then invoke skills by name (e.g., investment-research) or via slash prompts.
Understanding the Sync Architecture
The ai-berkshire repository uses a single source of truth pattern where skills/*.md files serve as the canonical definitions.
Source Files in skills/
Each Claude Code command lives as a self-contained Markdown file with YAML frontmatter. For example, skills/investment-research.md contains the command definition, description, and execution logic.
The Sync Script
scripts/sync-codex-skills.py traverses the skills/ directory and generates Codex-compatible structures under codex-skills/<skill-name>/SKILL.md. The script handles:
- Parsing Markdown frontmatter (name, description)
- Converting body content to Codex skill format
- Copying referenced assets and tool scripts
Tooling Integration
Helper scripts in tools/ (such as financial_rigor.py) support skill execution. The installation script automatically marks these as executable (chmod +x) during the install process, ensuring Codex can invoke them without additional setup.
Adding Custom Commands
To create a new command available in both Claude Code and Codex:
- Create a new Markdown file in
skills/:
cat > skills/my-analysis.md <<'EOF'
---
name: my-analysis
description: Runs custom financial analysis
---
# My Analysis
This skill performs automated SEC filing analysis.
**Usage**
```text
my-analysis <ticker>
EOF
2. Regenerate and reinstall:
```bash
./scripts/install-codex-skills.sh
- Invoke in Codex:
my-analysis AAPL
Code Examples
Full Setup Workflow
# Clone repository
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire
# Install Codex skills and prompts
./scripts/install-codex-skills.sh
./scripts/install-codex-prompts.sh
# Verify installation
ls ~/.codex/skills/
Updating Skills After Changes
When you modify files in skills/, you must rerun the sync process to update Codex:
# Edit the source
vim skills/investment-research.md
# Sync changes
./scripts/install-codex-skills.sh
Using Slash Prompts
If you installed the optional prompts, access them via:
/prompts:investment-research Tesla
This forwards to the underlying investment-research skill with the provided argument.
Summary
- Source of truth: The
skills/directory contains canonical Claude Code command definitions in Markdown format. - Generation:
scripts/sync-codex-skills.pyconverts these Markdown files into Codex-compatible skill packages. - Installation:
scripts/install-codex-skills.shhandles both generation and installation to$HOME/.codex/skills. - Optional UI:
scripts/install-codex-prompts.shenables slash-command syntax similar to Claude Code. - Synchronization: Always rerun the install script after editing
skills/*.mdto keep Codex updated.
Frequently Asked Questions
What is the difference between Claude Code commands and Codex skills?
Claude Code commands are defined as Markdown files in skills/ with specific frontmatter and instructions. Codex skills are the same logical commands packaged into a directory structure (codex-skills/<skill>/SKILL.md) that the Codex CLI recognizes. The scripts/sync-codex-skills.py file bridges these formats automatically.
Do I need to reinstall Codex skills after editing the Markdown files?
Yes. The skills/ directory is the canonical source, and changes are not automatically synced to Codex. You must run ./scripts/install-codex-skills.sh after any modification to skills/*.md to regenerate the Codex packages and copy them to $HOME/.codex/skills.
Where are the generated Codex skills stored locally?
By default, the installation script copies generated skills to $HOME/.codex/skills/ (or $CODEX_HOME/skills if that environment variable is set). Each skill appears as a subdirectory containing SKILL.md and any supporting tool scripts from the tools/ directory.
How do I add a new command to both Claude Code and Codex?
Create a new Markdown file in skills/ with the appropriate frontmatter (name and description) and command body. After saving, run ./scripts/install-codex-skills.sh. The new command becomes available immediately in Codex after restart, and will work in Claude Code if you have the repository mounted as a project-specific skill.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →