fix: sync Claude Code skills/commands to Codex sessions
Codex sessions now also receive skills and commands from ~/.claude/ in addition to ~/.codex/, so both agents share the same tool set (patch, linear, sentry, coolify, exa, playwright, sprite, etc.)
This commit is contained in:
@@ -241,25 +241,40 @@ function prepareGroupEnvironment(
|
|||||||
fs.copyFileSync(src, dst);
|
fs.copyFileSync(src, dst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Sync skills into Codex session dir (same sources as Claude Code)
|
// Sync skills and commands into Codex session dir
|
||||||
const codexSkillsDst = path.join(sessionCodexDir, 'skills');
|
// Sources: ~/.codex/, ~/.claude/ (shared), container/skills/
|
||||||
const codexSkillSources = [
|
const codexSyncDirs = [
|
||||||
|
{
|
||||||
|
dst: path.join(sessionCodexDir, 'skills'),
|
||||||
|
sources: [
|
||||||
path.join(hostCodexDir, 'skills'),
|
path.join(hostCodexDir, 'skills'),
|
||||||
|
path.join(os.homedir(), '.claude', 'skills'),
|
||||||
path.join(projectRoot, 'container', 'skills'),
|
path.join(projectRoot, 'container', 'skills'),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dst: path.join(sessionCodexDir, 'commands'),
|
||||||
|
sources: [
|
||||||
|
path.join(hostCodexDir, 'commands'),
|
||||||
|
path.join(os.homedir(), '.claude', 'commands'),
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
for (const src of codexSkillSources) {
|
for (const { dst, sources } of codexSyncDirs) {
|
||||||
|
for (const src of sources) {
|
||||||
if (!fs.existsSync(src)) continue;
|
if (!fs.existsSync(src)) continue;
|
||||||
for (const entry of fs.readdirSync(src)) {
|
for (const entry of fs.readdirSync(src)) {
|
||||||
const srcPath = path.join(src, entry);
|
const srcPath = path.join(src, entry);
|
||||||
const dstPath = path.join(codexSkillsDst, entry);
|
const dstPath = path.join(dst, entry);
|
||||||
if (fs.statSync(srcPath).isDirectory()) {
|
if (fs.statSync(srcPath).isDirectory()) {
|
||||||
fs.cpSync(srcPath, dstPath, { recursive: true });
|
fs.cpSync(srcPath, dstPath, { recursive: true });
|
||||||
} else {
|
} else {
|
||||||
fs.mkdirSync(codexSkillsDst, { recursive: true });
|
fs.mkdirSync(dst, { recursive: true });
|
||||||
fs.copyFileSync(srcPath, dstPath);
|
fs.copyFileSync(srcPath, dstPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Inject nanoclaw MCP server into Codex config.toml
|
// Inject nanoclaw MCP server into Codex config.toml
|
||||||
const mcpServerPath = path.join(
|
const mcpServerPath = path.join(
|
||||||
|
|||||||
Reference in New Issue
Block a user