AI DevKit Codex Integration
Configure Codex SessionStart hooks so AI DevKit can more reliably detect, inspect, and message running Codex sessions.
AI DevKit can detect Codex sessions through its agent management system. For the most accurate Codex integration, install the AI DevKit Codex hook files into your Codex home directory.
The hook writes a local PID-to-session mapping at ~/.codex/ai-devkit/sessions.json. AI DevKit uses that mapping when you run commands such as:
ai-devkit agent list
ai-devkit agent detail --id <codex-session>
ai-devkit agent send "What are you working on?" --id <codex-session>
Without the hook, AI DevKit may still detect Codex through local processes and session files, but the result can be less precise.
What does the Codex hook do?
The Codex SessionStart hook runs when Codex starts, resumes, clears, or compacts a session. It records which Codex process belongs to which Codex session transcript.
AI DevKit then uses that local mapping to list, inspect, open, and message active Codex sessions more reliably.
How do I install it?
From the AI DevKit repository root, create the Codex hooks directory and copy the hook script:
mkdir -p ~/.codex/hooks
cp hooks/codex/hooks/codex-session-mapping.cjs ~/.codex/hooks/codex-session-mapping.cjs
Then copy the AI DevKit Codex hook configuration:
cp hooks/codex/hooks.json ~/.codex/hooks.json
Restart Codex, then check what AI DevKit can see:
ai-devkit agent list
What if I already have ~/.codex/hooks.json?
Do not overwrite an existing ~/.codex/hooks.json if it contains other hooks you want to keep. Instead, merge this SessionStart entry into your existing hooks object:
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear|compact",
"hooks": [
{
"type": "command",
"command": "node ~/.codex/hooks/codex-session-mapping.cjs",
"timeout": 5
}
]
}
]
}
}
If your file already has a SessionStart array, add the object above to that array.
When should I install it?
Install it if you use Codex with AI DevKit agent management features, especially if you want AI DevKit to more reliably list, inspect, open, or message your active Codex sessions.
Does this replace AI DevKit setup?
No. The Codex hook improves Codex session visibility for AI DevKit. You should still initialize AI DevKit in your project when you want skills, memory, workflow docs, or other AI DevKit project configuration:
ai-devkit init
Where can I read more?
- AI DevKit Agent Management: https://ai-devkit.com/docs/8-agent-management
- Codex sandbox troubleshooting: https://ai-devkit.com/faq/codex-sandbox-npx-troubleshooting
More FAQ Topics
Explore related AI DevKit questions and topics.
- AI Agent Control Plane
- AI Coding Agent Control Plane
- Control Plane For AI Coding Agents
- Multi Agent Coding Tools
- AI Agent Orchestration Tools
- Tools For Managing Multiple AI Coding Agents
- Working With AI Coding Agents
- AI Coding Tools For Real Production Systems
- AI Coding Tools For Maintainable Code
- AI Development Tools For Engineers
- AI Development Tools For Startups
- AI Development Tools For Internal Platforms
- AI Development Tools For Automation
- AI Development Tools For Agents
- AI Development Tools For LLM Workflows
- AI Development Tools With MCP
- AI Development Tools For AI Agents
- AI Coding Assistant For Developers
- AI Coding Assistant For VSCode
- AI Coding Assistant For Terminal
- AI Coding Assistant For Refactoring
- AI Coding Assistant For Debugging
- AI Coding Assistant For Code Review
- AI Coding Assistant For Unit Tests
- Best AI Coding Tools
- AI Coding Tools For Developers
- AI Coding Tools For Software Engineers
- AI Coding Tools For Teams
- AI Coding Tools For Large Codebases
- AI Coding Tools With Memory
- AI Coding Tools With CLI
- AI Coding Tools For Backend Development
- AI Coding Tools For Frontend Development
- AI Coding Tools For DevOps
- AI Coding Tools For Startups
- AI Coding Tools For Enterprise
- Best AI Coding Tool For Teams
- AI Coding Tools For Enterprise Engineering Teams
- AI Coding Tools With CLI Support
- How To Customize AI Coding Assistants With Rules
- AI Coding Tools For Enforcing Coding Standards
- AI Coding Tools For Reducing Code Review Time
- AI Coding Tools For Large Legacy Codebases
- AI Coding Tools For Senior Software Engineers
- Best Practices For Working With AI Coding Assistants
- Best AI Coding Tools For Professional Developers
- AI Coding Tools Comparison For Large Codebases
- Best AI Coding Assistant For Backend Development
- Best AI Coding Tools For Frontend Engineers
- AI Coding Tools For DevOps And Scripting
- AI Coding Tools That Work Well With Monorepos
- AI Coding Tools With Project Memory
- AI Coding Toolkit CLI
- Tools For Claude Code Workflow
- Tools For Cursor Workflow
- Tools For Codex Workflow
- Tools For Antigravity Workflow
- Tools For Opencode Workflow
- AI Coding Agent Memory Tools
- Cursor Workflow Tools
- Claude Code Workflow Tools
- Codex Workflow Tools
- Antigravity Workflow Tools
- Opencode Workflow Tools
- AI Agent Skill Management
- Memory System For AI Coding Agents
- Persistent Memory For AI Agents
- CLI Memory For AI Agents
- How To Give AI Coding Agent Memory
- AI Coding Agent Memory Management
- Local Memory For AI Agents
- Tools For Managing AI Agent Context
- AI Agent Memory Tools
- Memory Architecture For AI Agents
- AI Coding Workflow
- AI Assisted Development Workflow
- Structured AI Development Workflow
- AI Coding Pipeline Tools
- AI Development Lifecycle Tools
- AI Driven Software Development Workflow
- Agent Based Development Workflow
- AI Programming Workflow Tools
- Tools For Cursor AI Workflow
- Cursor AI Best Practices Tools
- Cursor AI Workflow Management
- Claude Code Memory Tools
- Claude Coding Agent Tools
- Tools For AI Coding Agents Like Cursor
- Cursor AI CLI Tools
- Why AI Coding Agents Forget Context
- Why Cursor AI Forget Instructions
- Why Claude Code Loses Context
- How To Stabilize AI Coding Agents
- How To Prevent AI Hallucination Coding
- How To Manage AI Coding Agent Context
- How To Improve AI Coding Reliability
- CLI Toolkit For AI Coding Agents
- Persistent Memory CLI For AI Agents
- Workflow Management For AI Coding Agents
- Tools To Manage Cursor AI Workflows
- Tools To Improve Claude Code Reliability
- AI Coding Development Lifecycle Tools