Skip to main content
Troubleshooting

Performance, Context, and Long Session Issues

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

This page helps troubleshoot issues such as Qoder CLI lagging, high resource usage, or high context pressure.

High Context Pressure / Frequent Compaction

When a conversation gets too long and the context approaches the context window limit, automatic compaction is triggered, which may slow down responses:
  • Use /compact to proactively compact the context and free up space.
  • Use /context to check the current context usage.
  • Break down complex or long tasks into multiple shorter sessions, and use /new to start a new session.
  • Use model.maxSessionTurns to limit the number of turns retained in a session (set -1 for unlimited).
  • Leverage subagents to isolate large tasks and prevent the main context from bloating.

High Memory Usage

  • advanced.autoConfigureMemory (enabled by default) automatically configures the Node.js memory limit.
  • Use ui.showMemoryUsage to display memory usage in the interface for monitoring.
  • In extremely large repositories, memory discovery is constrained by context.discoveryMaxDirs (default 200); narrow the working directory scope if necessary.

High CPU Usage / Rendering Lag

Tuning options related to interface rendering (most are marked as "requires restart"):
  • ui.terminalBuffer, ui.renderProcess: Terminal buffer and render process architecture.
  • ui.useAlternateBuffer + ui.incrementalRendering: Incremental rendering reduces flickering (only supported when the alternate buffer is enabled).
  • On low-performance terminals, you can disable dynamic elements such as ui.showSpinner and ui.loadingPhrases.

Slow Tool Execution

  • Search: Ensure tools.useRipgrep is enabled (default) for faster content search.
  • Shell Timeout: tools.shell.inactivityTimeout (default 300 seconds) controls the timeout for no output; increase it appropriately for long-running commands.
  • MCP First-Turn Overhead: When connecting to multiple MCP servers, enable Lazy Loading (mcp.lazyLoad or QODER_MCP_LAZY=1) to reduce first-turn token and loading overhead.

Slow Startup

  • Reduce unnecessary MCP servers and plugins, or use Lazy Loading.
  • Narrow the memory discovery scope to avoid starting in extremely large directory trees.

Next Steps