Advanced Workflow Optimization for Codeex

Matthew Bermango watch the original →

Maximize Codeex performance by using model-specific task routing, persistent goal-based loops, and security hooks to prevent accidental file system deletion.

Model Selection and Task Routing

For optimal performance, match the model size to the task complexity. Use GPT 5.6 Soul for high-complexity problems and GPT 5.6 Luna for routine tasks. Avoid the 'fast' setting for critical work, as it increases costs by 2.5x while providing only a 1.5x speed improvement. You can delegate tasks between threads by initiating new threads from within an existing one, allowing for parallel execution and management. Use the following pattern to trigger a sub-task:

Create a new thread using GPT 5.6 Luna Max and give it the prompt [prompt]

Loop-Based Goal Execution

Move away from single-prompt interactions by using 'goals' to define an objective that the agent iterates on until completion. This is effective for tasks like benchmark optimization where the agent must repeatedly run tests, analyze failures, and refactor code. Use the loopy skill to draft these goals based on your specific codebase. A typical goal-oriented prompt looks like this:

/goal run our benchmark. When you're done, examine the ways that Astro failed and attempt to fix them. Continue iterating on this until our benchmark score reaches 90% or above.

Security and Safety Hooks

To prevent catastrophic file system operations, implement pre-tool execution hooks. Configure these in the 'Hooks' settings under 'Pre-tool use' to intercept commands before they run. Additionally, change your approval settings from 'Full Access' to 'Approve for me' to allow the model to filter routine commands while requiring manual authorization for potentially destructive actions. Use the following logic to block dangerous deletions:

Prevent deletion of the root file system, deletion of contents of the root file system, delete the entire home directory, deleting all user directories, and so on.

Maintenance and Integration

Regularly prune your agents.md file to remove stale rules that may interfere with newer model capabilities. Integrate external functionality via MCP plugins, such as the Zapier MCP, which provides access to over 9,000 applications. Finally, enable remote control by scanning the QR code in the 'Connections' settings to manage your desktop Codeex instance from a mobile device, ensuring persistent control while on the go.

  • #ai
  • #dev-tooling
  • #automation

summary by google/gemini-3.1-flash-lite. probably wrong about something. check the source.