Skip to content

docs: CLI CPU/memory usage audit — March 24-31, 2025#8027

Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
investigation/cli-cpu-memory-audit-march-2025
Open

docs: CLI CPU/memory usage audit — March 24-31, 2025#8027
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
investigation/cli-cpu-memory-audit-march-2025

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Mar 31, 2026

Summary

Investigation of changes merged to main in the last 7 days (March 24-31, 2025) that could increase CPU or memory usage in the Kilo CLI runtime.

Findings

HIGH severity

  • Ripgrep.tree() re-enabled in system prompt (03691ebe4, fix(cli): restore directory tree in system prompt #7949): Spawns rg --files on every agent loop step without caching. For a 50K-file project with 10 tool calls per turn, this is ~10 child process spawns doing full filesystem walks that produce identical results. Recommendation: cache per agent turn.

MEDIUM severity

LOW severity

Positive mitigations merged

  • Strip summary.diffs from TUI store (multi-MB savings)
  • Evict per-session data on navigation (prevents unbounded growth)
  • Scrub oversized diffs from stored session data

Not yet merged (future concern)

  • Codebase indexing (branch codebase-indexing): ~23K lines adding file watcher, vector store, tree-sitter parsing, background scanning. Will be the largest CPU/memory impact when merged.

See CPU_MEMORY_AUDIT_MARCH_2025.md for full details with commit references and code locations.

Investigate recent changes merged to main that could affect CLI runtime
performance. Identifies 5 findings (1 high, 1 medium, 3 low) and 3
positive mitigations.

Key finding: Ripgrep.tree() re-enabled in system prompt runs on every
agent loop step without caching, spawning a child process each time.

Also flags the unmerged codebase-indexing branch as a future concern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants