Skip to main content
Troubleshooting

Performance, Context, and Long-Session Issues

Resolve performance issues such as high CPU/memory, lag, and context pressure

This page helps you resolve issues where Qoder CLI CN feels sluggish, uses too many resources, or is under context pressure.

Context pressure / frequent compaction

In long conversations, approaching the context window limit triggers automatic compaction, which can slow down responses:
  • Use /compact to proactively compress the context and free up space.
  • Use /context to view current context usage.
  • Split complex or long tasks into several shorter sessions; start a new session with /new.
  • Limit the number of turns a session retains via model.maxSessionTurns (-1 means unlimited).
  • For large tasks, make good use of subagent isolation to keep the main context from ballooning.

High memory usage

  • advanced.autoConfigureMemory (on by default) automatically configures the Node.js memory limit.
  • Use ui.showMemoryUsage to display memory usage in the interface for observation.
  • In very large repositories, memory discovery is bounded by context.discoveryMaxDirs (default 200); narrow the working directory scope if needed.

High CPU / rendering lag

Interface rendering tuning options (most are marked "restart required"):
  • ui.terminalBuffer, ui.renderProcess: terminal buffering and rendering-process architecture.
  • ui.useAlternateBuffer + ui.incrementalRendering: incremental rendering reduces flicker (supported only when the alternate buffer is enabled).
  • On low-performance terminals, turn off dynamic elements such as ui.showSpinner and ui.loadingPhrases.

Slow tool execution

  • Search: make sure tools.useRipgrep is enabled (on by default) for faster content search.
  • Shell timeout: tools.shell.inactivityTimeout (default 300 seconds) controls the no-output timeout; increase it for long commands.
  • MCP first-turn overhead: when connecting many MCP servers, enable lazy loading (mcp.lazyLoad or QODER_MCP_LAZY=1) to reduce first-turn token and loading overhead.

Slow startup

  • Trim unnecessary MCP servers and plugins, or use lazy loading.
  • Narrow the memory discovery scope; avoid starting in an oversized directory tree.

Next steps