Skip to content

GLM5 vs Codex: Which AI Coding Assistant Actually Works for Real Projects?

The Problem with AI Coding Assistant Comparisons

Marketing benchmarks don’t match real-world performance. Every AI model claims to be the best at coding, but sustained work on complex projects reveals problems that don’t show up in synthetic tests.

I found this out the hard way while rewriting a mid-sized Clojure application. Both GLM5 and Codex (GPT-5.4-codex) completed the initial work fine. But when I needed adjustments during longer sessions, the differences became painfully obvious.

What I Discovered During a Real Project

I was working on a Clojure app rewrite—a functional programming language with a unique syntax that trips up many AI models. The project involved:

  • Multiple namespaces and modules
  • Data transformation pipelines
  • Integration with external APIs
  • Existing codebase that needed careful refactoring

Both models handled the initial code generation well. The output was clean, idiomatic Clojure, and they understood the functional programming patterns. That’s when I thought: maybe these tools are equally good?

Then I needed to iterate.

GLM5: Great Start, Messy Middle

GLM5 produced excellent initial code. Clean, focused, well-structured. For short, well-defined tasks, it felt like having a competent pair programmer.

user_processor.clj
(defn process-user-input
"Validates and transforms user input data"
[input]
(-> input
(validate-schema)
(transform-to-internal-format)
(add-timestamp)))

This is exactly what I wanted—simple, clear, functional. No over-engineering, no unnecessary abstractions.

But problems emerged during extended sessions. As I asked for adjustments—adding features, fixing edge cases, refactoring sections—GLM5 started losing coherence. After 30-40 minutes of back-and-forth:

  • It began repeating previous suggestions
  • Context from earlier in the conversation got mixed up
  • Solutions became increasingly convoluted
  • Eventually it produced nonsensical code that contradicted earlier decisions

I call this “context drift.” GLM5 works great in focused bursts but struggles to maintain coherent understanding across long, iterative sessions.

Codex: Stable but Over-Eager

Codex handled longer sessions better. The context remained coherent even after multiple iterations. But it had a different problem: it couldn’t stop “improving” things.

When I asked Codex to add error handling to a function, it gave me this:

user_processor_codex.clj
(defn process-user-input
"Validates and transforms user input data with comprehensive error handling"
[input]
(let [error-accumulator (atom [])]
(try
(let [validated (validate-schema input)
transformed (transform-to-internal-format validated)
timestamped (add-timestamp transformed)]
(if (empty? @error-accumulator)
{:success true :data timestamped}
{:success false :errors @error-accumulator}))
(catch Exception e
(log/error "Processing failed" {:input input :error e})
{:success false :errors [(str "Unexpected error: " (.getMessage e))]}))))

Notice what happened:

  • Added an error accumulator I never requested
  • Wrapped everything in try-catch without asking
  • Added logging infrastructure
  • Changed the return type from data to a result map
  • Added a documentation string update

This pattern repeated throughout the project. Codex would:

  • Add “flexibility” layers I didn’t need
  • Create configuration abstractions “for future use”
  • Implement multiple dispatch mechanisms
  • Add logging and monitoring hooks

None of these were wrong or bad code. But they weren’t what I asked for. Each request expanded in scope without my instruction.

The Long Context Trap

Both models advertise long context windows as a feature. My experience suggests this isn’t always desirable.

When I let GLM5 run with full context through a long session, the output quality degraded. More context didn’t help—it produced worse, harder-to-review code. The model got confused by its own earlier decisions.

Session quality over time (my observation):
- Minutes 0-15: Excellent, focused output
- Minutes 15-30: Good, but minor inconsistencies appear
- Minutes 30-45: Quality drops, context confusion visible
- Minutes 45+: Significant degradation, time to reset

Codex maintained coherence longer but drifted toward over-engineering. The long context meant it could reference earlier decisions correctly, but it also accumulated “improvement ideas” that weren’t improvements.

What Actually Works

After this experience, I changed my approach. Here’s what I found effective:

For GLM5 - Short, Focused Sessions:

workflow_glm5.sh
# After each major feature completion:
# 1. Save current state
git add . && git commit -m "feature complete"
# 2. Start fresh conversation with current codebase snapshot
# New session, clean context
# 3. Reference previous decisions in new context
# "Continuing from [feature], now working on [next feature]"

Reset context between major features. GLM5 excels at well-defined, bounded tasks. Don’t stretch sessions beyond 30 minutes without a context reset.

For Codex - Explicit Boundaries:

prompt_template.txt
Task: Add error handling to process-user-input
Constraints:
- Do NOT add logging
- Do NOT change the return type
- Do NOT add configuration options
- Only add try-catch for the specific cases I list below
Specific errors to handle:
- Invalid schema: return nil
- Transformation failure: throw ExceptionInfo

Be painfully explicit about what NOT to do. Codex assumes you want the “best” solution, which often means more complexity than you need.

For Both - Chunk Your Work:

Instead of relying on long context, I now review output in smaller segments:

  1. Generate a piece of functionality
  2. Review and test immediately
  3. Commit or request changes
  4. Move to next piece in a fresh or smaller context

This produces better results than letting either model run with full context through a multi-hour session.

Service Quality Considerations

During my testing, z.ai (where I accessed GLM5) experienced service degradation. Response times increased, and output quality dropped. This pushed me toward Codex for a portion of the project.

This isn’t a criticism of GLM5’s capabilities—the model itself performed well. But it’s a reminder that model quality isn’t the only factor. Service reliability matters for real work.

If you’re considering GLM5:

  • Test the platform stability during your evaluation period
  • Have a backup plan if service degrades
  • Monitor output quality over time

When to Choose Each Model

Based on my experience:

Choose GLM5 when:

  • You have well-defined, bounded tasks
  • You can work in short sessions with context resets
  • You prefer clean, minimal code without extra abstractions
  • You’ll provide explicit requirements and let the model execute

Choose Codex when:

  • You need extended iterative sessions
  • Your requirements evolve during development
  • You can tolerate (and filter) over-engineering
  • You’ll set explicit boundaries to prevent scope expansion

Avoid both when:

  • You expect the model to “just work” without workflow adjustments
  • You rely on long context to carry understanding through complex sessions
  • You want one tool to handle every scenario

The Real Cost of Wrong Choice

The wrong AI assistant costs more than just subscription fees.

GLM5’s tendency to lose coherence mid-session means you’ll spend time getting it back on track. You might think a fresh context helps—and it does—but constantly re-establishing context adds friction.

Codex’s over-engineering means you’ll spend time reining it in. Every code review becomes a negotiation: “Yes, this is technically better, but I didn’t ask for it, and now I need to maintain it.”

Neither failure mode shows up in benchmarks. They only emerge during real project work where requirements change and sessions extend beyond 30 minutes.

Summary

In this post, I compared GLM5 and Codex based on real experience with a mid-sized Clojure project. Neither model is universally better—GLM5 excels at focused tasks but loses coherence in long sessions, while Codex maintains context but over-engineers beyond your instructions.

The key insight is that long context isn’t a magic solution. Breaking work into smaller segments with fresh contexts produces better results than relying on either model to maintain coherent understanding through extended sessions. Choose GLM5 for short, well-defined work. Choose Codex for longer iterative sessions, but set explicit boundaries. And always review output in chunks rather than trusting long-context capabilities.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments