Przeglądaj źródła

Merge branch 'main' into eshurakov/bump-packages

Kevin van Dijk 4 dni temu
rodzic
commit
3df57c8d3a
100 zmienionych plików z 3815 dodań i 1315 usunięć
  1. 5 0
      .changeset/add-slovak-translation.md
  2. 5 0
      .changeset/remove-dup-title.md
  3. 4 0
      .gitignore
  4. 1 1
      .kilocode/skills/translation/SKILL.md
  5. 1 1
      .kilocode/workflows/add-missing-translations.md
  6. 81 0
      CHANGELOG.md
  7. 135 11
      CONTRIBUTING.md
  8. 22 6
      README.md
  9. 10 0
      apps/kilocode-docs/AGENTS.md
  10. 16 0
      apps/kilocode-docs/README.md
  11. 61 0
      apps/kilocode-docs/components/CodeBlock.tsx
  12. 14 3
      apps/kilocode-docs/components/Image.tsx
  13. 66 0
      apps/kilocode-docs/components/TopNav.tsx
  14. 16 15
      apps/kilocode-docs/lib/nav/automate.ts
  15. 24 18
      apps/kilocode-docs/lib/nav/code-with-ai.ts
  16. 19 18
      apps/kilocode-docs/lib/nav/collaborate.ts
  17. 46 25
      apps/kilocode-docs/lib/nav/contributing.ts
  18. 4 1
      apps/kilocode-docs/lib/nav/customize.ts
  19. 18 1
      apps/kilocode-docs/lib/nav/getting-started.ts
  20. 11 12
      apps/kilocode-docs/mappingplan.md
  21. 6 1
      apps/kilocode-docs/pages/_app.tsx
  22. 12 1
      apps/kilocode-docs/pages/automate/code-reviews.md
  23. 3 3
      apps/kilocode-docs/pages/automate/how-tools-work.md
  24. 4 0
      apps/kilocode-docs/pages/automate/mcp/using-in-kilo-code.md
  25. 100 0
      apps/kilocode-docs/pages/code-with-ai/agents/auto-model.md
  26. 50 11
      apps/kilocode-docs/pages/code-with-ai/agents/chat-interface.md
  27. 11 5
      apps/kilocode-docs/pages/code-with-ai/agents/free-and-budget-models.md
  28. 8 2
      apps/kilocode-docs/pages/code-with-ai/agents/model-selection.md
  29. 4 0
      apps/kilocode-docs/pages/code-with-ai/agents/using-modes.md
  30. 12 0
      apps/kilocode-docs/pages/code-with-ai/features/autocomplete/index.md
  31. 5 12
      apps/kilocode-docs/pages/code-with-ai/features/browser-use.md
  32. 2 1
      apps/kilocode-docs/pages/code-with-ai/features/checkpoints.md
  33. 25 3
      apps/kilocode-docs/pages/code-with-ai/features/task-todo-list.md
  34. 289 475
      apps/kilocode-docs/pages/code-with-ai/platforms/cli.md
  35. 149 0
      apps/kilocode-docs/pages/contributing/architecture/agent-observability.md
  36. 42 0
      apps/kilocode-docs/pages/contributing/architecture/feature-template.md
  37. 23 0
      apps/kilocode-docs/pages/contributing/architecture/features.md
  38. 1 16
      apps/kilocode-docs/pages/contributing/architecture/index.md
  39. 575 0
      apps/kilocode-docs/pages/contributing/architecture/mcp-oauth-authorization.md
  40. 4 0
      apps/kilocode-docs/pages/contributing/index.md
  41. 11 0
      apps/kilocode-docs/pages/customize/agents-md.md
  42. 14 8
      apps/kilocode-docs/pages/customize/context/codebase-indexing.md
  43. 74 0
      apps/kilocode-docs/pages/customize/context/kilocodeignore.md
  44. 0 322
      apps/kilocode-docs/pages/customize/context/memory-bank.md
  45. 8 0
      apps/kilocode-docs/pages/customize/custom-modes.md
  46. 1 3
      apps/kilocode-docs/pages/customize/index.md
  47. 50 0
      apps/kilocode-docs/pages/getting-started/byok.md
  48. 4 0
      apps/kilocode-docs/pages/getting-started/quickstart.md
  49. 51 0
      apps/kilocode-docs/pages/getting-started/rate-limits-and-costs.md
  50. 345 0
      apps/kilocode-docs/pages/getting-started/settings/auto-approving-actions.md
  51. 275 0
      apps/kilocode-docs/pages/getting-started/settings/auto-cleanup.md
  52. 18 3
      apps/kilocode-docs/pages/getting-started/settings/index.md
  53. 253 0
      apps/kilocode-docs/pages/getting-started/settings/system-notifications.md
  54. 104 0
      apps/kilocode-docs/pages/getting-started/using-kilo-for-free.md
  55. 1 1
      apps/kilocode-docs/pages/index.tsx
  56. 41 10
      apps/kilocode-docs/previous-docs-redirects.js
  57. BIN
      apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-1.png
  58. BIN
      apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-13.png
  59. BIN
      apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-14.png
  60. BIN
      apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-4.png
  61. BIN
      apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-9.png
  62. BIN
      apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions.png
  63. BIN
      apps/kilocode-docs/public/img/auto-cleanup/settings.png
  64. BIN
      apps/kilocode-docs/public/img/browser-use/browser-use.png
  65. BIN
      apps/kilocode-docs/public/img/checkpoints/checkpoints.png
  66. BIN
      apps/kilocode-docs/public/img/context-mentions/context-mentions-6.png
  67. BIN
      apps/kilocode-docs/public/img/custom-instructions/custom-instructions.png
  68. BIN
      apps/kilocode-docs/public/img/fast-edits/fast-edits-5.png
  69. BIN
      apps/kilocode-docs/public/img/git-commit-generation/git-commit-1.png
  70. BIN
      apps/kilocode-docs/public/img/git-commit-generation/git-commit-2.png
  71. BIN
      apps/kilocode-docs/public/img/memory-bank/at-work.png
  72. BIN
      apps/kilocode-docs/public/img/move-to-secondary.png
  73. BIN
      apps/kilocode-docs/public/img/suggested-responses/suggested-responses-1.png
  74. BIN
      apps/kilocode-docs/public/img/suggested-responses/suggested-responses.png
  75. BIN
      apps/kilocode-docs/public/img/the-chat-interface/the-chat-interface-1.png
  76. 2 2
      apps/web-roo-code/src/app/pricing/page.tsx
  77. 2 2
      cli/src/commands/checkpoint.ts
  78. 1 1
      cli/src/constants/providers/models.ts
  79. 24 4
      cli/src/services/__tests__/autocomplete.detectInputState.test.ts
  80. 0 1
      cli/src/state/hooks/__tests__/useSessionCost.test.ts
  81. 3 1
      package.json
  82. 3 0
      packages/core-schemas/src/agent-manager/types.ts
  83. 1 1
      packages/types/package.json
  84. 1 0
      packages/types/src/global-settings.ts
  85. 1 1
      packages/types/src/kilocode/kiloLanguages.ts
  86. 3 2
      packages/types/src/model.ts
  87. 16 0
      packages/types/src/providers/anthropic.ts
  88. 10 0
      packages/types/src/providers/mistral.ts
  89. 13 20
      packages/types/src/providers/moonshot.ts
  90. 17 1
      packages/types/src/providers/openai-codex.ts
  91. 16 0
      packages/types/src/providers/vertex.ts
  92. 36 0
      packages/types/src/providers/zai.ts
  93. 5 0
      packages/types/src/vscode-extension-host.ts
  94. 1 0
      packages/types/src/vscode.ts
  95. 249 156
      pnpm-lock.yaml
  96. 8 0
      src/api/providers/__tests__/kilocode-openrouter.spec.ts
  97. 244 129
      src/api/providers/__tests__/moonshot.spec.ts
  98. 1 1
      src/api/providers/__tests__/openai-codex.spec.ts
  99. 13 2
      src/api/providers/anthropic-vertex.ts
  100. 11 2
      src/api/providers/anthropic.ts

+ 5 - 0
.changeset/add-slovak-translation.md

@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Add Slovak (sk) language translation for Kilo Code extension and UI

+ 5 - 0
.changeset/remove-dup-title.md

@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Remove duplicate "Kilo Code Marketplace" title in toolbar (thanks @bernaferrari!)

+ 4 - 0
.gitignore

@@ -53,6 +53,10 @@ logs
 # Nix / Direnv
 .direnv
 
+# Mise
+mise.toml
+mise.local.toml
+
 # Exclude Conport Directory (MCP server)
 context_portal/
 

+ 1 - 1
.kilocode/skills/translation/SKILL.md

@@ -13,7 +13,7 @@ For the translation workflow, use the `/add-missing-translations` command or see
 
 # 1. SUPPORTED LANGUAGES AND LOCATION
 
-- Localize all strings into the following locale files: ar, ca, cs, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, th, tr, uk, vi, zh-CN, zh-TW
+- Localize all strings into the following locale files: ar, ca, cs, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, sk, th, tr, uk, vi, zh-CN, zh-TW
 - The VSCode extension has two main areas that require localization:
     - Core Extension: src/i18n/locales/, src/package.nls.json, src/package.nls.<locale>.json (extension backend)
     - WebView UI: webview-ui/src/i18n/locales/ (user interface)

+ 1 - 1
.kilocode/workflows/add-missing-translations.md

@@ -13,7 +13,7 @@ For each language that is missing translations:
 
 When translating, follow these key rules:
 
-1. **Supported Languages**: ar, ca, cs, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, th, tr, uk, vi, zh-CN, zh-TW
+1. **Supported Languages**: ar, ca, cs, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, sk, th, tr, uk, vi, zh-CN, zh-TW
 2. **Voice**: Always use informal speech (e.g., "du" not "Sie" in German)
 3. **Technical Terms**: Don't translate "token", "API", "prompt" and domain-specific technical terms
 4. **Placeholders**: Keep `{{variable}}` placeholders exactly as in the English source

+ 81 - 0
CHANGELOG.md

@@ -1,5 +1,86 @@
 # kilo-code
 
+## 5.5.0
+
+### Minor Changes
+
+- [#4890](https://github.com/Kilo-Org/kilocode/pull/4890) [`535e3d1`](https://github.com/Kilo-Org/kilocode/commit/535e3d1751255487b4a0217fbae6e7b357b85a56) Thanks [@Drilmo](https://github.com/Drilmo)! - feat(agent-manager): add YOLO mode toggle and session rename
+
+    **New Features:**
+
+    - Add YOLO mode toggle button in new agent form to enable/disable auto-approval of tools
+    - Add YOLO mode indicator (⚡) in session header and sidebar for sessions running in YOLO mode
+    - Add inline session rename - click on session title to edit
+
+    **Technical Details:**
+
+    - `yoloMode` maps to `autoApprove` config in agent-runtime
+    - Added translations for all 22 supported locales
+
+### Patch Changes
+
+- [#5744](https://github.com/Kilo-Org/kilocode/pull/5744) [`870cdd5`](https://github.com/Kilo-Org/kilocode/commit/870cdd57e7b096caca536ca0aa0da393a68eb730) Thanks [@fstanis](https://github.com/fstanis)! - Fix Opus 4.6 model name
+
+- [#5767](https://github.com/Kilo-Org/kilocode/pull/5767) [`57daae1`](https://github.com/Kilo-Org/kilocode/commit/57daae1c3765bd1c37ee5791cb465edc7bd9a861) Thanks [@kiloconnect](https://github.com/apps/kiloconnect)! - Update Discord link in docs footer to use kilo.ai/discord
+
+- [#5758](https://github.com/Kilo-Org/kilocode/pull/5758) [`25f0043`](https://github.com/Kilo-Org/kilocode/commit/25f0043f66248cb12c1c353c9cd9935a0d2d9d60) Thanks [@markijbema](https://github.com/markijbema)! - Minor improvement of auto-execute commands with input redirection
+
+## 5.4.1
+
+### Patch Changes
+
+- [#5695](https://github.com/Kilo-Org/kilocode/pull/5695) [`8097ad6`](https://github.com/Kilo-Org/kilocode/commit/8097ad63b455dca2224f2811af69a0333a43fd79) Thanks [@kevinvandijk](https://github.com/kevinvandijk)! - Add support for GPT 5.3 codex in OpenAI Codex provider
+
+- [#5584](https://github.com/Kilo-Org/kilocode/pull/5584) [`bd34af4`](https://github.com/Kilo-Org/kilocode/commit/bd34af4170ec3146f1c9c8ca8d8df28502b4b1fa) Thanks [@Neonsy](https://github.com/Neonsy)! - Add a favorited-task checkbox to batch delete in task history.
+
+- [#4770](https://github.com/Kilo-Org/kilocode/pull/4770) [`abaf633`](https://github.com/Kilo-Org/kilocode/commit/abaf6334f22d14496e38151c329887346525f090) Thanks [@JustinReyes28](https://github.com/JustinReyes28)! - feat: Add new "devstral-2512" Mistral model configuration
+
+## 5.4.0
+
+### Minor Changes
+
+- [#4096](https://github.com/Kilo-Org/kilocode/pull/4096) [`4eb0646`](https://github.com/Kilo-Org/kilocode/commit/4eb06462f78ab7446b319e1736fa837e86e3f1df) Thanks [@OlivierBarbier](https://github.com/OlivierBarbier)! - Fix: Importing a configuration file blocks the configuration of provider parameters #2349
+
+### Patch Changes
+
+- [#5686](https://github.com/Kilo-Org/kilocode/pull/5686) [`e6c26b7`](https://github.com/Kilo-Org/kilocode/commit/e6c26b7e8e468a565017fb05958cd4814d69daa1) Thanks [@marius-kilocode](https://github.com/marius-kilocode)! - Add Claude Opus 4.6 model with adaptive thinking support
+
+- [#4021](https://github.com/Kilo-Org/kilocode/pull/4021) [`b8a6c4e`](https://github.com/Kilo-Org/kilocode/commit/b8a6c4e6b4eab9397efbbaa04202f92816e5afd4) Thanks [@In-line](https://github.com/In-line)! - Add React Compiler integration to improve UI responsiveness
+
+## 5.3.0
+
+### Minor Changes
+
+- [#5649](https://github.com/Kilo-Org/kilocode/pull/5649) [`6fbb740`](https://github.com/Kilo-Org/kilocode/commit/6fbb74084f4090d42ad583dd6ce62c2d3f7826f2) Thanks [@iscekic](https://github.com/iscekic)! - send x-kilocode-mode header
+
+- [#5531](https://github.com/Kilo-Org/kilocode/pull/5531) [`66dbaf2`](https://github.com/Kilo-Org/kilocode/commit/66dbaf2dac3f0d1163b7a9409805d32a9a80af1c) Thanks [@lambertjosh](https://github.com/lambertjosh)! - Add new welcome screen for improved onboarding
+
+### Patch Changes
+
+- [#5582](https://github.com/Kilo-Org/kilocode/pull/5582) [`dc669ab`](https://github.com/Kilo-Org/kilocode/commit/dc669ab484a3d015cea1cadb57271b58a23ef796) Thanks [@lambertjosh](https://github.com/lambertjosh)! - Use brand-colored Kilo Code icons throughout the extension for better visibility
+
+- [#5616](https://github.com/Kilo-Org/kilocode/pull/5616) [`9e139f5`](https://github.com/Kilo-Org/kilocode/commit/9e139f50bc52913fa7e42d3ba4c9090263a14f0b) Thanks [@EloiRamos](https://github.com/EloiRamos)! - fix(ui): prevent TypeError when trimming input during model switching
+
+- [#2792](https://github.com/Kilo-Org/kilocode/pull/2792) [`907fb53`](https://github.com/Kilo-Org/kilocode/commit/907fb53aca1f70b1e3e2f91fbb3bcbdc6b514a48) Thanks [@Honyii](https://github.com/Honyii)! - Added CONTRIBUTING.md file for onboarding new contributors
+
+- [#5638](https://github.com/Kilo-Org/kilocode/pull/5638) [`a5b9106`](https://github.com/Kilo-Org/kilocode/commit/a5b9106e6cebc1a63c1ef5fa507cfaab65aa8ebc) Thanks [@Drilmo](https://github.com/Drilmo)! - fix(agent-manager): sync messages when panel is reopened
+
+    Fixed a bug where closing and reopening the Agent Manager panel would show "Waiting for agent response..." instead of the conversation messages.
+
+- [#5644](https://github.com/Kilo-Org/kilocode/pull/5644) [`e3f353f`](https://github.com/Kilo-Org/kilocode/commit/e3f353f596288b9b8e60b00fa88e60f179160c9a) Thanks [@bernaferrari](https://github.com/bernaferrari)! - Fix contrast on "ideas" intro screen
+
+- [#5583](https://github.com/Kilo-Org/kilocode/pull/5583) [`a23c936`](https://github.com/Kilo-Org/kilocode/commit/a23c9361a5a15cf7bd59efd9c8ea9987e2ec82cc) Thanks [@crazyrabbit0](https://github.com/crazyrabbit0)! - Fix double scroll bar in ModelSelector and KiloProfileSelector by increasing max-height.
+
+- [#5567](https://github.com/Kilo-Org/kilocode/pull/5567) [`9729ab2`](https://github.com/Kilo-Org/kilocode/commit/9729ab2c808a69fadbb8c095e5a626fa75e42859) Thanks [@lambertjosh](https://github.com/lambertjosh)! - Updated chat UI theme to use muted, theme-aware colors for Checkpoint, Thinking, and user message styling
+
+- [#5577](https://github.com/Kilo-Org/kilocode/pull/5577) [`a57f9ac`](https://github.com/Kilo-Org/kilocode/commit/a57f9acb2c07b0888fcfa566c2d345879f890941) Thanks [@Patel230](https://github.com/Patel230)! - fix: allow Ollama models without tool support for autocomplete
+
+- [#5628](https://github.com/Kilo-Org/kilocode/pull/5628) [`84c6db2`](https://github.com/Kilo-Org/kilocode/commit/84c6db2ff906b6d18625dc0de21a77a0e573f4ac) Thanks [@Githubguy132010](https://github.com/Githubguy132010)! - Prevent chat auto-scroll from jumping while you read older messages.
+
+- [#5214](https://github.com/Kilo-Org/kilocode/pull/5214) [`28a46d1`](https://github.com/Kilo-Org/kilocode/commit/28a46d17fe91f13ec0687bb6834b31e2ec454687) Thanks [@kiloconnect](https://github.com/apps/kiloconnect)! - Add GLM-4.7 Flash model to recommended models list for Z.ai provider
+
+- [#5662](https://github.com/Kilo-Org/kilocode/pull/5662) [`228745b`](https://github.com/Kilo-Org/kilocode/commit/228745b4159cd28b7a8fb8d1db1b89e9beb49539) Thanks [@kevinvandijk](https://github.com/kevinvandijk)! - Add improved support for Kimi 2.5 reasoning through AI SDK
+
 ## 5.2.2
 
 ### Patch Changes

+ 135 - 11
CONTRIBUTING.md

@@ -1,16 +1,140 @@
-# Welcome to the Kilocode Project
+# Contributing to Kilo Code
 
-See [the Documentation for details on contributing](https://kilo.ai/docs/contributing)
+First off, thanks for taking the time to contribute! ❤️
 
-## TL;DR
+All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for the team and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
 
-There are lots of ways to contribute to the project
+If you don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
 
-- **Code Contributions** Implement new features or fix bugs
-- **Documentation:** Improve existing docs or create new guides
-- **Custom Modes:** Create and share specialized modes
-- **Bug Reports:** Report issues you encounter
-- **Feature Requests:** Suggest new features or improvements
-- **Community Support:** Help other users in the community
+- Star the project
+- Post on X or Linkedin about Kilo Code `#kilocode
+- Mention the project at local meetups and tell your friends/colleagues
 
-The Kilocode Community is [on Discord](https://kilo.ai/discord)
+## Table of Contents
+
+- [Code of Conduct](#code-of-conduct)
+- [I Have a Question](#i-have-a-question)
+- [I Want To Contribute](#i-want-to-contribute)
+    - [Code Contributors](#code-contributors)
+    - [Reporting Bugs](#reporting-bugs)
+    - [Custom Modes](#custom-modes)
+    - [Feature Requests](#feature-requests)
+    - [Improving The Documentation](#improving-the-documentation)
+    - [Improving The Design](#improving-the-design)
+    - [Publish a Blog Post or Case Study](#publish-a-blog-post-or-case-study)
+    - [Commit Messages](#commit-messages)
+- [Pull requests](#pull-requests)
+
+## Code of Conduct
+
+This project and everyone participating in it is governed by the [Code of Conduct](https://github.com/Kilo-Org/kilocode/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior
+to [[email protected]](mailto:[email protected]).
+
+## I Have a Question
+
+If you need clarification after reading this document, we encourage you to join our [discord](https://kilocode.ai/discord) workspace and join channels [kilo-dev-contributors](https://discord.com/channels/1349288496988160052/1391109167275577464) and [extensions-support channel](https://discord.com/channels/1349288496988160052/1349358641295265864).
+
+## I Want To Contribute
+
+### Code Contributors
+
+We’re excited that you’re interested in contributing code to Kilo Code! Before you start, please take a look at our [Development Guide](https://github.com/Kilo-Org/kilocode/blob/main/DEVELOPMENT.md), it includes setup instructions, build steps, and details on running tests locally.
+
+#### What to Expect
+
+- A GUI-based change with settings may involve 12–13 files, plus about 18 more for internationalization (i18n).
+
+- A new feature or major update might also require corresponding tests, translations, and settings configuration updates.
+
+Don’t let that scare you off, we just want you to have a realistic idea of what’s involved before diving in. You’ll learn a lot, and we’re here to help if you get stuck.
+
+#### Tips Before You Start
+
+- If your change affects any UI elements or Settings, expect it to touch multiple files and translations.
+
+- You can use our translation workflow to automate adding i18n strings instead of editing each language manually.
+
+Unsure if your contribution is “small” or “large”? Start a quick discussion in [kilo-dev-contributors](https://discord.com/channels/1349288496988160052/1391109167275577464) channel on discord or open an issue with good context, follow the commit and pull request guidelines below once you’re ready to open a PR.
+
+### Reporting Bugs
+
+Please use our issues templates that provide hints on what information we need to help you.
+
+> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to [[email protected]](mailto:[email protected]).
+
+### Custom Modes
+
+Custom modes are a powerful way to extend Kilo Code's capabilities. To create and share a custom mode:
+
+- Follow the [Custom Modes documentation](https://kilo.ai/docs/customize/custom-modes) to create your mode.
+
+- Test your mode thoroughly
+
+- Share your mode with the community on [Reddit](https://www.reddit.com/r/kilocode/) or you can show off / start a discussion on [show-off-your-builds](https://discord.com/channels/1349288496988160052/1375399779760214037) or [workflows-and-integration](https://discord.com/channels/1349288496988160052/1420236932780130418) on discord.
+
+### Feature Requests
+
+Suggest feature requests in [Discussion](https://github.com/Kilo-Org/kilocode/discussions), only open an [Issue](https://github.com/Kilo-Org/kilocode/issues/new/choose) for reporting a bug or actual contributions. Don't open issues for questions or support, instead join our [Discord workspace](https://kilocode.ai/discord) and ask there.
+
+- Provide as much context as you can about what you're running into.
+
+### Improving The Documentation
+
+If you notice outdated information or areas that could be clarified, kindly start a discussion in the [general](https://discord.com/channels/1349288496988160052/1349288496988160055) channel on discord.
+Please note that the main [documentation](https://github.com/Kilo-Org/docs) repository has been archived, you can still view it for reference.
+
+### Improving The Design
+
+Design contributions are welcome! To ensure smooth collaboration, please use the Design Improvement Template when opening a design-related issue.
+This helps us gather the right context (such as wireframes, mockups, or visual references) and maintain a consistent design language across the project. Feedback and iterations are highly encouraged, design is always a shared process.
+
+### Publish a Blog Post or Case Study
+
+We love hearing how people use or extend Kilo Code in their own projects. If you’ve written about your experience, we’re happy to review it!
+Our blog and case study repository has been archived, you can still access it [here](https://github.com/Kilo-Org/docs/tree/main/blog-posts) for reference. To share your work, please start a discussion in the [general](https://discord.com/channels/1349288496988160052/1349288496988160055) channel on discord, summarizing your post or case study, with a link to the full content.
+
+### Commit Messages
+
+Writing clear and consistent commit messages helps maintainers understand the purpose of your changes. A good commit message should:
+
+- Be written in the present tense (e.g., Add new feature, not Added new feature)
+
+- Be short (50 characters or less for the summary line)
+
+- Include additional context in the body if needed
+
+- Reference related issue numbers (e.g., Fixes `#123)
+
+- Keep each commit focused on one logical change
+
+## Pull Requests
+
+When you’re ready to contribute your changes, follow these steps to create a clear and reviewable pull request:
+
+- Push your changes to your fork:
+
+    ```bash
+    git push origin your-branch-name
+    ```
+
+- Open a Pull Request against the main Kilo Code repository.
+
+- Select "Compare across forks" and choose your fork and branch.
+
+- Fill out the PR template with:
+
+- A clear description of your changes
+
+    - Any related issues (e.g., “Fixes `#123”)
+
+    - Testing steps or screenshots (if applicable)
+
+    - Notes for reviewers, if special attention is needed
+
+For more context, kindly read the official [contributing docs](https://kilo.ai/docs/contributing).
+
+Your contributions, big or small help make Kilo Code better for everyone!🫶
+
+## References
+
+This document was adapted from [https://contributing.md](https://contributing.md/)!

+ 22 - 6
README.md

@@ -9,7 +9,7 @@
 # 🚀 Kilo
 
 > Kilo is the all-in-one agentic engineering platform. Build, ship, and iterate faster with the most popular open source coding agent.
-> #1 on OpenRouter. 1M+ Kilo Coders. 20T+ tokens processed
+> #1 on OpenRouter. 1.5M+ Kilo Coders. 25T+ tokens processed
 
 - ✨ Generate code from natural language
 - ✅ Checks its own work
@@ -24,6 +24,8 @@
   <img src="https://media.githubusercontent.com/media/Kilo-Org/kilocode/main/kilo.gif" width="100%" />
 </p>
 
+## Quick Links
+
 - [VS Code Marketplace](https://kilo.ai/vscode-marketplace?utm_source=Readme) (download)
 - [Official Kilo.ai Home page](https://kilo.ai) (learn more)
 
@@ -31,12 +33,12 @@
 
 - **Code Generation:** Kilo can generate code using natural language.
 - **Inline Autocomplete:** Get intelligent code completions as you type, powered by AI.
-- **Task Automation:** Kilo can automate repetitive coding tasks.
-- **Automated Refactoring:** Kilo can refactor and improve existing code.
+- **Task Automation:** Kilo can automate repetitive coding tasks to save time..
+- **Automated Refactoring:** Kilo can refactor and improve existing code efficiently.
 - **MCP Server Marketplace**: Kilo can easily find, and use MCP servers to extend the agent capabilities.
 - **Multi Mode**: Plan with Architect, Code with Coder, and Debug with Debugger, and make your own custom modes.
 
-## How to get started with Kilo
+## Get Started
 
 1. Install the Kilo Code extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=kilocode.Kilo-Code).
 2. Create your account to access 500+ cutting-edge AI models including Gemini 3 Pro, Claude 4.5 Sonnet & Opus, and GPT-5 – with transparent pricing that matches provider rates exactly.
@@ -44,9 +46,23 @@
 
 [![Watch the video](https://img.youtube.com/vi/pqGfYXgrhig/maxresdefault.jpg)](https://youtu.be/pqGfYXgrhig)
 
-## Extension Development
+## Developer Setup
+
+If you want to contribute or modify the extension locally, see the [DEVELOPMENT.md](/DEVELOPMENT.md) file for build and setup instructions.
+
+## Contributing
+
+We welcome contributions from developers, writers, and enthusiasts!
+To get started, please read our [Contributing Guide](/CONTRIBUTING.md). It includes details on setting up your environment, coding standards, types of contribution and how to submit pull requests.
+
+## Code of Conduct
+
+Our community is built on respect, inclusivity, and collaboration. Please review our [Code of Conduct](/CODE_OF_CONDUCT.md) to understand the expectations for all contributors and community members.
+
+## License
 
-For details on building and developing the extension, see [DEVELOPMENT.md](/DEVELOPMENT.md)
+This project is licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
+You’re free to use, modify, and distribute this code, including for commercial purposes as long as you include proper attribution and license notices. See [License](/LICENSE).
 
 ## Contributing
 

+ 10 - 0
apps/kilocode-docs/AGENTS.md

@@ -6,6 +6,16 @@ This is the Kilo Code documentation site. Kilo Code is the leading open source a
 
 The dev server is run with `bun dev` and runs on `http://localhost:3002`. Typically the user will be running it themselves, so always check if it is running FIRST before deciding to run it yourself to test something.
 
+## Branch Naming Convention
+
+When making changes _only_ to the documentation, create branches with the `docs/` prefix:
+
+```bash
+git checkout -b docs/description-of-change
+```
+
+This convention helps identify documentation-only PRs and keeps them organized.
+
 ## Markdoc Custom Tags
 
 This project uses [Markdoc](https://markdoc.dev/) for rendering markdown with custom components. Custom tags allow you to embed React components directly in markdown files.

+ 16 - 0
apps/kilocode-docs/README.md

@@ -37,3 +37,19 @@ The quickest way to deploy your own version of this boilerplate is by deploying
 ### Deploy to Netlify
 
 [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/markdoc/next.js-starter)
+
+## Contributing
+
+When making documentation _only_ changes, use branch names prefixed with `docs/`:
+
+```bash
+git checkout -b docs/your-change-description
+```
+
+Examples:
+
+- `docs/add-mcp-tutorial`
+- `docs/fix-installation-steps`
+- `docs/update-api-reference`
+
+For full contribution guidelines, see the [Contributing Guide](https://kilo.ai/docs/contributing).

+ 61 - 0
apps/kilocode-docs/components/CodeBlock.tsx

@@ -1,16 +1,49 @@
 import Prism from "prismjs"
 
 import * as React from "react"
+import { Codicon } from "./Codicon"
 
 export function CodeBlock({ children, "data-language": language }) {
 	const ref = React.useRef(null)
+	const timeoutRef = React.useRef(null)
+	const [copied, setCopied] = React.useState(false)
 
 	React.useEffect(() => {
 		if (ref.current) Prism.highlightElement(ref.current, false)
 	}, [children])
 
+	React.useEffect(() => {
+		return () => {
+			if (timeoutRef.current) {
+				clearTimeout(timeoutRef.current)
+			}
+		}
+	}, [])
+
+	const handleCopy = async () => {
+		const code = ref.current?.textContent || ""
+		try {
+			await navigator.clipboard.writeText(code)
+			setCopied(true)
+			if (timeoutRef.current) {
+				clearTimeout(timeoutRef.current)
+			}
+			timeoutRef.current = setTimeout(() => setCopied(false), 2000)
+		} catch (err) {
+			console.error("Failed to copy code:", err)
+		}
+	}
+
 	return (
 		<div className="code" aria-live="polite">
+			<button
+				type="button"
+				className="copy-button"
+				onClick={handleCopy}
+				aria-label="Copy code to clipboard"
+				title={copied ? "Copied!" : "Copy code"}>
+				{copied ? <Codicon name="check" /> : <Codicon name="copy" />}
+			</button>
 			<pre ref={ref} className={`language-${language}`}>
 				{children}
 			</pre>
@@ -20,10 +53,38 @@ export function CodeBlock({ children, "data-language": language }) {
 						position: relative;
 					}
 
+					.copy-button {
+						position: absolute;
+						top: 8px;
+						right: 8px;
+						padding: 6px 8px;
+						background: #1e1e1e;
+						border: 1px solid rgba(255, 255, 255, 0.2);
+						border-radius: 4px;
+						color: rgba(255, 255, 255, 0.7);
+						cursor: pointer;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+						transition: all 0.2s ease;
+						z-index: 10;
+					}
+
+					.copy-button:hover {
+						background: #2d2d2d;
+						color: rgba(255, 255, 255, 1);
+						border-color: rgba(255, 255, 255, 0.3);
+					}
+
+					.copy-button:active {
+						transform: scale(0.95);
+					}
+
 					/* Override Prism styles */
 					.code :global(pre[class*="language-"]) {
 						text-shadow: none;
 						border-radius: 4px;
+						padding-right: 3.5rem;
 					}
 				`}
 			</style>

+ 14 - 3
apps/kilocode-docs/components/Image.tsx

@@ -17,18 +17,29 @@ export function Image({ src, alt, width, height, caption }: ImageProps) {
 	if (width) imgStyle.width = width
 	if (height) imgStyle.height = height
 
+	const figureStyle: React.CSSProperties = {
+		margin: "1.5rem 0",
+		maxWidth: "100%",
+		overflow: "hidden",
+	}
+
+	// If width is specified, apply it to the figure to constrain caption width
+	if (width) {
+		figureStyle.width = width
+		figureStyle.maxWidth = "100%"
+	}
+
 	return (
-		<figure style={{ margin: "1.5rem 0", maxWidth: "100%", overflow: "hidden" }}>
+		<figure style={figureStyle}>
 			<img src={src} alt={alt} style={imgStyle} />
 			{caption && (
 				<figcaption
 					style={{
-						display: "table-caption",
-						captionSide: "bottom",
 						fontStyle: "italic",
 						textAlign: "center",
 						marginTop: "0.5rem",
 						color: "var(--gray-600, #6b7280)",
+						width: "100%",
 					}}>
 					{caption}
 				</figcaption>

+ 66 - 0
apps/kilocode-docs/components/TopNav.tsx

@@ -95,6 +95,33 @@ function SparkleIcon({ className }: { className?: string }) {
 	)
 }
 
+function SearchIcon({ className }: { className?: string }) {
+	return (
+		<svg
+			className={className}
+			width="20"
+			height="20"
+			viewBox="0 0 20 20"
+			fill="none"
+			xmlns="http://www.w3.org/2000/svg">
+			<path
+				d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z"
+				stroke="currentColor"
+				strokeWidth="2"
+				strokeLinecap="round"
+				strokeLinejoin="round"
+			/>
+			<path
+				d="M19 19L14.65 14.65"
+				stroke="currentColor"
+				strokeWidth="2"
+				strokeLinecap="round"
+				strokeLinejoin="round"
+			/>
+		</svg>
+	)
+}
+
 function HamburgerIcon({ isOpen }: { isOpen: boolean }) {
 	return (
 		<div className={`hamburger ${isOpen ? "open" : ""}`}>
@@ -203,6 +230,14 @@ export function TopNav({ onMobileMenuToggle, isMobileMenuOpen = false, showMobil
 		return router.pathname.startsWith(href)
 	}
 
+	// Open DocSearch modal programmatically
+	const openDocSearch = () => {
+		const searchButton = document.querySelector(".DocSearch-Button") as HTMLButtonElement
+		if (searchButton) {
+			searchButton.click()
+		}
+	}
+
 	// Initialize DocSearch
 	useEffect(() => {
 		docsearch({
@@ -253,6 +288,13 @@ export function TopNav({ onMobileMenuToggle, isMobileMenuOpen = false, showMobil
 				</div>
 
 				<div className="right-actions">
+					{/* Mobile search button */}
+					<button
+						className="mobile-search-btn mobile-only"
+						onClick={openDocSearch}
+						aria-label="Search documentation">
+						<SearchIcon />
+					</button>
 					<ThemeToggle />
 					<Link href="https://kilo.ai/github" className="github-link desktop-nav">
 						GitHub
@@ -425,6 +467,22 @@ export function TopNav({ onMobileMenuToggle, isMobileMenuOpen = false, showMobil
 					gap: 0.5rem;
 				}
 
+				.mobile-search-btn {
+					display: none;
+					align-items: center;
+					justify-content: center;
+					padding: 0.5rem;
+					background: transparent;
+					border: none;
+					cursor: pointer;
+					color: var(--text-secondary);
+					transition: color 0.15s ease;
+				}
+
+				.mobile-search-btn:hover {
+					color: var(--text-color);
+				}
+
 				/* Mobile styles */
 				@media (max-width: 768px) {
 					.top-bar {
@@ -435,6 +493,14 @@ export function TopNav({ onMobileMenuToggle, isMobileMenuOpen = false, showMobil
 						display: flex;
 					}
 
+					.mobile-search-btn {
+						display: flex;
+					}
+
+					.mobile-only {
+						display: flex;
+					}
+
 					.logo-icon {
 						display: none;
 					}

+ 16 - 15
apps/kilocode-docs/lib/nav/automate.ts

@@ -22,23 +22,24 @@ export const AutomateNav: NavSection[] = [
 				href: "/automate/extending/auto-launch",
 				children: "Auto-launch Configuration",
 			},
-		],
-	},
-	{
-		title: "MCP",
-		links: [
-			{ href: "/automate/mcp/overview", children: "MCP Overview" },
-			{
-				href: "/automate/mcp/using-in-kilo-code",
-				children: "Using MCP in Kilo Code",
-			},
-			{ href: "/automate/mcp/using-in-cli", children: "Using MCP in CLI" },
-			{ href: "/automate/mcp/what-is-mcp", children: "What is MCP" },
 			{
-				href: "/automate/mcp/server-transports",
-				children: "Server Transports",
+				href: "/automate/mcp/overview",
+				children: "MCP",
+				subLinks: [
+					{ href: "/automate/mcp/overview", children: "MCP Overview" },
+					{
+						href: "/automate/mcp/using-in-kilo-code",
+						children: "Using MCP in Kilo Code",
+					},
+					{ href: "/automate/mcp/using-in-cli", children: "Using MCP in CLI" },
+					{ href: "/automate/mcp/what-is-mcp", children: "What is MCP" },
+					{
+						href: "/automate/mcp/server-transports",
+						children: "Server Transports",
+					},
+					{ href: "/automate/mcp/mcp-vs-api", children: "MCP vs API" },
+				],
 			},
-			{ href: "/automate/mcp/mcp-vs-api", children: "MCP vs API" },
 		],
 	},
 	{

+ 24 - 18
apps/kilocode-docs/lib/nav/code-with-ai.ts

@@ -32,19 +32,24 @@ export const CodeWithAiNav: NavSection[] = [
 				href: "/code-with-ai/agents/model-selection",
 				children: "Model Selection",
 			},
+			{
+				href: "/code-with-ai/agents/auto-model",
+				children: "Auto Model",
+			},
 			{
 				href: "/code-with-ai/agents/free-and-budget-models",
 				children: "Free & Budget Models",
 			},
-		],
-	},
-	{
-		title: "Modes",
-		links: [
-			{ href: "/code-with-ai/agents/using-modes", children: "Using Modes" },
 			{
-				href: "/code-with-ai/agents/orchestrator-mode",
-				children: "Orchestrator Mode",
+				href: "/code-with-ai/agents/using-modes",
+				children: "Modes",
+				subLinks: [
+					{ href: "/code-with-ai/agents/using-modes", children: "Using Modes" },
+					{
+						href: "/code-with-ai/agents/orchestrator-mode",
+						children: "Orchestrator Mode",
+					},
+				],
 			},
 		],
 	},
@@ -66,18 +71,19 @@ export const CodeWithAiNav: NavSection[] = [
 				children: "Git Commit Generation",
 			},
 			{ href: "/code-with-ai/features/speech-to-text", children: "Voice Transcription" },
-		],
-	},
-	{
-		title: "Agent Behavior",
-		links: [
-			{ href: "/code-with-ai/features/browser-use", children: "Browser Use" },
-			{ href: "/code-with-ai/features/fast-edits", children: "Fast Edits" },
 			{
-				href: "/code-with-ai/features/task-todo-list",
-				children: "Task Todo List",
+				href: "/code-with-ai/features/browser-use",
+				children: "Agent Behavior",
+				subLinks: [
+					{ href: "/code-with-ai/features/browser-use", children: "Browser Use" },
+					{ href: "/code-with-ai/features/fast-edits", children: "Fast Edits" },
+					{
+						href: "/code-with-ai/features/task-todo-list",
+						children: "Task Todo List",
+					},
+					{ href: "/code-with-ai/features/checkpoints", children: "Checkpoints" },
+				],
 			},
-			{ href: "/code-with-ai/features/checkpoints", children: "Checkpoints" },
 		],
 	},
 ]

+ 19 - 18
apps/kilocode-docs/lib/nav/collaborate.ts

@@ -27,26 +27,27 @@ export const CollaborateNav: NavSection[] = [
 			},
 			{ href: "/collaborate/teams/billing", children: "Billing" },
 			{ href: "/collaborate/teams/analytics", children: "Analytics" },
-		],
-	},
-	{
-		title: "AI Adoption Dashboard",
-		links: [
 			{
 				href: "/collaborate/adoption-dashboard/overview",
-				children: "Overview",
-			},
-			{
-				href: "/collaborate/adoption-dashboard/understanding-your-score",
-				children: "Understanding Your Score",
-			},
-			{
-				href: "/collaborate/adoption-dashboard/improving-your-score",
-				children: "Improving Your Score",
-			},
-			{
-				href: "/collaborate/adoption-dashboard/for-team-leads",
-				children: "For Team Leads",
+				children: "AI Adoption Dashboard",
+				subLinks: [
+					{
+						href: "/collaborate/adoption-dashboard/overview",
+						children: "Overview",
+					},
+					{
+						href: "/collaborate/adoption-dashboard/understanding-your-score",
+						children: "Understanding Your Score",
+					},
+					{
+						href: "/collaborate/adoption-dashboard/improving-your-score",
+						children: "Improving Your Score",
+					},
+					{
+						href: "/collaborate/adoption-dashboard/for-team-leads",
+						children: "For Team Leads",
+					},
+				],
 			},
 		],
 	},

+ 46 - 25
apps/kilocode-docs/lib/nav/contributing.ts

@@ -18,34 +18,55 @@ export const ContributingNav: NavSection[] = [
 	{
 		title: "Architecture",
 		links: [
-			{ href: "/contributing/architecture", children: "Architecture Overview" },
 			{
-				href: "/contributing/architecture/annual-billing",
-				children: "Annual Billing",
+				href: "/contributing/architecture",
+				children: "Architecture Overview",
 			},
 			{
-				href: "/contributing/architecture/enterprise-mcp-controls",
-				children: "Enterprise MCP Controls",
-			},
-			{
-				href: "/contributing/architecture/onboarding-improvements",
-				children: "Onboarding Improvements",
-			},
-			{
-				href: "/contributing/architecture/organization-modes-library",
-				children: "Organization Modes Library",
-			},
-			{
-				href: "/contributing/architecture/track-repo-url",
-				children: "Track Repo URL",
-			},
-			{
-				href: "/contributing/architecture/vercel-ai-gateway",
-				children: "Vercel AI Gateway",
-			},
-			{
-				href: "/contributing/architecture/voice-transcription",
-				children: "Voice Transcription",
+				href: "/contributing/architecture/features",
+				children: "Features",
+				subLinks: [
+					{
+						href: "/contributing/architecture/agent-observability",
+						children: "Agent Observability",
+					},
+					{
+						href: "/contributing/architecture/annual-billing",
+						children: "Annual Billing",
+					},
+					{
+						href: "/contributing/architecture/enterprise-mcp-controls",
+						children: "Enterprise MCP Controls",
+					},
+					{
+						href: "/contributing/architecture/mcp-oauth-authorization",
+						children: "MCP OAuth Authorization",
+					},
+					{
+						href: "/contributing/architecture/onboarding-improvements",
+						children: "Onboarding Improvements",
+					},
+					{
+						href: "/contributing/architecture/organization-modes-library",
+						children: "Organization Modes Library",
+					},
+					{
+						href: "/deploy-secure/security-reviews",
+						children: "Agentic Security Reviews",
+					},
+					{
+						href: "/contributing/architecture/track-repo-url",
+						children: "Track Repo URL",
+					},
+					{
+						href: "/contributing/architecture/vercel-ai-gateway",
+						children: "Vercel AI Gateway",
+					},
+					{
+						href: "/contributing/architecture/voice-transcription",
+						children: "Voice Transcription",
+					},
+				],
 			},
 		],
 	},

+ 4 - 1
apps/kilocode-docs/lib/nav/customize.ts

@@ -33,7 +33,10 @@ export const CustomizeNav: NavSection[] = [
 				href: "/customize/context/codebase-indexing",
 				children: "Codebase Indexing",
 			},
-			{ href: "/customize/context/memory-bank", children: "Memory Bank" },
+			{
+				href: "/customize/context/kilocodeignore",
+				children: ".kilocodeignore",
+			},
 			{
 				href: "/customize/context/large-projects",
 				children: "Large Projects",

+ 18 - 1
apps/kilocode-docs/lib/nav/getting-started.ts

@@ -16,9 +16,26 @@ export const GettingStartedNav: NavSection[] = [
 				href: "/getting-started/setup-authentication",
 				children: "Setup & Authentication",
 			},
+			{
+				href: "/getting-started/using-kilo-for-free",
+				children: "Using Kilo for Free",
+			},
+			{
+				href: "/getting-started/byok",
+				children: "Bring Your Own Key (BYOK)",
+			},
 			{ href: "/ai-providers", children: "AI Providers" },
-			{ href: "/getting-started/settings", children: "Settings" },
+			{
+				href: "/getting-started/settings",
+				children: "Settings",
+				subLinks: [
+					{ href: "/getting-started/settings/auto-approving-actions", children: "Auto-Approving Actions" },
+					{ href: "/getting-started/settings/auto-cleanup", children: "Auto Cleanup" },
+					{ href: "/getting-started/settings/system-notifications", children: "System Notifications" },
+				],
+			},
 			{ href: "/getting-started/adding-credits", children: "Adding Credits" },
+			{ href: "/getting-started/rate-limits-and-costs", children: "Rate Limits and Costs" },
 		],
 	},
 	{

+ 11 - 12
apps/kilocode-docs/mappingplan.md

@@ -45,7 +45,6 @@
 | Task Todo List                      | `basic-usage/task-todo-list`                                               |
 | **Context & Indexing** (subheader)  |                                                                            |
 | Codebase Indexing                   | `features/codebase-indexing`                                               |
-| Memory Bank                         | `advanced-usage/memory-bank`                                               |
 | Large Projects                      | `advanced-usage/large-projects`                                            |
 | **Customization** (subheader)       |                                                                            |
 | Custom Modes                        | `agent-behavior/custom-modes`                                              |
@@ -163,17 +162,17 @@
 
 ## Pages to Remove from Nav / Condense
 
-| Page                               | Recommendation                                           |
-| ---------------------------------- | -------------------------------------------------------- |
-| `features/system-notifications`    | Fold into Settings or remove                             |
-| `features/more-features`           | This is a red flag - break out or remove                 |
-| `features/suggested-responses`     | Fold into Chat Interface                                 |
-| `features/auto-approving-actions`  | Fold into Settings                                       |
-| `advanced-usage/auto-cleanup`      | Fold into Settings                                       |
-| `features/model-temperature`       | Fold into Model Selection                                |
-| `advanced-usage/rate-limits-costs` | Fold into Adding Credits or AI Providers                 |
-| `features/footgun-prompting`       | Remove                                                   |
-| `tips-and-tricks`                  | Could become a blog post or fold relevant bits elsewhere |
+| Page                                  | Recommendation                                           |
+| ------------------------------------- | -------------------------------------------------------- |
+| ☑️ `features/system-notifications`    | Fold into Settings or remove                             |
+| ❎ `features/more-features`           | Remove                                                   |
+| ☑️ `features/suggested-responses`     | Fold into Chat Interface                                 |
+| ☑️ `features/auto-approving-actions`  | Fold into Settings                                       |
+| ☑️ `advanced-usage/auto-cleanup`      | Fold into Settings                                       |
+| ❎ `features/model-temperature`       | Remove                                                   |
+| ☑️ `advanced-usage/rate-limits-costs` | Fold into Adding Credits or AI Providers                 |
+| `features/footgun-prompting`       | Remove                                                   |
+| ☑️ `tips-and-tricks`                  | Could become a blog post or fold relevant bits elsewhere |
 
 ---
 

+ 6 - 1
apps/kilocode-docs/pages/_app.tsx

@@ -122,7 +122,12 @@ export default function MyApp({ Component, pageProps }: AppProps<MyAppProps>) {
 				<link rel="shortcut icon" href="https://kilo.ai/favicon.ico" />
 				<link rel="icon" href="https://kilo.ai/favicon.ico" sizes="48x48" type="image/x-icon" />
 				<link rel="icon" href="https://kilo.ai/favicon.svg" type="image/svg+xml" />
-				<link rel="apple-touch-icon" href="https://kilo.ai/apple-touch-icon.png" sizes="180x180" type="image/png" />
+				<link
+					rel="apple-touch-icon"
+					href="https://kilo.ai/apple-touch-icon.png"
+					sizes="180x180"
+					type="image/png"
+				/>
 				<link rel="manifest" href="https://kilo.ai/site.webmanifest" />
 				<link rel="icon" href="https://kilo.ai/android-chrome-192x192.png" type="image/png" sizes="192x192" />
 				<link rel="icon" href="https://kilo.ai/android-chrome-512x512.png" type="image/png" sizes="512x512" />

+ 12 - 1
apps/kilocode-docs/pages/automate/code-reviews.md

@@ -53,10 +53,21 @@ Once configured, the Review Agent will run automatically on PR events.
 
 ## Local Code Reviews
 
-Code Reviewer is also available locally via the new Review Mode. Simply select 'Review' from the mode dropdown after making local changes, and click 'Send' for AI-powered feedback and suggestions. This is valuable for developers who want to review their code before pushing a pull request to their team publicly, or for developers who want reviews and don't need to ship a pull request to GitHub.
+Code Reviewer is also available locally. This is valuable for developers who want to review their code before pushing a pull request to their team publicly, or for developers who want reviews and don't need to ship a pull request to GitHub.
+
+### VS Code
+
+Select 'Review' from the mode dropdown after making local changes, and click 'Send' for AI-powered feedback and suggestions.
 
 ![VS Code interface showing Review option in mode dropdown](/docs/img/code-reviewer/review-mode.png "Review Mode")
 
+### CLI
+
+The CLI provides two commands for local code reviews:
+
+- **`/local-review`** — Review all changes on your current branch vs the base branch
+- **`/local-review-uncommitted`** — Review uncommitted changes (staged + unstaged)
+
 ## How Code Reviews Work
 
 - When a pull request is opened or updated:

+ 3 - 3
apps/kilocode-docs/pages/automate/how-tools-work.md

@@ -30,9 +30,9 @@ Describe what you want to accomplish in natural language, and Kilo Code will:
 
 Here's how a typical tool interaction works:
 
-<img src="/docs/img/how-tools-work/how-tools-work.png" alt="Tool approval interface showing Save and Reject buttons along with Auto-approve checkbox" width="600" />
-
-_The tool approval interface shows Save/Reject buttons and Auto-approve options._
+{% callout type="info" title="Tool Approval UI" %}
+When a tool is proposed, you'll see Save and Reject buttons along with an optional Auto-approve checkbox for trusted operations.
+{% /callout %}
 
 **User:** Create a file named `greeting.js` that logs a greeting message
 

+ 4 - 0
apps/kilocode-docs/pages/automate/mcp/using-in-kilo-code.md

@@ -207,6 +207,10 @@ Common issues and solutions:
 - **Tool Not Available:** Confirm the server is properly implementing the tool and it's not disabled in settings
 - **Slow Performance:** Try adjusting the network timeout value for the specific MCP server
 
+{% callout type="tip" %}
+**Reduce system prompt size:** If you're not using MCP, turn it off in Settings > Agent Behaviour > MCP Servers to significantly cut down the size of the system prompt and improve performance.
+{% /callout %}
+
 ## Platform-Specific MCP Configuration Examples
 
 ### Windows Configuration Example

+ 100 - 0
apps/kilocode-docs/pages/code-with-ai/agents/auto-model.md

@@ -0,0 +1,100 @@
+---
+title: "Auto Model"
+description: "Smart model routing that automatically selects the optimal AI model based on your current mode"
+---
+
+# Auto Model
+
+Auto Model (`kilo/auto`) is a smart model routing system that automatically selects the optimal AI model based on the Kilo Code mode you're using. It balances cost and capability so you get the best results without manual model switching.
+
+## How It Works
+
+1. Select `kilo/auto` as your model in the model dropdown
+2. Start working in any mode (Code, Architect, Debug, etc.)
+3. The system automatically routes your requests to the best model for that task
+
+That's it. No configuration needed.
+
+## Mode-to-Model Mapping
+
+Auto Model routes to different models based on the task type:
+
+| Mode           | Model Used        | Best For                     |
+| -------------- | ----------------- | ---------------------------- |
+| `architect`    | Claude Opus 4.6   | System design, planning      |
+| `orchestrator` | Claude Opus 4.6   | Multi-step task coordination |
+| `ask`          | Claude Opus 4.6   | Questions, explanations      |
+| `plan`         | Claude Opus 4.6   | Planning, reasoning          |
+| `general`      | Claude Opus 4.6   | General assistance           |
+| `code`         | Claude Sonnet 4.5 | Writing and editing code     |
+| `build`        | Claude Sonnet 4.5 | Implementation tasks         |
+| `debug`        | Claude Sonnet 4.5 | Debugging and fixing issues  |
+| `explore`      | Claude Sonnet 4.5 | Codebase exploration         |
+
+**Planning and reasoning tasks** use Claude Opus 4.6, which excels at complex reasoning, architectural decisions, and breaking down problems.
+
+**Implementation tasks** use Claude Sonnet 4.5, which is optimized for fast, accurate code generation and editing.
+
+## Benefits
+
+### Simplified Setup
+
+No need to manually switch models when changing modes. Auto Model handles the routing transparently in the background.
+
+### Cost Optimization
+
+Uses the more economical Sonnet for implementation tasks where speed matters, while reserving Opus for planning tasks that benefit from deeper reasoning. You get optimal cost-to-capability ratio without thinking about it.
+
+### Best-in-Class Models
+
+Auto Model always routes to Claude's latest and most capable models:
+
+- **Claude Opus** for reasoning-intensive tasks
+- **Claude Sonnet** for implementation-focused tasks
+
+## Requirements
+
+{% callout type="warning" title="Version Requirements" %}
+Auto Model requires **VS Code/JetBrains extension v5.2.3+** or **CLI v1.0.15+** for automatic mode-based switching. On older versions, `kilo/auto` will default to Claude Sonnet for all requests.
+{% /callout %}
+
+## Getting Started
+
+{% callout type="tip" title="Quick Setup" %}
+Select `kilo/auto` from the model dropdown in the Kilo Code chat interface. That's all you need to do.
+{% /callout %}
+
+1. Open Kilo Code in VS Code or JetBrains
+2. Click the model selector dropdown
+3. Choose `kilo/auto`
+4. Start chatting - the right model is selected automatically based on your current mode
+
+## When to Use Auto Model
+
+Auto Model is ideal for:
+
+- **Developers who frequently switch between planning and coding** - No need to remember which model works best for each task
+- **Teams wanting consistent model selection** - Everyone gets optimal routing without individual configuration
+- **Cost-conscious developers** - Automatically balances cost and capability
+- **New Kilo Code users** - Great defaults without needing to understand model differences
+
+## When to Use a Specific Model
+
+You may want to select a specific model instead when:
+
+- Cost is not a factor for a particular task
+- You need a particular model's unique capabilities (e.g., very long context windows)
+- You're working with a specialized provider or local model
+- You want full control over model selection
+
+## Feedback
+
+{% callout type="note" title="Help Us Improve" %}
+Auto Model is a new feature and we're actively improving it. We'd love to hear how it's working for you! Share feedback in our [Discord](https://discord.gg/kilocode) or [open an issue on GitHub](https://github.com/Kilo-Org/kilocode/issues).
+{% /callout %}
+
+## Related
+
+- [Model Selection Guide](/docs/code-with-ai/agents/model-selection) - General guidance on choosing models
+- [Using Modes](/docs/code-with-ai/agents/using-modes) - Learn about different Kilo Code modes
+- [Free & Budget Models](/docs/code-with-ai/agents/free-and-budget-models) - Cost-effective alternatives

+ 50 - 11
apps/kilocode-docs/pages/code-with-ai/agents/chat-interface.md

@@ -27,17 +27,9 @@ Find the Kilo Code icon ({% kilo-code-icon /%}) in VS Code's Primary Side Bar. C
 
 **Good requests:**
 
-```
-create a new file named utils.py and add a function called add that takes two numbers as arguments and returns their sum
-```
-
-```
-in the file @src/components/Button.tsx, change the color of the button to blue
-```
-
-```
-find all instances of the variable oldValue in @/src/App.js and replace them with newValue
-```
+- `create a new file named utils.py and add a function called add that takes two numbers as arguments and returns their sum`
+- `in the file @src/components/Button.tsx, change the color of the button to blue`
+- `find all instances of the variable oldValue in @/src/App.js and replace them with newValue`
 
 **What makes requests work:**
 
@@ -91,4 +83,51 @@ find all instances of the variable oldValue in @/src/App.js and replace them wit
 
 **Why it matters:** Kilo Code works best when you communicate like you're talking to a smart teammate who needs clear direction.
 
+## Suggested Responses
+
+When Kilo Code needs more information to complete a task, it uses the [`ask_followup_question`](/docs/features/tools/ask-followup-question) tool. To make responding easier and faster, Kilo Code often provides suggested answers alongside the question.
+
+{% image src="/docs/img/suggested-responses/suggested-responses.png" alt="Example of Kilo Code asking a question with suggested response buttons below it" width="800" caption="Suggested responses appear as clickable buttons below questions" /%}
+
+**How it works:**
+
+1. **Question Appears** - Kilo Code asks a question using the `ask_followup_question` tool
+2. **Suggestions Displayed** - If suggestions are provided, they appear as buttons below the question
+3. **Interaction** - You can interact with these suggestions in two ways
+
+**Interacting with suggestions:**
+
+You have two options for using suggested responses:
+
+1. **Direct Selection**:
+
+    - **Action**: Simply click the button containing the answer you want to provide
+    - **Result**: The selected answer is immediately sent back to Kilo Code as your response. This is the quickest way to reply if one of the suggestions perfectly matches your intent.
+
+2. **Edit Before Sending**:
+    - **Action**:
+        - Hold down `Shift` and click the suggestion button
+        - _Alternatively_, hover over the suggestion button and click the pencil icon ({% codicon name="edit" /%}) that appears
+    - **Result**: The text of the suggestion is copied into the chat input box. You can then modify the text as needed before pressing Enter to send your customized response. This is useful when a suggestion is close but needs minor adjustments.
+
+**Benefits:**
+
+- **Speed** - Quickly respond without typing full answers
+- **Clarity** - Suggestions often clarify the type of information Kilo Code needs
+- **Flexibility** - Edit suggestions to provide precise, customized answers when needed
+
+This feature streamlines the interaction when Kilo Code requires clarification, allowing you to guide the task effectively with minimal effort.
+
+## Tips for Better Workflow
+
+{% callout type="tip" %}
+**Move Kilo Code to the Secondary Side Bar** for a better layout. Right-click on the Kilo Code icon in the Activity Bar and select **Move To → Secondary Side Bar**. This lets you see the Explorer, Search, Source Control, etc. alongside Kilo Code.
+
+{% image src="/docs/img/move-to-secondary.png" alt="Move to Secondary Side Bar" width="600" caption="Move Kilo Code to the Secondary Side Bar for better workspace organization" /%}
+{% /callout %}
+
+{% callout type="tip" %}
+**Drag files directly into chat.** Once you have Kilo Code in a separate sidebar from the file explorer, you can drag files from the explorer into the chat window (even multiple at once). Just hold down the Shift key after you start dragging the files.
+{% /callout %}
+
 Ready to start coding? Open the chat panel and describe what you want to build!

+ 11 - 5
apps/kilocode-docs/pages/code-with-ai/agents/free-and-budget-models.md

@@ -9,9 +9,15 @@ description: Learn how to use Kilo Code effectively while minimizing or eliminat
 
 ## Completely Free Options
 
-### Grok Code Fast 1
+### Kilo Gateway Free Models
 
-This frontier AI model is 100% free in Kilo Code for a limited time. [See the blog post for more details](https://blog.kilo.ai/p/grok-code-fast-get-this-frontier-ai-model-free).
+From time to time, Kilo works with AI inference providers to offer free models. These are available through the Kilo Gateway. Currently, we are offering these free models:
+
+- **MiniMax M2.1 (free)** - A capable model from MiniMax with strong general-purpose performance.
+- **Z.AI: GLM 4.7 (free)** - Latest variant of the GLM family, purpose-built for agent-centric applications.
+- **MoonshotAI: Kimi K2.5 (free)** - Optimized for agentic capabilities, including advanced tool use, reasoning, and code synthesis.
+- **Giga Potato (free)** - A stealth release model that is free in its evaluation period.
+- **Arcee AI: Trinity Large Preview (free)** - A preview model from Arcee AI with strong capabilities.
 
 ### OpenRouter Free Tier Models
 
@@ -96,11 +102,11 @@ When you need more capability than free models provide, these options deliver ex
 @src/components/UserProfile.tsx:45-67
 ```
 
-**Use Memory Bank effectively:**
+**Reuse context effectively:**
 
-- Store project context once in [Memory Bank](/docs/customize/context/memory-bank)
+- Keep key project notes in your repository (e.g., a AGENTS.md or docs folder)
 - Reduces need to re-explain project details
-- Saves 200-500 tokens per conversation
+- Saves tokens per conversation
 
 **Strategic file mentions:**
 

+ 8 - 2
apps/kilocode-docs/pages/code-with-ai/agents/model-selection.md

@@ -38,8 +38,14 @@ One thing that doesn't change: context window size matters for your workflow.
 
 Check [our provider docs](/docs/basic-usage/connecting-providers) for specific context limits on each model.
 
+{% callout type="tip" %}
+**Be thoughtful about Max Tokens settings for thinking models.** Every token you allocate to output takes away from space available to store conversation history. Consider only using high `Max Tokens` / `Max Thinking Tokens` settings with modes like Architect and Debug, and keeping Code mode at 16k max tokens or less.
+{% /callout %}
+
+{% callout type="tip" %}
+**Recover from context limit errors:** If you hit the `input length and max tokens exceed context limit` error, you can recover by deleting a message, rolling back to a previous checkpoint, or switching over to a model with a long context window like Gemini for a message.
+{% /callout %}
+
 ## Stay Current
 
 The AI model space moves fast. Bookmark [kilo.ai/models](https://kilo.ai/models) and check back when you're evaluating options. What's best today might not be best next month — and that's actually exciting.
-
--->

+ 4 - 0
apps/kilocode-docs/pages/code-with-ai/agents/using-modes.md

@@ -78,6 +78,10 @@ Four ways to switch modes:
 | **Ideal For**        | Tracking down bugs, diagnosing errors, and resolving complex issues                 |
 | **Special Features** | Uses a methodical approach of analyzing, narrowing possibilities, and fixing issues |
 
+{% callout type="tip" %}
+**Keep debugging separate from main tasks:** When using Debug mode, ask Kilo to "start a new task in Debug mode with all of the necessary context needed to figure out X" so that the debugging process uses its own context window and doesn't pollute the main task.
+{% /callout %}
+
 ### Orchestrator Mode
 
 | Aspect               | Details                                                                                                             |

+ 12 - 0
apps/kilocode-docs/pages/code-with-ai/features/autocomplete/index.md

@@ -96,6 +96,18 @@ If using Cursor, go to **Settings** > **Cursor Settings** > **Tab**, and toggle
 
 ## Tips
 
+{% callout type="tip" %}
+**When to use chat vs autocomplete:** Use chat for multi-file changes, refactoring, or when you need to explain intent. Use autocomplete for quick, localized edits where the context is already clear from surrounding code.
+{% /callout %}
+
+{% callout type="tip" %}
+**Steer autocomplete with comments:** Write a comment describing what you want before triggering autocomplete, or type a function signature—autocomplete will fill in the implementation.
+{% /callout %}
+
+{% callout type="tip" %}
+**Treat suggestions as drafts:** Accept autocomplete suggestions quickly, then refine. It's often faster to fix a 90% correct suggestion than to craft the perfect prompt.
+{% /callout %}
+
 - Autocomplete works best with clear, well-structured code
 - Comments above functions help autocomplete understand intent
 - Variable and function names matter - descriptive names lead to better suggestions

+ 5 - 12
apps/kilocode-docs/pages/code-with-ai/features/browser-use.md

@@ -33,17 +33,9 @@ A typical browser interaction follows this pattern:
 
 For example:
 
-```
-Open the browser and view our site.
-```
-
-```
-Can you check if my website at https://kilocode.ai is displaying correctly?
-```
-
-```
-Browse http://localhost:3000, scroll down to the bottom of the page and check if the footer information is displaying correctly.
-```
+- `Open the browser and view our site.`
+- `Can you check if my website at https://kilocode.ai is displaying correctly?`
+- `Browse http://localhost:3000, scroll down to the bottom of the page and check if the footer information is displaying correctly.`
 
 {% image src="/docs/img/browser-use/KiloCodeBrowser.png" alt="Browser use example" width="300" /%}
 
@@ -77,7 +69,8 @@ Key characteristics:
 - **Viewport size**: Small Desktop (900x600)
 - **Screenshot quality**: 75%
 - **Use remote browser connection**: Disabled
-  {% /callout %}
+
+{% /callout %}
 
 ### Accessing Settings
 

+ 2 - 1
apps/kilocode-docs/pages/code-with-ai/features/checkpoints.md

@@ -22,7 +22,8 @@ Checkpoints let you:
 - No GitHub account or repository is required
 - No Git personal information configuration is needed
 - The shadow Git repository operates independently from your project's existing Git configuration
-  {% /callout %}
+
+{% /callout %}
 
 ## Configuration Options
 

+ 25 - 3
apps/kilocode-docs/pages/code-with-ai/features/task-todo-list.md

@@ -28,6 +28,18 @@ description: "Track and manage tasks with AI-generated todo lists"
 
 ---
 
+## How todo lists are updated
+
+Todo lists are managed with the [`update_todo_list` tool](/docs/features/tools/update-todo-list). Each time Kilo updates the list, it replaces the entire checklist with the latest view of the task.
+
+Kilo updates the list when:
+
+- New steps are discovered
+- Items are completed or reprioritized
+- You explicitly ask for a todo list
+
+---
+
 ## The old way vs. the new way
 
 **Before**: You juggled task steps in your head or scattered notes, constantly wondering "what's next?"
@@ -43,6 +55,8 @@ Quick progress overview with your next important item
 
 {% image src="/docs/img/task-todo-list/task-header.png" alt="Task header summary showing todo list progress" width="500" /%}
 
+Click the task header summary to expand the full list inline and jump to the current item.
+
 **2. Interactive Tool Block**
 Full todo interface in chat where you can:
 
@@ -55,24 +69,28 @@ Background "REMINDERS" table that keeps Kilo informed about current progress
 
 ## Task status decoded
 
-**Pending**  Empty checkbox (not started)
+**Pending** -> Empty checkbox (not started)
 
 {% image src="/docs/img/task-todo-list/not-started.png" alt="Pending todo item with empty checkbox" width="300" /%}
 
 ---
 
-**In Progress**  Yellow dot (currently working)
+**In Progress** -> Yellow dot (currently working)
 
 {% image src="/docs/img/task-todo-list/in-progress.png" alt="In progress todo item with yellow dot indicator" width="300" /%}
 
 ---
 
-**Completed**  Green checkmark (finished)
+**Completed** -> Green checkmark (finished)
 
 {% image src="/docs/img/task-todo-list/complete.png" alt="Completed todo item with green checkmark" width="300" /%}
 
 ---
 
+## Editing todo lists
+
+When Kilo proposes a todo list update, you can edit the list before approving. Use the "Edit" button in the tool block to update item text, add or remove steps, or adjust status. Once approved, Kilo continues with the updated list.
+
 ## Common questions
 
 **"Can I create my own todo lists?"**
@@ -86,6 +104,10 @@ Design choice. Kilo maintains authority over task management to ensure consisten
 
 ---
 
+## Settings
+
+You can disable todo lists in Settings -> Advanced -> **Enable todo list tool**. When disabled, Kilo won't create or update todo lists, and the REMINDERS table won't appear in Environment Details.
+
 {% callout type="tip" title="Pro tip: Auto-approval" %}
 **What it does**: Automatically approves todo list updates without confirmation prompts.
 

+ 289 - 475
apps/kilocode-docs/pages/code-with-ai/platforms/cli.md

@@ -3,37 +3,46 @@ title: "Kilo CLI"
 description: "Using Kilo Code from the command line"
 ---
 
+{% callout type="warning" title="Version Notice" %}
+This documentation applies only to Kilo version 1.0 and later. Users running versions below 1.0 should upgrade before proceeding.
+{% /callout %}
+
 # Kilo CLI
 
 Orchestrate agents from your terminal. Plan, debug, and code fast with keyboard-first navigation on the command line.
 
 The Kilo Code CLI uses the same underlying technology that powers the IDE extensions, so you can expect the same workflow to handle agentic coding tasks from start to finish.
 
-## Install
+## Getting Started
 
-`npm install -g @kilocode/cli`
+### Install
 
-Change directory to where you want to work and run kilocode:
+{% partial file="install-cli.md" /%}
 
-```bash
-# Start interactive chat session
-kilocode
+Change directory to where you want to work and run kilo:
 
-# Start with a specific mode
-kilocode --mode architect
+```bash
+# Start the TUI
+kilo
 
-# Start with a specific workspace
-kilocode --workspace /path/to/project
+# Check the version
+kilo --version
 
-# Resume last conversation from current workspace
-kilocode --continue
+# Get help
+kilo --help
 ```
 
-to start the CLI and begin a new task with your preferred model and relevant mode.
+### First-Time Setup with `/connect`
+
+After installation, run `kilo` and use the `/connect` command to add your first provider credentials. This is the interactive way to configure API keys for model providers.
 
 ## Update
 
-Upgrade the Kilo CLI package:
+Upgrade the Kilo CLI:
+
+`kilo upgrade`
+
+Or use npm:
 
 `npm update -g @kilocode/cli`
 
@@ -45,488 +54,329 @@ Upgrade the Kilo CLI package:
 - **Automate tasks.** Get AI assistance writing shell scripts for tasks like renaming all of the files in a folder or transforming sizes for a set of images.
 - **Extend capabilities with skills.** Add domain expertise and repeatable workflows through [Agent Skills](#skills).
 
-## CLI reference
-
-### Keyboard shortcuts
-
-| Shortcut    | Description                                                                        |
-| ----------- | ---------------------------------------------------------------------------------- |
-| `Shift+Tab` | Cycle through modes (architect → code → ask → debug → orchestrator → custom modes) |
-| `Ctrl+C`    | Exit (press twice to confirm)                                                      |
-| `Ctrl+X`    | Cancel current task                                                                |
-| `Esc`       | Cancel current task (while streaming) or clear input                               |
-| `Ctrl+Y`    | Toggle YOLO mode (auto-approve all operations)                                     |
-| `Ctrl+R`    | Resume task (when a task is ready to resume)                                       |
-| `!`         | Enter shell mode (when input is empty)                                             |
-| `↑/↓`       | Navigate command history (when input is empty)                                     |
-
-### CLI commands
-
-| Command               | Description                                                      | Example                        |
-| --------------------- | ---------------------------------------------------------------- | ------------------------------ |
-| `kilocode`            | Start interactive                                                |                                |
-| `/mode`               | Switch between modes (architect, code, debug, ask, orchestrator) | `/mode orchestrator`           |
-| `/model`              | Learn about available models and switch between them             |                                |
-| `/model list`         | List available models                                            |                                |
-| `/model info`         | Prints description for a specific model by name                  | `/model info z-ai/glm-4.5v`    |
-| `/model select`       | Select and switch to a new model                                 |                                |
-| `/checkpoint list`    | List all available checkpoints                                   |                                |
-| `/checkpoint restore` | Revert to a specific checkpoint (destructive action)             | `/checkpoint restore 41db173a` |
-| `/tasks`              | View task history                                                |                                |
-| `/tasks search`       | Search tasks by query                                            | `/tasks search bug fix`        |
-| `/tasks select`       | Switch to a specific task                                        | `/tasks select abc123`         |
-| `/tasks page`         | Go to a specific page                                            | `/tasks page 2`                |
-| `/tasks next`         | Go to next page of task history                                  |                                |
-| `/tasks prev`         | Go to previous page of task history                              |                                |
-| `/tasks sort`         | Change sort order                                                | `/tasks sort most-expensive`   |
-| `/tasks filter`       | Filter tasks                                                     | `/tasks filter favorites`      |
-| `/teams`              | List all organizations you can switch into                       |                                |
-| `/teams select`       | Switch to a different organization                               |                                |
-| `/config`             | Open configuration editor (same as `kilocode config`)            |                                |
-| `/new`                | Start a new task with the agent with a clean slate               |                                |
-| `/help`               | List available commands and how to use them                      |                                |
-| `/exit`               | Exit the CLI                                                     |                                |
-
-## Skills
-
-The CLI supports [Agent Skills](https://agentskills.io/), a lightweight format for extending AI capabilities with specialized knowledge and workflows.
-
-Skills are discovered from:
-
-- **Global skills**: `~/.kilocode/skills/` (available in all projects)
-- **Project skills**: `.kilocode/skills/` (project-specific)
-
-Skills can be:
-
-- **Generic** - Available in all modes
-- **Mode-specific** - Only loaded when using a particular mode (e.g., `code`, `architect`)
-
-For example:
-
-```
-your-project/
-└── .kilocode/
-    ├── skills/               # Generic skills for this project
-    │   └── project-conventions/
-    │       └── SKILL.md
-    └── skills-code/          # Code mode skills for this project
-        └── linting-rules/
-            └── SKILL.md
-```
-
-### Adding a Skill
-
-1. Create the skill directory:
-
-    ```bash
-    mkdir -p ~/.kilocode/skills/api-design
-    ```
-
-2. Create a `SKILL.md` file with YAML frontmatter:
-
-    ```markdown
-    ---
-    name: api-design
-    description: REST API design best practices and conventions
-    ---
-
-    # API Design Guidelines
-
-    When designing REST APIs, follow these conventions...
-    ```
-
-    The `name` field must match the directory name exactly.
-
-3. Start a new CLI session to load the skill
-
-#### Finding skills
+## CLI Reference
+
+### Top-Level CLI Commands
+
+| Command                   | Description                                |
+| ------------------------- | ------------------------------------------ |
+| `kilo [project]`          | Start the TUI (Terminal User Interface)    |
+| `kilo run [message..]`    | Run with a message (non-interactive mode)  |
+| `kilo attach <url>`       | Attach to a running kilo server            |
+| `kilo serve`              | Start a headless server                    |
+| `kilo web`                | Start server and open web interface        |
+| `kilo auth`               | Manage credentials (login, logout, list)   |
+| `kilo agent`              | Manage agents (create, list)               |
+| `kilo mcp`                | Manage MCP servers (list, add, auth)       |
+| `kilo models [provider]`  | List available models                      |
+| `kilo stats`              | Show token usage and cost statistics       |
+| `kilo session`            | Manage sessions (list)                     |
+| `kilo export [sessionID]` | Export session data as JSON                |
+| `kilo import <file>`      | Import session data from JSON file or URL  |
+| `kilo upgrade [target]`   | Upgrade kilo to latest or specific version |
+| `kilo uninstall`          | Uninstall kilo and remove related files    |
+| `kilo pr <number>`        | Fetch and checkout a GitHub PR branch      |
+| `kilo github`             | Manage GitHub agent (install, run)         |
+| `kilo debug`              | Debugging and troubleshooting tools        |
+| `kilo completion`         | Generate shell completion script           |
 
-There are community efforts to build and share agent skills. Some resources include:
+### Global Options
 
-- [Skills Marketplace](https://skillsmp.com/) - Community marketplace of skills
-- [Skill Specification](https://agentskills.io/home) - Agent Skills specification
+| Flag              | Description                         |
+| ----------------- | ----------------------------------- |
+| `--help`, `-h`    | Show help                           |
+| `--version`, `-v` | Show version number                 |
+| `--print-logs`    | Print logs to stderr                |
+| `--log-level`     | Log level: DEBUG, INFO, WARN, ERROR |
 
-## Custom Commands
+### Interactive Slash Commands
 
-Custom commands allow you to create reusable slash commands that execute predefined prompts with argument substitution. They provide a convenient way to streamline repetitive tasks and standardize workflows.
+#### Session Commands
 
-Custom commands are discovered from:
+| Command       | Aliases                | Description               |
+| ------------- | ---------------------- | ------------------------- |
+| `/sessions`   | `/resume`, `/continue` | Switch session            |
+| `/new`        | `/clear`               | New session               |
+| `/share`      | -                      | Share session             |
+| `/unshare`    | -                      | Unshare session           |
+| `/rename`     | -                      | Rename session            |
+| `/timeline`   | -                      | Jump to message           |
+| `/fork`       | -                      | Fork from message         |
+| `/compact`    | `/summarize`           | Compact/summarize session |
+| `/undo`       | -                      | Undo previous message     |
+| `/redo`       | -                      | Redo message              |
+| `/copy`       | -                      | Copy session transcript   |
+| `/export`     | -                      | Export session transcript |
+| `/timestamps` | `/toggle-timestamps`   | Show/hide timestamps      |
+| `/thinking`   | `/toggle-thinking`     | Show/hide thinking blocks |
 
-- **Global commands**: `~/.kilocode/commands/` (available in all projects)
-- **Project commands**: `.kilocode/commands/` (project-specific)
+#### Agent & Model Commands
 
-Commands are simple markdown files with YAML frontmatter for configuration.
+| Command   | Description  |
+| --------- | ------------ |
+| `/models` | Switch model |
+| `/agents` | Switch agent |
+| `/mcps`   | Toggle MCPs  |
 
-### Creating a Custom Command
+#### Provider Commands
 
-1. Create the commands directory:
+| Command    | Description                                                               |
+| ---------- | ------------------------------------------------------------------------- |
+| `/connect` | Connect/add a provider - entry point for new users to add API credentials |
 
-    ```bash
-    mkdir -p ~/.kilocode/commands # mkdir %USERPROFILE%\.kilocode\commands on windows
-    ```
+#### System Commands
 
-2. Create a markdown file (e.g., `component.md`):
+| Command   | Aliases       | Description          |
+| --------- | ------------- | -------------------- |
+| `/status` | -             | View status          |
+| `/themes` | -             | Switch theme         |
+| `/help`   | -             | Show help            |
+| `/editor` | -             | Open external editor |
+| `/exit`   | `/quit`, `/q` | Exit the app         |
 
-    ```markdown
-    ---
-    description: Create a new React component
-    arguments:
-        - ComponentName
-    ---
+#### Kilo Gateway Commands (when connected)
 
-    Create a new React component named $1.
-    Include:
+| Command    | Aliases                  | Description                       |
+| ---------- | ------------------------ | --------------------------------- |
+| `/profile` | `/me`, `/whoami`         | View your Kilo Gateway profile    |
+| `/teams`   | `/team`, `/org`, `/orgs` | Switch between Kilo Gateway teams |
 
-    - Proper TypeScript typing
-    - Basic component structure
-    - Export statement
-    - A simple props interface if appropriate
+#### Built-in Commands
 
-    Place it in the appropriate directory based on the project structure.
-    ```
+| Command                     | Description                                  |
+| --------------------------- | -------------------------------------------- |
+| `/init`                     | Create/update AGENTS.md file for the project |
+| `/local-review`             | Review code changes                          |
+| `/local-review-uncommitted` | Review uncommitted changes                   |
 
-3. Use the command in your CLI session:
+## Local Code Reviews
 
-    ```bash
-    /component Button
-    ```
+Review your code locally before pushing — catch issues early without waiting for PR reviews. Local code reviews give you AI-powered feedback on your changes without creating a public pull request.
 
-### Frontmatter Options
+### Commands
 
-Custom commands support the following frontmatter fields:
+| Command                     | Description                                    |
+| --------------------------- | ---------------------------------------------- |
+| `/local-review`             | Review current branch changes vs base branch   |
+| `/local-review-uncommitted` | Review uncommitted changes (staged + unstaged) |
+
+## Config Reference
 
-- **`description`** (optional): Short description shown in `/help`
-- **`arguments`** (optional): List of argument names for documentation
-- **`mode`** (optional): Automatically switch to this mode when running the command
-- **`model`** (optional): Automatically switch to this model when running the command
+Configuration is managed through:
 
-### Argument Substitution
+- `/connect` command for provider setup (interactive)
+- Config files directly at `~/.config/kilo/config.json`
+- `kilo auth` for credential management
 
-Commands support powerful argument substitution:
+## Permissions
 
-- **`$ARGUMENTS`**: All arguments joined with spaces
-- **`$1`, `$2`, `$3`, etc.**: Individual positional arguments
+Kilo Code uses the permission config to decide whether a given action should run automatically, prompt you, or be blocked.
 
-**Example:**
+### Actions
 
-```markdown
----
-description: Create a file with content
-arguments:
-    - filename
-    - content
----
-
-Create a new file named $1 with the following content:
-
-$2
-```
-
-Usage: `/createfile app.ts "console.log('Hello')"`
-
-### Mode and Model Switching
-
-Commands can automatically switch modes and models:
-
-```markdown
----
-description: Run tests with coverage
-mode: code
-model: anthropic/claude-3-5-sonnet-20241022
----
-
-Run the full test suite with coverage report and show any failures.
-Focus on the failing tests and suggest fixes.
-```
+Each permission rule resolves to one of:
 
-When you run `/test`, it will automatically switch to code mode and use the specified model.
+- `"allow"` — run without approval
+- `"ask"` — prompt for approval
+- `"deny"` — block the action
 
-### Example Commands
-
-**Initialize project documentation:**
-
-```markdown
----
-description: Analyze codebase and create AGENTS.md
-mode: code
----
+### Configuration
 
-Please analyze this codebase and create an AGENTS.md file containing:
+You can set permissions globally (with `*`), and override specific tools.
 
-1. Build/lint/test commands - especially for running a single test
-2. Code style guidelines including imports, formatting, types, naming conventions
-
-Focus on project-specific, non-obvious information discovered by reading files.
-```
-
-**Refactor code:**
-
-```markdown
----
-description: Refactor code for better quality
-arguments:
-    - filepath
----
-
-Refactor $1 to improve:
-
-- Code readability
-- Performance
-- Maintainability
-- Type safety
-
-Explain the changes you make and why they improve the code.
-```
-
-### Command Priority
-
-Project-specific commands override global commands with the same name, allowing you to customize behavior per project while maintaining sensible defaults globally.
-
-## Checkpoint Management
-
-Kilo Code automatically creates checkpoints as you work, allowing you to revert to previous states in your project's history.
-
-### Viewing Checkpoints
-
-List all available checkpoints with `/checkpoint list`:
-
-```bash
-/checkpoint list
-```
-
-This displays:
-
-- Full 40-character git commit hash
-- Relative timestamp (e.g., "5 minutes ago", "2 hours ago")
-- Auto-saved checkpoints are marked with `[auto-saved]`
-
-### Restoring Checkpoints
-
-Revert to a specific checkpoint using the full git hash:
-
-```bash
-/checkpoint restore 00d185d5020969752bc9ae40823b9d6a723696e2
+```json
+{
+	"$schema": "https://kilo.ai/config.json",
+	"permission": {
+		"*": "ask",
+		"bash": "allow",
+		"edit": "deny"
+	}
+}
 ```
 
-{% callout type="danger" title="Warning" %}
-Checkpoint restoration is a **destructive action**:
+You can also set all permissions at once:
 
-- Performs a git hard reset (all uncommitted changes will be lost)
-- Removes all messages from the conversation after the checkpoint
-- Cannot be undone
-
-Make sure you've committed or backed up any work you want to keep before restoring.
-{% /callout %}
-
-**Aliases:** `/cp` can be used as a shorthand for `/checkpoint`
-
-## Task History
-
-View, search, and navigate through your task history directly from the CLI.
-
-### Viewing Task History
-
-Display your task history with `/tasks`:
-
-```bash
-/tasks
+```json
+{
+	"$schema": "https://kilo.ai/config.json",
+	"permission": "allow"
+}
 ```
 
-This shows:
-
-- Task number and description
-- Task ID (for selecting)
-- Relative timestamp
-- Cost in dollars
-- Token usage
-- Favorite indicator (⭐) for favorited tasks
-- Pagination (10 tasks per page)
-
-### Searching Tasks
+### Granular Rules (Object Syntax)
 
-Search for specific tasks by keyword:
+For most permissions, you can use an object to apply different actions based on the tool input.
 
-```bash
-/tasks search bug fix
-/tasks search implement feature
+```json
+{
+	"$schema": "https://opencode.ai/config.json",
+	"permission": {
+		"bash": {
+			"*": "ask",
+			"git *": "allow",
+			"npm *": "allow",
+			"rm *": "deny",
+			"grep *": "allow"
+		},
+		"edit": {
+			"*": "deny",
+			"packages/web/src/content/docs/*.mdx": "allow"
+		}
+	}
+}
 ```
 
-Search automatically sorts results by relevance.
-
-### Selecting a Task
+Rules are evaluated by pattern match, with the last matching rule winning. A common pattern is to put the catch-all `"*"` rule first, and more specific rules after it.
 
-Switch to a specific task using its ID:
+### Wildcards
 
-```bash
-/tasks select abc123
-```
+Permission patterns use simple wildcard matching:
 
-This loads the selected task and its full conversation history.
+- `*` matches zero or more of any character
+- `?` matches exactly one character
+- All other characters match literally
 
-### Pagination
+### Home Directory Expansion
 
-Navigate through pages of task history:
+You can use `~` or `$HOME` at the start of a pattern to reference your home directory. This is particularly useful for `external_directory` rules.
 
-```bash
-/tasks page 2      # Go to page 2
-/tasks next        # Go to next page
-/tasks prev        # Go to previous page
-```
+- `~/projects/*` → `/Users/username/projects/*`
+- `$HOME/projects/*` → `/Users/username/projects/*`
+- `~` → `/Users/username`
 
-### Sorting Tasks
+### External Directories
 
-Sort tasks by different criteria:
+Use `external_directory` to allow tool calls that touch paths outside the working directory where Kilo was started. This applies to any tool that takes a path as input (for example `read`, `edit`, `list`, `glob`, `grep`, and many bash commands).
 
-```bash
-/tasks sort newest          # Most recent first (default)
-/tasks sort oldest          # Oldest first
-/tasks sort most-expensive  # Highest cost first
-/tasks sort most-tokens     # Most tokens used first
-/tasks sort most-relevant   # Most relevant (used with search)
+```json
+{
+	"$schema": "https://kilo.ai/config.json",
+	"permission": {
+		"external_directory": {
+			"~/projects/personal/**": "allow"
+		}
+	}
+}
 ```
 
-### Filtering Tasks
+Any directory allowed here inherits the same defaults as the current workspace. Since `read` defaults to `"allow"`, reads are also allowed for entries under `external_directory` unless overridden. Add explicit rules when a tool should be restricted in these paths, such as blocking edits while keeping reads:
 
-Filter tasks by workspace or favorites:
-
-```bash
-/tasks filter current    # Show only tasks from current workspace
-/tasks filter all        # Show tasks from all workspaces
-/tasks filter favorites  # Show only favorited tasks
-/tasks filter all-tasks  # Show all tasks (remove filters)
+```json
+{
+	"$schema": "https://kilo.ai/config.json",
+	"permission": {
+		"external_directory": {
+			"~/projects/personal/**": "allow"
+		},
+		"edit": {
+			"~/projects/personal/**": "deny"
+		}
+	}
+}
 ```
 
-**Aliases:** `/t` and `/history` can be used as shorthand for `/tasks`
-
-## Config reference for providers
-
-Kilo gives you the ability to bring your own keys for a number of model providers and AI gateways, like OpenRouter and Vercel AI Gateway. Each provider has unique configuration options and some let you set environment variables.
-
-You can reference the [Provider Configuration Guide](https://github.com/Kilo-Org/kilocode/blob/main/cli/docs/PROVIDER_CONFIGURATION.md) for examples if you want to edit .config files manually. You can also run:
-
-`kilocode config`
-
-to complete configuration with an interactive workflow on the command line.
-
-{% callout type="tip" %}
-You can also use the `/config` slash command during an interactive session, which is equivalent to running `kilocode config`.
-{% /callout %}
-
-## Parallel mode
+### Available Permissions
 
-Parallel mode allows multiple Kilo Code instances to work in parallel on the same directory, without conflicts. You can spawn as many Kilo Code instances as you need! Once finished, changes will be available on a separate git branch.
+Permissions are keyed by tool name, plus a couple of safety guards:
 
-```bash
-# Prerequisite: must be within a valid git repository
-
-# In interactive mode, changes will be committed on /exit
-# Terminal 1
-kilocode --parallel "improve xyz"
-# Terminal 2
-kilocode --parallel "improve abc"
-
-# Pairs great with auto mode 🚀
-# Terminal 1
-kilocode --parallel --auto "improve xyz"
-# Terminal 2
-kilocode --parallel --auto "improve abc"
-```
+- `read` — reading a file (matches the file path)
+- `edit` — all file modifications (covers edit, write, patch, multiedit)
+- `glob` — file globbing (matches the glob pattern)
+- `grep` — content search (matches the regex pattern)
+- `list` — listing files in a directory (matches the directory path)
+- `bash` — running shell commands (matches parsed commands like `git status --porcelain`)
+- `task` — launching subagents (matches the subagent type)
+- `skill` — loading a skill (matches the skill name)
+- `lsp` — running LSP queries (currently non-granular)
+- `todoread`, `todowrite` — reading/updating the todo list
+- `webfetch` — fetching a URL (matches the URL)
+- `websearch`, `codesearch` — web/code search (matches the query)
+- `external_directory` — triggered when a tool touches paths outside the project working directory
+- `doom_loop` — triggered when the same tool call repeats 3 times with identical input
 
-## Auto-approval settings
+### Defaults
 
-Auto-approval allows the Kilo Code CLI to perform operations without first requiring user confirmation. These settings can either be built up over time in interactive mode, or by editing your config file using `kilocode config` or editing the file directly at `~/.kilocode/config.json`.
+If you don't specify anything, Kilo starts from permissive defaults:
 
-### Default auto-approval settings
+- Most permissions default to `"allow"`.
+- `doom_loop` and `external_directory` default to `"ask"`.
+- `read` is `"allow"`, but `.env` files are denied by default:
 
 ```json
 {
-	"autoApproval": {
-		"enabled": true,
+	"permission": {
 		"read": {
-			"enabled": true,
-			"outside": false
-		},
-		"write": {
-			"enabled": true,
-			"outside": false,
-			"protected": false
-		},
-		"execute": {
-			"enabled": true,
-			"allowed": ["npm", "git", "pnpm"],
-			"denied": ["rm -rf", "sudo"]
-		},
-		"browser": {
-			"enabled": false
-		},
-		"mcp": {
-			"enabled": true
-		},
-		"mode": {
-			"enabled": true
-		},
-		"subtasks": {
-			"enabled": true
-		},
-		"question": {
-			"enabled": false,
-			"timeout": 60
-		},
-		"retry": {
-			"enabled": true,
-			"delay": 10
-		},
-		"todo": {
-			"enabled": true
+			"*": "allow",
+			"*.env": "deny",
+			"*.env.*": "deny",
+			"*.env.example": "allow"
 		}
 	}
 }
 ```
 
-**Configuration Options:**
+### What "Ask" Does
 
-- `read`: Auto-approve file read operations
-    - `outside`: Allow reading files outside workspace
-- `write`: Auto-approve file write operations
-    - `outside`: Allow writing files outside workspace
-    - `protected`: Allow writing to protected files (e.g., package.json)
-- `execute`: Auto-approve command execution
-    - `allowed`: List of allowed command patterns (e.g., ["npm", "git"])
-    - `denied`: List of denied command patterns (takes precedence)
-- `browser`: Auto-approve browser operations
-- `mcp`: Auto-approve MCP tool usage
-- `mode`: Auto-approve mode switching
-- `subtasks`: Auto-approve subtask creation
-- `question`: Auto-approve follow-up questions
-- `retry`: Auto-approve API retry requests
-- `todo`: Auto-approve todo list updates
+When Kilo prompts for approval, the UI offers three outcomes:
 
-### Command Approval Patterns
+- **once** — approve just this request
+- **always** — approve future requests matching the suggested patterns (for the rest of the current session)
+- **reject** — deny the request
 
-The `execute.allowed` and `execute.denied` lists support hierarchical pattern matching:
+The set of patterns that "always" would approve is provided by the tool (for example, bash approvals typically whitelist a safe command prefix like `git status*`).
 
-- **Base command**: `"git"` matches any git command (e.g., `git status`, `git commit`, `git push`)
-- **Command + subcommand**: `"git status"` matches any git status command (e.g., `git status --short`, `git status -v`)
-- **Full command**: `"git status --short"` only matches exactly `git status --short`
+### Agent Permissions
 
-**Example:**
+You can override permissions per agent. Agent permissions are merged with the global config, and agent rules take precedence.
 
 ```json
 {
-	"execute": {
-		"enabled": true,
-		"allowed": [
-			"npm", // Allows all npm commands
-			"git status", // Allows all git status commands
-			"ls -la" // Only allows exactly "ls -la"
-		],
-		"denied": [
-			"git push --force" // Denies this specific command even if "git" is allowed
-		]
+	"$schema": "https://kilo.ai/config.json",
+	"permission": {
+		"bash": {
+			"*": "ask",
+			"git *": "allow",
+			"git commit *": "deny",
+			"git push *": "deny",
+			"grep *": "allow"
+		}
+	},
+	"agent": {
+		"build": {
+			"permission": {
+				"bash": {
+					"*": "ask",
+					"git *": "allow",
+					"git commit *": "ask",
+					"git push *": "deny",
+					"grep *": "allow"
+				}
+			}
+		}
 	}
 }
 ```
 
+You can also configure agent permissions in Markdown:
+
+```markdown
+---
+description: Code review without edits
+mode: subagent
+permission:
+    edit: deny
+    bash: ask
+    webfetch: deny
+---
+
+Only analyze code and suggest changes.
+```
+
+{% callout type="tip" %}
+Use pattern matching for commands with arguments. `"grep *"` allows `grep pattern file.txt`, while `"grep"` alone would block it. Commands like `git status` work for default behavior but require explicit permission (like `"git status *"`) when arguments are passed.
+{% /callout %}
+
 ## Interactive Mode
 
 Interactive mode is the default mode when running Kilo Code without the `--auto` flag, designed to work interactively with a user through the console.
@@ -535,7 +385,7 @@ In interactive mode Kilo Code will request approval for operations which have no
 
 ### Interactive Command Approval
 
-When running in interactive mode, command approval requests now show hierarchical options:
+When running in interactive mode, command approval requests show hierarchical options:
 
 ```
 [!] Action Required:
@@ -554,63 +404,33 @@ Selecting an "Always run" option will:
 
 This allows you to progressively build your auto-approval rules without manually editing the config file.
 
-## Autonomous mode (Non-Interactive)
+## Autonomous Mode (Non-Interactive)
 
 Autonomous mode allows Kilo Code to run in automated environments like CI/CD pipelines without requiring user interaction.
 
 ```bash
-# Run in autonomous mode with a prompt
-kilocode --auto "Implement feature X"
-
-# Run in autonomous mode with piped input
-echo "Fix the bug in app.ts" | kilocode --auto
-
-# Run in autonomous mode with timeout (in seconds)
-kilocode --auto "Run tests" --timeout 300
-
-# Run in autonomous mode with JSON output for structured parsing
-kilocode --auto --json "Implement feature X"
+# Run in autonomous mode with a message
+kilo run --auto "Implement feature X"
 ```
 
 ### Autonomous Mode Behavior
 
-When running in Autonomous mode (`--auto` flag):
+When running in autonomous mode:
 
 1. **No User Interaction**: All approval requests are handled automatically based on configuration
 2. **Auto-Approval/Rejection**: Operations are approved or rejected based on your auto-approval settings
 3. **Follow-up Questions**: Automatically responded with a message instructing the AI to make autonomous decisions
 4. **Automatic Exit**: The CLI exits automatically when the task completes or times out
 
-### JSON Output Mode
-
-Use the `--json` flag with `--auto` to get structured JSON output instead of the default terminal UI. This is useful for programmatic integration and parsing of Kilo Code responses.
-
-```bash
-# Standard autonomous mode with terminal UI
-kilocode --auto "Fix the bug"
-
-# Autonomous mode with JSON output
-kilocode --auto --json "Fix the bug"
-
-# With piped input
-echo "Implement feature X" | kilocode --auto --json
-```
-
-**Requirements:**
-
-- The `--json` flag requires `--auto` mode to be enabled
-- Output is sent to stdout as structured JSON for easy parsing
-- Ideal for CI/CD pipelines and automated workflows
-
 ### Auto-Approval in Autonomous Mode
 
 Autonomous mode respects your [auto-approval configuration](#auto-approval-settings). Operations which are not auto-approved will not be allowed.
 
 ### Autonomous Mode Follow-up Questions
 
-In Autonomous mode, when the AI asks a follow-up question, it receives this response:
+In autonomous mode, when the AI asks a follow-up question, it receives this response:
 
-> "This process is running in non-interactive Autonomous mode. The user cannot make decisions, so you should make the decision autonomously."
+> "This process is running in non-interactive autonomous mode. The user cannot make decisions, so you should make the decision autonomously."
 
 This instructs the AI to proceed without user input.
 
@@ -626,7 +446,7 @@ This instructs the AI to proceed without user input.
 # GitHub Actions example
 - name: Run Kilo Code
   run: |
-      echo "Implement the new feature" | kilocode --auto --timeout 600
+      kilo run "Implement the new feature" --auto
 ```
 
 ## Session Continuation
@@ -634,38 +454,38 @@ This instructs the AI to proceed without user input.
 Resume your last conversation from the current workspace using the `--continue` (or `-c`) flag:
 
 ```bash
-# Resume the most recent task from this workspace
-kilocode --continue
-kilocode -c
+# Resume the most recent session from this workspace
+kilo --continue
+kilo -c
 ```
 
 This feature:
 
-- Automatically finds the most recent task from the current workspace
+- Automatically finds the most recent session from the current workspace
 - Loads the full conversation history
 - Allows you to continue where you left off
-- Cannot be used with `--auto` mode or with a prompt argument
-- Exits with an error if no previous tasks are found
+- Cannot be used with autonomous mode or with a prompt argument
+- Exits with an error if no previous sessions are found
 
 **Example workflow:**
 
 ```bash
-# Start a task
-kilocode
+# Start a session
+kilo
 # > "Create a REST API"
 # ... work on the task ...
 # Exit with /exit
 
-# Later, resume the same task
-kilocode --continue
+# Later, resume the same session
+kilo --continue
 # Conversation history is restored, ready to continue
 ```
 
 **Limitations:**
 
-- Cannot be combined with `--auto` mode
+- Cannot be combined with autonomous mode
 - Cannot be used with a prompt argument
-- Only works when there's at least one previous task in the workspace
+- Only works when there's at least one previous session in the workspace
 
 ## Environment Variable Overrides
 
@@ -675,16 +495,10 @@ The CLI supports overriding config values with environment variables. The suppor
 - For `kilocode` provider: `KILOCODE_<FIELD_NAME>` (e.g., `KILOCODE_MODEL` → `kilocodeModel`)
 - For other providers: `KILO_<FIELD_NAME>` (e.g., `KILO_API_KEY` → `apiKey`)
 
-## Local Development
-
-### DevTools
-
-In order to run the CLI with devtools, add `DEV=true` to your `pnpm start` command, and then run `npx react-devtools` to show the devtools inspector.
-
 ## Switching into an Organization from the CLI
 
 Use the `/teams` command to see a list of all organizations you can switch into.
 
-Use `/teams select` and start typing the team name to switch teams.
+Use `/teams` and select a team to switch teams.
 
 The process is the same when switching into a Team or Enterprise organization.

+ 149 - 0
apps/kilocode-docs/pages/contributing/architecture/agent-observability.md

@@ -0,0 +1,149 @@
+---
+title: "Agent Observability"
+description: "Observability and monitoring for agentic coding systems"
+---
+
+# Kilo Code - Agent Observability
+
+## Problem Statement
+
+Agentic coding systems like Kilo Code operate with significant autonomy, executing multi-step tasks that involve LLM inference, tool execution, file manipulation, and external API calls. These systems mix traditional systems observability (i.e. request/response) with agentic behavior (i.e. planning, reasoning, and tool use).
+
+At the lower level, we can observe the system as a traditional API, but at the higher level, we need to observe the agent's behavior and the quality of its outputs.
+
+Some examples of customer-facing error modes:
+
+- Model API calls may be slow or fail due to rate limits, network issues, or model unavailability
+- Model API calls may produce invalid JSON or malformed responses
+- An agent may get stuck in a loop, repeatedly attempting the same failing operation
+- Sessions may degrade gradually as context windows fill up
+- The agent may complete a task technically but produce incorrect or unhelpful output
+- Users may abandon sessions out of frustration without explicit error signals
+
+All of these contribute to the overall reliability and user experience of the system.
+
+## Goals
+
+1. Detect and alert on acute incidents within minutes
+2. Surface slow-burn degradations within hours
+3. Facilitate root cause analysis when issues occur
+4. Track quality and efficiency trends over time
+5. Build a foundation for continuous improvement of the agent
+
+**Non-goals for this proposal:**
+
+- Automated remediation
+- A/B testing infrastructure
+
+## Proposed Approach
+
+Focus on the lower-level systems observability first, then build up to higher-level agentic behavior observability.
+
+## Phase 1: Systems Observability
+
+**Objective:** Establish awareness and alerting for hard failures.
+
+This phase focuses on systems metrics we can capture with minimal changes, providing immediate operational visibility.
+
+### Phase 1a: LLM observability and alerting
+
+#### Metrics to Capture
+
+Capture these metrics per LLM API call:
+
+- Provider
+- Model
+- Tool
+- Latency
+- Success / Failure
+- Error type and message (if failed)
+- Token counts
+- Source (CLI/JetBrains/VSCode/etc)
+
+#### Dashboards
+
+Common dashboards which offer filtering based on provider, model, and tool:
+
+- Error rate
+- Latency
+- Token usage
+
+#### Alerting
+
+Implement [multi-window, multi-burn-rate alerting](https://sre.google/workbook/alerting-on-slos/) against error budgets:
+
+| Window | Burn Rate | Action | Use Case           |
+| ------ | --------- | ------ | ------------------ |
+| 5 min  | 14.4x     | Page   | Major Outage       |
+| 30 min | 6x        | Page   | Incident           |
+| 6 hr   | 1x        | Ticket | Change in behavior |
+
+Paging should **only occur on Recommended Models when using the Kilo Gateway**. All other alerts should be tickets, and some may be configured to be ignored.
+
+**Initial alert conditions:**
+
+- LLM API error rate exceeds SLO (per tool/model/provider)
+- Tool error rate exceeds SLO (per tool/model/provider)
+- p50/p90 latency exceeds SLO (per tool/model/provider)
+
+### Phase 1b: Session metrics
+
+#### Metrics to Capture
+
+**Per-session (aggregated at session close or timeout):**
+
+- Session duration
+- Time from user input to first model response
+- Total turns/steps
+- Total tool calls by tool type
+- Total errors by error type
+    - Agent stuck errors (repetitive tool calls, etc)
+    - Tool call errors
+- Total tokens consumed
+- Context condensing frequency
+- Termination reason (user closed, timeout, explicit completion, error)
+
+#### Alerting
+
+None.
+
+## Phase 2: Agent Tool Usage
+
+**Objective:** Detect how agents are using tools in a given session.
+
+### Metrics to Capture
+
+**Loop and repetition detection:**
+
+- Count of identical tool calls within a session (same tool + same arguments)
+- Count of identical failing tool calls (same tool + same arguments + same error)
+- Detection of oscillation patterns (alternating between two states)
+
+**Progress indicators:**
+
+- Unique files touched per session
+- Unique tools used per session
+- Ratio of repeated to unique operations
+
+### Alerting
+
+None to start, we will learn.
+
+## Phase 3: Session Outcome Tracking
+
+**Objective:** Understand whether sessions are successful from the user's perspective.
+
+Hard errors and behavior metrics tell us about failures, but we also need signal on overall session health.
+
+### Metrics to Capture
+
+**Explicit signals:**
+
+- User feedback (thumbs up/down) rate and sentiment
+- User abandonment patterns (session ends mid-task without completion signal)
+
+**Implicit signals:**
+
+May require LLM analysis of session transcripts to detect:
+
+- Session termination classification (completed, abandoned, errored, timed out)

+ 42 - 0
apps/kilocode-docs/pages/contributing/architecture/feature-template.md

@@ -0,0 +1,42 @@
+---
+title: "Spec Template"
+description: "Template for proposing new feature designs"
+---
+
+# Template
+
+# Overview
+
+This section provides a concise description of the problem being addressed and the proposed solution.
+
+What is important for the solution to accomplish? What can be left out of scope for now? Scope projects as tightly as possible, because smaller projects let us ship faster, get feedback faster, and avoid snowballing scope creep.
+
+# Requirements
+
+This section outlines the requirements that the solution will fulfill. Be comprehensive and detailed.
+
+Find the minimum requirements that will deliver the minimal solution described in the Overview. Avoid the urge to solve all the problems at once.
+
+-
+
+### Non-requirements
+
+-
+
+# System Design
+
+This is the core of the technical specification, detailing the architectural decisions and implementation plan. If possible, include diagrams!
+
+## Scope/Implementation
+
+This section should be a bulleted list of tasks that will eventually become github issues.
+
+-
+
+# Compliance Considerations
+
+This section addresses any relevant compliance aspects, specifically regarding SOC 2.
+
+# Features for the future
+
+Talks about what we might want to build or improve upon in the future, but is out-of-scope of this spec.

+ 23 - 0
apps/kilocode-docs/pages/contributing/architecture/features.md

@@ -0,0 +1,23 @@
+---
+title: "Architecture Features"
+description: "Overview of current and planned features in Kilo Code"
+---
+
+# Architecture Features
+
+These pages document the architecture and design of current or planned features, as well as any unique development patterns.
+
+| Feature                                                                                  | Description                                      |
+| ---------------------------------------------------------------------------------------- | ------------------------------------------------ |
+| [Agent Observability](/docs/contributing/architecture/agent-observability)               | Observability and monitoring for agentic systems |
+| [Annual Billing](/docs/contributing/architecture/annual-billing)                         | Annual subscription billing                      |
+| [Enterprise MCP Controls](/docs/contributing/architecture/enterprise-mcp-controls)       | Admin controls for MCP server allowlists         |
+| [MCP OAuth Authorization](/docs/contributing/architecture/mcp-oauth-authorization)       | OAuth 2.1-based authorization for MCP servers    |
+| [Onboarding Improvements](/docs/contributing/architecture/onboarding-improvements)       | User onboarding and engagement features          |
+| [Organization Modes Library](/docs/contributing/architecture/organization-modes-library) | Shared modes for teams and enterprise            |
+| [Agentic Security Reviews](/docs/deploy-secure/security-reviews)                         | AI-powered security vulnerability analysis       |
+| [Track Repo URL](/docs/contributing/architecture/track-repo-url)                         | Usage tracking by repository/project             |
+| [Vercel AI Gateway](/docs/contributing/architecture/vercel-ai-gateway)                   | Vercel AI Gateway integration                    |
+| [Voice Transcription](/docs/contributing/architecture/voice-transcription)               | Live voice input for chat                        |
+
+To propose a new feature design, consider using the [Spec Template](/docs/contributing/architecture/feature-template).

+ 1 - 16
apps/kilocode-docs/pages/contributing/architecture/index.md

@@ -3,8 +3,6 @@ title: "Architecture Overview"
 description: "Overview of Kilo Code architecture"
 ---
 
-s
-
 # Architecture Overview
 
 This document provides a high-level overview of Kilo Code's architecture to help contributors understand how the different components fit together.
@@ -46,20 +44,7 @@ Kilo Code is a VS Code extension built with TypeScript that connects to various
 
 ### Features
 
-These pages document the architecture and design of a current or planned feature, as well as any unique development patterns.
-
-| Feature                                                                                  | Description                                |
-| ---------------------------------------------------------------------------------------- | ------------------------------------------ |
-| [Annual Billing](/docs/contributing/architecture/annual-billing)                         | Annual subscription billing                |
-| [Enterprise MCP Controls](/docs/contributing/architecture/enterprise-mcp-controls)       | Admin controls for MCP server allowlists   |
-| [Onboarding Improvements](/docs/contributing/architecture/onboarding-improvements)       | User onboarding and engagement features    |
-| [Organization Modes Library](/docs/contributing/architecture/organization-modes-library) | Shared modes for teams and enterprise      |
-| [Agentic Security Reviews](/docs/contributing/architecture/security-reviews)             | AI-powered security vulnerability analysis |
-| [Track Repo URL](/docs/contributing/architecture/track-repo-url)                         | Usage tracking by repository/project       |
-| [Vercel AI Gateway](/docs/contributing/architecture/vercel-ai-gateway)                   | Vercel AI Gateway integration              |
-| [Voice Transcription](/docs/contributing/architecture/voice-transcription)               | Live voice input for chat                  |
-
-To propose a new feature design, please create a detailed proposal using the architecture patterns shown in the above feature examples.
+For detailed documentation on current and planned features, see the [Architecture Features](/docs/contributing/architecture/features) page.
 
 ## Key Concepts
 

+ 575 - 0
apps/kilocode-docs/pages/contributing/architecture/mcp-oauth-authorization.md

@@ -0,0 +1,575 @@
+---
+title: "MCP OAuth Authorization"
+description: "OAuth 2.1-based authorization flow for MCP servers"
+---
+
+# MCP OAuth Authorization
+
+### Overview
+
+Many MCP servers require authentication to access protected resources. Currently, Kilo Code only supports static credential configuration (API keys, tokens) which must be manually entered and stored. This creates friction for users and security concerns for enterprises.
+
+The MCP specification defines an OAuth 2.1-based authorization flow that enables secure, user-friendly authentication without requiring users to manually manage credentials. This document specifies how Kilo Code will implement the MCP Authorization specification to support OAuth-enabled MCP servers.
+
+### Goals
+
+1. **Eliminate manual credential management** - Users authenticate via browser-based OAuth flows instead of copying/pasting API keys
+2. **Improve security** - Tokens are obtained through secure OAuth flows with PKCE, reducing credential exposure
+3. **Support enterprise SSO** - Organizations can use their existing identity providers
+4. **Maintain compatibility** - Continue supporting static credentials for servers that don't implement OAuth
+
+### Non-Goals (MVP)
+
+- Token refresh automation (will use re-authentication flow initially)
+- Dynamic Client Registration (will rely on Client ID Metadata Documents)
+- Multiple authorization server selection (will use first available)
+
+## MCP Authorization Specification Summary
+
+The MCP Authorization spec (Protocol Revision 2025-11-25) defines an OAuth 2.1-based flow for HTTP-based MCP transports. Key components:
+
+### Roles
+
+- **MCP Server** - Acts as OAuth 2.1 Resource Server, accepts access tokens
+- **MCP Client** (Kilo Code) - Acts as OAuth 2.1 Client, obtains tokens on behalf of users
+- **Authorization Server** - Issues access tokens (may be hosted with MCP server or separate)
+
+### Discovery Flow
+
+1. Client makes unauthenticated request to MCP server
+2. Server returns `401 Unauthorized` with `WWW-Authenticate` header containing `resource_metadata` URL
+3. Client fetches Protected Resource Metadata (RFC 9728) to discover authorization server(s)
+4. Client fetches Authorization Server Metadata (RFC 8414 or OpenID Connect Discovery)
+5. Client initiates OAuth authorization flow
+
+### Client Registration
+
+The spec supports three approaches (in priority order):
+
+1. **Pre-registration** - Client has existing credentials for the server
+2. **Client ID Metadata Documents** - Client uses HTTPS URL as client_id pointing to metadata JSON
+3. **Dynamic Client Registration** - Client registers dynamically via RFC 7591
+
+### Authorization Flow
+
+1. Generate PKCE code verifier and challenge
+2. Open browser with authorization URL including `resource` parameter (RFC 8707)
+3. User authenticates and authorizes
+4. Receive authorization code via redirect
+5. Exchange code for access token
+6. Use access token in `Authorization: Bearer` header for MCP requests
+
+## System Design
+
+### Architecture Overview
+
+```
+┌─────────────────────────────────────────────────────────────────────────────────┐
+│                           MCP OAuth Authorization Flow                           │
+├─────────────────────────────────────────────────────────────────────────────────┤
+│                                                                                  │
+│  ┌──────────────┐    1. MCP Request     ┌──────────────────┐                    │
+│  │              │ ───────────────────►  │                  │                    │
+│  │  Kilo Code   │                       │   MCP Server     │                    │
+│  │  Extension   │  ◄─────────────────── │  (Resource       │                    │
+│  │              │    2. 401 + metadata  │   Server)        │                    │
+│  └──────┬───────┘                       └──────────────────┘                    │
+│         │                                                                        │
+│         │ 3. Fetch resource metadata                                            │
+│         │ 4. Fetch auth server metadata                                         │
+│         ▼                                                                        │
+│  ┌──────────────┐                       ┌──────────────────┐                    │
+│  │   OAuth      │    5. Auth Request    │                  │                    │
+│  │   Service    │ ───────────────────►  │  Authorization   │                    │
+│  │              │                       │  Server          │                    │
+│  │  - Discovery │  ◄─────────────────── │                  │                    │
+│  │  - PKCE      │    8. Token Response  │  - User Auth     │                    │
+│  │  - Tokens    │                       │  - Consent       │                    │
+│  └──────┬───────┘                       └──────────────────┘                    │
+│         │                                        ▲                               │
+│         │ 6. Open browser                        │ 7. User authenticates        │
+│         ▼                                        │                               │
+│  ┌──────────────┐                       ┌────────┴─────────┐                    │
+│  │   Browser    │ ─────────────────────►│      User        │                    │
+│  │              │                       │                  │                    │
+│  └──────────────┘                       └──────────────────┘                    │
+│                                                                                  │
+└─────────────────────────────────────────────────────────────────────────────────┘
+```
+
+### New Components
+
+#### 1. McpOAuthService
+
+A new service responsible for managing OAuth flows for MCP servers:
+
+```typescript
+// src/services/mcp/oauth/McpOAuthService.ts
+
+interface McpOAuthService {
+	/**
+	 * Initiates OAuth flow for an MCP server that returned 401
+	 * @param serverUrl The MCP server URL
+	 * @param wwwAuthenticateHeader The WWW-Authenticate header from 401 response
+	 * @returns Promise resolving to access token
+	 */
+	initiateOAuthFlow(serverUrl: string, wwwAuthenticateHeader: string): Promise<OAuthTokens>
+
+	/**
+	 * Gets stored tokens for a server, if available and valid
+	 */
+	getStoredTokens(serverUrl: string): Promise<OAuthTokens | null>
+
+	/**
+	 * Clears stored tokens for a server (for logout/re-auth)
+	 */
+	clearTokens(serverUrl: string): Promise<void>
+
+	/**
+	 * Refreshes tokens if refresh token is available
+	 */
+	refreshTokens(serverUrl: string): Promise<OAuthTokens | null>
+}
+
+interface OAuthTokens {
+	accessToken: string
+	tokenType: string
+	expiresAt?: number
+	refreshToken?: string
+	scope?: string
+}
+```
+
+#### 2. McpAuthorizationDiscovery
+
+Handles the discovery of authorization server metadata:
+
+```typescript
+// src/services/mcp/oauth/McpAuthorizationDiscovery.ts
+
+interface McpAuthorizationDiscovery {
+	/**
+	 * Discovers authorization server from WWW-Authenticate header or well-known URIs
+	 */
+	discoverAuthorizationServer(serverUrl: string, wwwAuthenticateHeader?: string): Promise<AuthorizationServerMetadata>
+
+	/**
+	 * Fetches Protected Resource Metadata (RFC 9728)
+	 */
+	fetchResourceMetadata(metadataUrl: string): Promise<ProtectedResourceMetadata>
+
+	/**
+	 * Fetches Authorization Server Metadata (RFC 8414 / OIDC Discovery)
+	 */
+	fetchAuthServerMetadata(issuerUrl: string): Promise<AuthorizationServerMetadata>
+}
+
+interface ProtectedResourceMetadata {
+	resource: string
+	authorization_servers: string[]
+	scopes_supported?: string[]
+	// ... other RFC 9728 fields
+}
+
+interface AuthorizationServerMetadata {
+	issuer: string
+	authorization_endpoint: string
+	token_endpoint: string
+	scopes_supported?: string[]
+	response_types_supported: string[]
+	code_challenge_methods_supported?: string[]
+	client_id_metadata_document_supported?: boolean
+	registration_endpoint?: string
+	// ... other RFC 8414 fields
+}
+```
+
+#### 3. McpOAuthTokenStorage
+
+Secure storage for OAuth tokens:
+
+```typescript
+// src/services/mcp/oauth/McpOAuthTokenStorage.ts
+
+interface McpOAuthTokenStorage {
+	/**
+	 * Stores tokens securely using VS Code SecretStorage
+	 */
+	storeTokens(serverUrl: string, tokens: OAuthTokens): Promise<void>
+
+	/**
+	 * Retrieves stored tokens
+	 */
+	getTokens(serverUrl: string): Promise<OAuthTokens | null>
+
+	/**
+	 * Removes stored tokens
+	 */
+	removeTokens(serverUrl: string): Promise<void>
+
+	/**
+	 * Lists all servers with stored tokens
+	 */
+	listServers(): Promise<string[]>
+}
+```
+
+#### 4. Client ID Metadata Document Hosting
+
+For Client ID Metadata Documents, Kilo Code needs to host a metadata document. We will use static hosting on kilocode.ai:
+
+- Host at `https://kilocode.ai/.well-known/oauth-client/vscode-extension.json`
+- Simple, reliable, no runtime dependencies
+- Authorization servers can cache the document effectively
+- No attack surface from dynamic generation logic
+
+Metadata document:
+
+```json
+{
+	"client_id": "https://kilocode.ai/.well-known/oauth-client/vscode-extension.json",
+	"client_name": "Kilo Code",
+	"client_uri": "https://kilocode.ai",
+	"logo_uri": "https://kilocode.ai/logo.png",
+	"redirect_uris": ["http://127.0.0.1:0/callback", "vscode://kilocode.kilo-code/oauth/callback"],
+	"grant_types": ["authorization_code"],
+	"response_types": ["code"],
+	"token_endpoint_auth_method": "none"
+}
+```
+
+### Integration with McpHub
+
+The existing `McpHub` class needs modifications to support OAuth:
+
+```typescript
+// Modifications to McpHub.ts
+
+class McpHub {
+	private oauthService: McpOAuthService
+
+	private async connectToServer(name: string, config: ServerConfig, source: "global" | "project"): Promise<void> {
+		// ... existing connection logic ...
+
+		// For HTTP-based transports, handle OAuth
+		if (config.type === "sse" || config.type === "streamable-http") {
+			try {
+				await this.connectWithOAuth(name, config, source)
+			} catch (error) {
+				if (this.isOAuthRequired(error)) {
+					// Initiate OAuth flow
+					const tokens = await this.oauthService.initiateOAuthFlow(config.url, error.wwwAuthenticateHeader)
+					// Retry connection with token
+					await this.connectWithToken(name, config, source, tokens)
+				} else {
+					throw error
+				}
+			}
+		}
+	}
+
+	private isOAuthRequired(error: unknown): boolean {
+		// Check if error is 401 with WWW-Authenticate header
+		return error instanceof HttpError && error.status === 401 && error.headers?.["www-authenticate"]
+	}
+}
+```
+
+### Configuration Schema Updates
+
+Update the server configuration schema to support OAuth:
+
+```typescript
+// Extended server config for OAuth-enabled servers
+const OAuthServerConfigSchema = BaseConfigSchema.extend({
+	type: z.enum(["sse", "streamable-http"]),
+	url: z.string().url(),
+	headers: z.record(z.string()).optional(),
+
+	// OAuth configuration
+	oauth: z
+		.object({
+			// Override client_id if pre-registered
+			clientId: z.string().optional(),
+			clientSecret: z.string().optional(),
+
+			// Override scopes to request
+			scopes: z.array(z.string()).optional(),
+
+			// Disable OAuth for this server (use static headers instead)
+			disabled: z.boolean().optional(),
+		})
+		.optional(),
+})
+```
+
+### Browser-Based Authorization Flow
+
+The OAuth flow requires opening a browser for user authentication:
+
+```typescript
+// src/services/mcp/oauth/McpOAuthBrowserFlow.ts
+
+interface McpOAuthBrowserFlow {
+	/**
+	 * Opens browser for authorization and waits for callback
+	 */
+	authorize(params: AuthorizationParams): Promise<AuthorizationResult>
+}
+
+interface AuthorizationParams {
+	authorizationEndpoint: string
+	clientId: string
+	redirectUri: string
+	scope: string
+	state: string
+	codeChallenge: string
+	codeChallengeMethod: "S256"
+	resource: string
+}
+
+interface AuthorizationResult {
+	code: string
+	state: string
+}
+```
+
+**Redirect URI Handling:**
+
+Two approaches for receiving the OAuth callback:
+
+1. **Local HTTP Server** (Primary)
+
+    - Start temporary HTTP server on random port
+    - Use `http://127.0.0.1:{port}/callback` as redirect URI
+    - Server receives callback, extracts code, closes
+
+2. **VS Code URI Handler** (Fallback)
+    - Register `vscode://kilocode.kilo-code/oauth/callback` URI handler
+    - Works when local server isn't possible
+    - Requires VS Code to be running
+
+### Token Management
+
+#### Storage
+
+Tokens are stored using VS Code's SecretStorage API:
+
+```typescript
+// Key format: mcp-oauth-{serverUrlHash}
+const storageKey = `mcp-oauth-${hashServerUrl(serverUrl)}`
+
+// Stored value (encrypted by VS Code)
+interface StoredTokenData {
+	accessToken: string
+	refreshToken?: string
+	expiresAt?: number
+	scope?: string
+	serverUrl: string
+	issuedAt: number
+}
+```
+
+#### Token Lifecycle
+
+1. **Initial Authentication**
+
+    - User triggers connection to OAuth-enabled MCP server
+    - Server returns 401, OAuth flow initiated
+    - User authenticates in browser
+    - Tokens stored securely
+
+2. **Subsequent Connections**
+
+    - Check for stored tokens
+    - If valid, use directly
+    - If expired and refresh token available, attempt refresh
+    - If refresh fails or no refresh token, re-authenticate
+
+3. **Token Refresh** (Future Enhancement)
+    - Background refresh before expiry
+    - Automatic retry on 401 with new token
+
+### Error Handling
+
+```typescript
+// OAuth-specific errors
+class McpOAuthError extends Error {
+	constructor(
+		message: string,
+		public code: OAuthErrorCode,
+		public serverUrl: string,
+		public details?: Record<string, unknown>,
+	) {
+		super(message)
+	}
+}
+
+enum OAuthErrorCode {
+	DISCOVERY_FAILED = "discovery_failed",
+	AUTHORIZATION_FAILED = "authorization_failed",
+	TOKEN_EXCHANGE_FAILED = "token_exchange_failed",
+	TOKEN_REFRESH_FAILED = "token_refresh_failed",
+	PKCE_NOT_SUPPORTED = "pkce_not_supported",
+	USER_CANCELLED = "user_cancelled",
+	TIMEOUT = "timeout",
+}
+```
+
+### User Experience
+
+#### Connection Flow
+
+1. User adds/enables OAuth-enabled MCP server
+2. Extension detects OAuth requirement (401 response)
+3. Notification: "MCP server requires authentication. Click to sign in."
+4. User clicks -> Browser opens to authorization server
+5. User authenticates and authorizes
+6. Browser redirects back -> Extension receives token
+7. Connection completes -> Server shows as connected
+
+#### UI Indicators
+
+- **Authenticated servers**: Show lock icon with "Authenticated" status
+- **Authentication required**: Show warning icon with "Sign in required" action
+- **Authentication expired**: Show refresh icon with "Re-authenticate" action
+
+#### Settings UI
+
+Add OAuth status to MCP server settings:
+
+```
+┌─────────────────────────────────────────────────────────────┐
+│ MCP Server: github-mcp                                      │
+├─────────────────────────────────────────────────────────────┤
+│ Status: Connected                                           │
+│ Type: streamable-http                                       │
+│ URL: https://mcp.github.com                                 │
+│                                                             │
+│ Authentication                                              │
+│ - Method: OAuth 2.0                                         │
+│ - Status: Authenticated                                     │
+│ - Expires: 2024-01-15 10:30 AM                              │
+│ - [Sign Out] [Re-authenticate]                              │
+└─────────────────────────────────────────────────────────────┘
+```
+
+## Security Considerations
+
+### PKCE Requirement
+
+All OAuth flows MUST use PKCE with S256 challenge method:
+
+```typescript
+function generatePKCE(): { verifier: string; challenge: string } {
+	// Generate 32-byte random verifier
+	const verifier = base64UrlEncode(crypto.randomBytes(32))
+
+	// Create S256 challenge
+	const challenge = base64UrlEncode(crypto.createHash("sha256").update(verifier).digest())
+
+	return { verifier, challenge }
+}
+```
+
+### State Parameter
+
+Generate cryptographically random state to prevent CSRF:
+
+```typescript
+const state = base64UrlEncode(crypto.randomBytes(32))
+// Store state locally and verify on callback
+```
+
+### Token Storage Security
+
+- Use VS Code SecretStorage (encrypted, per-workspace)
+- Never log tokens
+- Clear tokens on extension uninstall
+- Support manual token revocation
+
+### Resource Parameter
+
+Always include `resource` parameter to bind tokens to specific MCP server:
+
+```typescript
+const authUrl = new URL(authorizationEndpoint)
+authUrl.searchParams.set("resource", mcpServerUrl)
+```
+
+### Redirect URI Validation
+
+- Only accept callbacks on registered redirect URIs
+- Validate state parameter matches
+- Use localhost with random port (not predictable)
+
+## Scope and Implementation Plan
+
+### Phase 1: Core OAuth Infrastructure
+
+- [ ] Create `McpOAuthService` with basic flow support
+- [ ] Implement `McpAuthorizationDiscovery` for metadata fetching
+- [ ] Implement `McpOAuthTokenStorage` using SecretStorage
+- [ ] Add PKCE generation utilities
+- [ ] Create local HTTP server for OAuth callbacks
+
+### Phase 2: McpHub Integration
+
+- [ ] Modify `McpHub.connectToServer()` to detect OAuth requirements
+- [ ] Add OAuth retry logic for 401 responses
+- [ ] Update server configuration schema for OAuth options
+- [ ] Add token injection to HTTP transports
+
+### Phase 3: Client ID Metadata Document
+
+- [ ] Host Kilo Code client metadata at kilocode.ai
+- [ ] Implement client_id URL generation
+- [ ] Add fallback to pre-registration for unsupported servers
+
+### Phase 4: User Experience
+
+- [ ] Add OAuth status indicators to MCP server UI
+- [ ] Implement "Sign in" / "Sign out" actions
+- [ ] Add authentication expiry notifications
+- [ ] Create re-authentication flow
+
+### Phase 5: Testing & Documentation
+
+- [ ] Unit tests for OAuth service components
+- [ ] Integration tests with mock OAuth server
+- [ ] End-to-end tests with real OAuth-enabled MCP servers
+- [ ] User documentation for OAuth-enabled servers
+
+## Future Enhancements
+
+- **Automatic token refresh** - Background refresh before expiry
+- **Dynamic Client Registration** - Support RFC 7591 for servers that require it
+- **Multiple authorization servers** - UI for selecting preferred auth server
+- **Enterprise SSO integration** - Support for organization identity providers
+- **Token sharing across workspaces** - Optional global token storage
+- **Offline token caching** - Support for offline scenarios with cached tokens
+
+## Appendix: MCP Authorization Spec Compliance Checklist
+
+### Required (MUST)
+
+- [ ] Use PKCE with S256 for all authorization requests
+- [ ] Include `resource` parameter in authorization and token requests
+- [ ] Support WWW-Authenticate header parsing for resource metadata discovery
+- [ ] Support well-known URI fallback for resource metadata
+- [ ] Support both OAuth 2.0 and OpenID Connect discovery endpoints
+- [ ] Use Authorization header with Bearer scheme for token transmission
+- [ ] Validate PKCE support before proceeding with authorization
+
+### Recommended (SHOULD)
+
+- [ ] Support Client ID Metadata Documents
+- [ ] Use scope from WWW-Authenticate header when provided
+- [ ] Fall back to scopes_supported when scope not in challenge
+- [ ] Implement step-up authorization for insufficient_scope errors
+
+### Optional (MAY)
+
+- [ ] Support Dynamic Client Registration (RFC 7591)
+- [ ] Support pre-registered client credentials
+- [ ] Implement token refresh flows

+ 4 - 0
apps/kilocode-docs/pages/contributing/index.md

@@ -32,9 +32,13 @@ Before diving into the code, we recommend reviewing the [Architecture Overview](
 
 - Create a new branch for each feature or bugfix
 - Use descriptive branch names (e.g., `feature/new-tool-support` or `fix/browser-action-bug`)
+- **For documentation only changes**: Use the `docs/` prefix (e.g., `docs/improve-mcp-guide`)
 
 ```bash
 git checkout -b your-branch-name
+
+# For documentation changes:
+git checkout -b docs/your-change-description
 ```
 
 ### Coding Standards

+ 11 - 0
apps/kilocode-docs/pages/customize/agents-md.md

@@ -7,6 +7,17 @@ description: "Project-level configuration with agents.md files"
 
 AGENTS.md files provide a standardized way to configure AI agent behavior across different AI coding tools. They allow you to define project-specific instructions, coding standards, and guidelines that AI agents should follow when working with your codebase.
 
+{% callout type="note" title="Memory Bank Deprecation" %}
+The Kilo Code **memory bank** feature has been deprecated in favor of AGENTS.md.
+
+**Existing memory bank rules will continue to work.**
+
+If you'd like to migrate your memory bank content to AGENTS.md:
+
+1. Examine the contents in `.kilocode/rules/memory-bank/`
+2. Move that content into your project's `AGENTS.md` file (or ask Kilo to do it for you)
+   {% /callout %}
+
 ## What is AGENTS.md?
 
 AGENTS.md is an open standard for configuring AI agent behavior in software projects. It's a simple Markdown file placed at the root of your project that contains instructions for AI coding assistants. The standard is supported by multiple AI coding tools, including Kilo Code, Cursor, and Windsurf.

+ 14 - 8
apps/kilocode-docs/pages/customize/context/codebase-indexing.md

@@ -97,16 +97,22 @@ For team or production use:
 
 ## Configuration
 
-1. Open Kilo Code settings (<Codicon name="gear" /> icon)
-2. Navigate to **Codebase Indexing** section
-3. Enable **"Enable Codebase Indexing"** using the toggle switch
-4. Configure your embedding provider:
+### Open Codebase Indexing Settings
+
+1. In the chat header, click the database icon (indexing status)
+2. The Codebase Indexing settings panel opens
+3. If you don't see the icon, open Kilo Code settings (<Codicon name="gear" />) and search for **Codebase Indexing**
+
+### Configure Settings
+
+1. Enable **"Enable Codebase Indexing"** using the toggle switch
+2. Configure your embedding provider:
     - **OpenAI**: Enter API key and select model
     - **Gemini**: Enter Google AI API key and select embedding model
     - **Ollama**: Enter base URL and select model
-5. Set Qdrant URL and optional API key
-6. Configure **Max Search Results** (default: 20, range: 1-100)
-7. Click **Save** to start initial indexing
+3. Set Qdrant URL and optional API key
+4. Configure **Max Search Results** (default: 20, range: 1-100)
+5. Click **Save** to start initial indexing
 
 ### Enable/Disable Toggle
 
@@ -148,7 +154,7 @@ The indexer automatically excludes:
 - Large files (&gt;1MB)
 - Git repositories (`.git` folders)
 - Dependencies (`node_modules`, `vendor`, etc.)
-- Files matching `.gitignore` and `.kilocodeignore` patterns
+- Files matching `.gitignore` and [`.kilocodeignore`](/docs/customize/context/kilocodeignore) patterns
 
 ### Incremental Updates
 

+ 74 - 0
apps/kilocode-docs/pages/customize/context/kilocodeignore.md

@@ -0,0 +1,74 @@
+---
+title: ".kilocodeignore"
+description: "Control which files Kilo Code can access"
+---
+
+# .kilocodeignore
+
+## Overview
+
+`.kilocodeignore` is a root-level file that tells Kilo Code which files and folders it should not access. It uses standard `.gitignore` pattern syntax, but it only affects Kilo Code's file access, not Git.
+
+If no `.kilocodeignore` file exists, Kilo Code can access all files in the workspace.
+
+## Quick Start
+
+1. Create a `.kilocodeignore` file at the root of your project.
+2. Add patterns for files or folders you want Kilo Code to avoid.
+3. Save the file. Kilo Code will pick up the changes automatically.
+
+Example:
+
+```txt
+# Secrets
+.env
+secrets/
+**/*.pem
+**/*.key
+
+# Build output
+dist/
+coverage/
+
+# Allow a specific file inside a blocked folder
+!secrets/README.md
+```
+
+## Pattern Rules
+
+`.kilocodeignore` follows the same rules as `.gitignore`:
+
+- `#` starts a comment
+- `*` and `**` match wildcards
+- Trailing `/` matches directories only
+- `!` negates a previous rule
+
+Patterns are evaluated relative to the workspace root.
+
+## What It Affects
+
+Kilo Code checks `.kilocodeignore` before accessing files in tools like:
+
+- [`read_file`](/docs/automate/tools/read-file)
+- [`write_to_file`](/docs/automate/tools/write-to-file)
+- [`apply_diff`](/docs/automate/tools/apply-diff)
+- [`delete_file`](/docs/automate/tools/delete-file)
+- [`execute_command`](/docs/automate/tools/execute-command)
+- [`list_files`](/docs/automate/tools/list-files)
+
+If a file is blocked, Kilo Code will return an "access denied" message and suggest updating your `.kilocodeignore` rules.
+
+## Visibility in Lists
+
+By default, ignored files are hidden from file lists. You can show them with a lock icon by enabling:
+
+Settings -> Context -> **Show .kilocodeignore'd files in lists and searches**
+
+## Checkpoints vs .kilocodeignore
+
+Checkpoint tracking is separate from file access rules. Files blocked by `.kilocodeignore` can still be checkpointed if they are not excluded by `.gitignore`. See the [Checkpoints](/docs/code-with-ai/features/checkpoints) documentation for details.
+
+## Troubleshooting
+
+- **Kilo can't access a file you want:** Remove or narrow the matching rule in `.kilocodeignore`.
+- **A file still appears in lists:** Check the setting that shows ignored files in lists and searches.

+ 0 - 322
apps/kilocode-docs/pages/customize/context/memory-bank.md

@@ -1,322 +0,0 @@
----
-title: "Memory Bank"
-description: "Persistent context storage for long-term projects"
----
-
-# Memory Bank
-
-## Overview
-
-{% image src="/docs/img/memory-bank/at-work.png" alt="Executing task with the memory bank" width="350" caption="Kilo Code works more efficiently with Memory Bank enabled, instantly understanding project context and technologies." /%}
-
-### The Problem: AI Memory Loss
-
-AI assistants like Kilo Code face a fundamental limitation: they reset completely between sessions. This "memory loss" means that every time you start a new conversation, you need to re-explain your project's architecture, goals, technologies, and current status. This creates a critical efficiency dilemma: AI models either make edits without proper project understanding (leading to errors and misaligned solutions), or must spend significant time and resources analyzing your entire codebase in each session (which is prohibitively expensive and slow for larger projects)
-
-Without a solution to this memory problem, AI assistants remain powerful but stateless tools that can't truly function as persistent development partners.
-
-### The Solution: Memory Bank
-
-Memory Bank is a system of structured documentation that enables Kilo Code to **better understand your project** and **maintain context across coding sessions**. It transforms your AI assistant from a stateless tool into a persistent development partner with perfect recall of your project details. Kilo Code automatically reads your Memory Bank files to rebuild its understanding of your project whenever you start a new session.
-
-When Memory Bank is active, Kilo Code begins each task with `[Memory Bank: Active]` and a brief summary of your project context, ensuring consistent understanding without repetitive explanations.
-
-## Key Benefits
-
-- **Language Agnostic**: Functions with any programming language or framework
-- **Efficient Project Understanding**: Helps Kilo Code understand the purpose and tech stack of a project
-- **Context Preservation**: Maintain project knowledge across sessions without needing to scan files in every new session
-- **Faster Startup**: Kilo Code immediately comprehends your project context when you begin a new session
-- **Self-Documenting Projects**: Create valuable documentation as a byproduct
-
-## How Memory Bank Works
-
-Memory Bank is built on Kilo Code's [Custom Rules](/docs/customize/custom-rules) feature, providing a specialized framework for project documentation. Memory Bank files are standard markdown files stored in `.kilocode/rules/memory-bank` folder within your project repository. They're not hidden or proprietary - they're regular documentation files that both you and Kilo Code can access.
-
-At the start of every task, Kilo Code reads all Memory Bank files to build a comprehensive understanding of your project. This happens automatically without requiring any action from you. Kilo Code then indicates successful Memory Bank activation with `[Memory Bank: Active]` at the beginning of its response, followed by a brief summary of its understanding of your project.
-
-Files are organized in a hierarchical structure that builds a complete picture of your project:
-
-## Core Memory Bank Files
-
-### brief.md
-
-_This file is created and maintained manually by you_
-
-- The foundation of your project
-- High-level overview of what you're building
-- Core requirements and goals
-
-Example: _"Building a React web app for inventory management with barcode scanning. The system needs to support multiple warehouses and integrate with our existing ERP system."_
-
-Note: Kilo Code will not edit this file directly but may suggest improvements if it identifies ways to enhance your project brief.
-
-### product.md
-
-- Explains why the project exists
-- Describes the problems being solved
-- Outlines how the product should work
-- User experience goals
-
-Example: _"The inventory system needs to support multiple warehouses and real-time updates. It solves the problem of inventory discrepancies by providing barcode scanning for accurate stock counts."_
-
-### context.md
-
-- The most frequently updated file
-- Contains current work focus and recent changes
-- Tracks active decisions and considerations
-- Next steps for development
-
-Example: _"Currently implementing the barcode scanner component; last session completed the API integration. Next steps include adding error handling for network failures."_
-
-### architecture.md
-
-- Documents the system architecture
-- Records key technical decisions
-- Lists design patterns in use
-- Explains component relationships
-- Critical implementation paths
-
-Example: _"Using Redux for state management with a normalized store structure. The application follows a modular architecture with separate services for API communication, state management, and UI components."_
-
-### tech.md
-
-- Lists technologies and frameworks used
-- Describes development setup
-- Notes technical constraints
-- Records dependencies and tool configurations
-- Tool usage patterns
-
-Example: _"React 18, TypeScript, Firebase, Jest for testing. Development requires Node.js 16+ and uses Vite as the build tool."_
-
-## Additional Context Files
-
-Create additional files as needed to organize:
-
-- Complex feature documentation
-- Integration specifications
-- API documentation
-- Testing strategies
-- Deployment procedures
-
-These additional files help organize more detailed information that doesn't fit neatly into the core files.
-
-### tasks.md
-
-_Optional file for documenting repetitive tasks_
-
-- Stores workflows for tasks that follow similar patterns
-- Documents which files need to be modified
-- Captures step-by-step procedures
-- Records important considerations and gotchas
-
-Example: Adding support for new AI models, implementing API endpoints, or any task that requires doing similar jobs repeatedly.
-
-## Getting Started with Memory Bank
-
-### First-Time Setup
-
-1. Create a `.kilocode/rules/memory-bank/` folder in your project
-2. Write a basic project brief in `.kilocode/rules/memory-bank/brief.md`
-3. Create a file `.kilocode/rules/memory-bank-instructions.md` with instructions for how to structure memory bank files (the initialization step below will help set this up)
-4. Switch to `Architect` mode
-5. Check if a best available AI model is selected, don't use "lightweight" models
-6. Ask Kilo Code to "initialize memory bank"
-7. Wait for Kilo Code to analyze your project and initialize the Memory Bank files
-8. Verify the content of the files to see if the project is described correctly. Update the files if necessary.
-
-### Project Brief Tips
-
-- Start simple - it can be as detailed or high-level as you like
-- Focus on what matters most to you
-- Kilo Code will help fill in gaps and ask questions
-- You can update it as your project evolves
-
-Sample prompt that delivers a reasonably good brief:
-
-```
-Provide a concise and comprehensive description of this project, highlighting its main objectives, key features, used technologies and significance. Then, write this description into a text file named appropriately to reflect the project's content, ensuring clarity and professionalism in the writing. Stay brief and short.
-```
-
-## Working with Memory Bank
-
-### Core Workflows
-
-#### Memory Bank Initialization
-
-The initialization step is critically important as it establishes the foundation for all future interactions with your project. When you request initialization with the command `initialize memory bank`, Kilo Code will:
-
-1. Perform an exhaustive analysis of your project, including:
-    - All source code files and their relationships
-    - Configuration files and build system setup
-    - Project structure and organization patterns
-    - Documentation and comments
-    - Dependencies and external integrations
-    - Testing frameworks and patterns
-2. Create comprehensive memory bank files in the `.kilocode/rules/memory-bank` folder
-3. Provide a detailed summary of what it has understood about your project
-4. Ask you to verify the accuracy of the generated files
-
-{% callout type="warning" title="Important" %}
-Take time to carefully review and correct the generated files after initialization. Any misunderstandings or missing information at this stage will affect all future interactions. A thorough initialization dramatically improves Kilo Code's effectiveness, while a rushed or incomplete initialization will permanently limit its ability to assist you effectively.
-{% /callout %}
-
-#### Memory Bank Updates
-
-Memory Bank updates occur when:
-
-1. Kilo Code discovers new project patterns
-2. After implementing significant changes
-3. When you explicitly request with `update memory bank`
-4. When context needs clarification
-
-To execute a Memory Bank update, Kilo Code will:
-
-1. Review ALL project files
-2. Document the current state
-3. Document insights and patterns
-4. Update all memory bank files as needed
-
-You can direct Kilo Code to focus on specific information sources by using commands like `update memory bank using information from @/Makefile`.
-
-#### Regular Task Execution
-
-At the beginning of every task, Kilo Code:
-
-1. Reads ALL memory bank files
-2. Includes `[Memory Bank: Active]` at the beginning of its response
-3. Provides a brief summary of its understanding of your project
-4. Proceeds with the requested task
-
-At the end of a task, Kilo Code may suggest updating the memory bank if significant changes were made, using the phrase: "Would you like me to update memory bank to reflect these changes?"
-
-#### Add Task Workflow
-
-When you complete a repetitive task that follows a similar pattern each time, you can document it for future reference. This is particularly useful for tasks like adding features that follow existing patterns
-
-To document a task, use the command `add task` or `store this as a task`. Kilo Code will:
-
-1. Create or update the `tasks.md` file in the memory bank folder
-2. Document the task using current context:
-    - Task name and description
-    - List of files that need to be modified
-    - Step-by-step workflow
-    - Important considerations
-    - Example implementation
-
-When starting a new task, Kilo Code will check if it matches any documented tasks and follow the established workflow to ensure no steps are missed.
-
-### Key Commands
-
-- `initialize memory bank` - Use when starting a new project
-- `update memory bank` - Initiates a comprehensive re-analysis of the contextual documentation for the current task. **Caution:** This is resource-intensive and not recommended for "lightweight" models due to potentially reduced effectiveness. Can be used multiple times, well combinable with specific instructions, e.g. `update memory bank using information from @/Makefile`
-- `add task` or `store this as a task` - Documents a repetitive task for future reference
-
-### Status Indicators
-
-Kilo Code uses status indicators to clearly communicate Memory Bank status:
-
-- `[Memory Bank: Active]` - Indicates Memory Bank files were successfully read and are being used
-- `[Memory Bank: Missing]` - Indicates Memory Bank files could not be found or are empty
-
-These indicators appear at the beginning of Kilo Code's responses, providing immediate confirmation of Memory Bank status.
-
-### Documentation Updates
-
-Memory Bank updates should automatically occur when:
-
-- You discover new patterns in your project
-- After implementing significant changes
-- When you explicitly request with `update memory bank`
-- When you feel context needs clarification
-
-## Context Window Management
-
-As you work with Kilo Code, your context window will eventually fill up. When you notice responses slowing down or references becoming less accurate:
-
-1. Ask Kilo Code to "update memory bank" to document the current state
-2. Start a new conversation/task
-3. Kilo Code will automatically access your Memory Bank in the new conversation
-
-This process ensures continuity across multiple sessions without losing important context.
-
-## Handling Inconsistencies
-
-If Kilo Code detects inconsistencies between memory bank files:
-
-1. It will prioritize information from `brief.md` as the source of truth
-2. Note any discrepancies to you
-3. Continue working with the most reliable information available
-
-This ensures that even with imperfect documentation, Kilo Code can still function effectively.
-
-## Frequently Asked Questions
-
-### Where are the memory bank files stored?
-
-The Memory Bank files are regular markdown files stored in your project repository, typically in a `.kilocode/rules/memory-bank/` folder. They're not hidden system files - they're designed to be part of your project documentation.
-
-### How often should I update the memory bank?
-
-Update the Memory Bank after significant milestones or changes in direction. For active development, updates every few sessions can be helpful. Use the "update memory bank" command when you want to ensure all context is preserved.
-
-### Can I edit memory bank files manually?
-
-Yes! While Kilo Code manages most of the files, you can edit any of them manually. The `brief.md` file is specifically designed to be maintained by you. Manual edits to other files will be respected by Kilo Code.
-
-### What happens if memory bank files are missing?
-
-If memory bank files are missing, Kilo Code will indicate this with `[Memory Bank: Missing]` at the beginning of its response and suggest initializing the memory bank.
-
-### Does Memory Bank work with all AI models?
-
-Memory Bank works with all AI models, but more powerful models will create more comprehensive and accurate memory bank files. Lightweight models may struggle with the resource-intensive process of analyzing and updating memory bank files.
-
-### Can I use Memory Bank with multiple projects?
-
-Yes! Each project has its own Memory Bank in its `.kilocode/rules/memory-bank/` folder. Kilo Code will automatically use the correct Memory Bank for each project.
-
-### Doesn't Memory Bank use up my context window?
-
-Yes, Memory Bank does consume some of your context window at the beginning of each session as it loads all memory bank files. However, this is a strategic tradeoff that significantly improves overall efficiency. By front-loading project context:
-
-- You eliminate repetitive explanations that would consume even more context over time
-- You reach productive outcomes with fewer back-and-forth exchanges
-- You maintain consistent understanding throughout your session
-
-Testing shows that while Memory Bank uses more tokens initially, it dramatically reduces the total number of interactions needed to achieve results. This means less time explaining and more time building.
-
-## Best Practices
-
-### Getting Started
-
-- Start with a basic project brief and let the structure evolve
-- Let Kilo Code help create the initial structure
-- Review and adjust files as needed to match your workflow
-- Verify the accuracy of generated files after initialization
-
-### Ongoing Work
-
-- Let patterns emerge naturally as you work
-- Don't force documentation updates - they should happen organically
-- Trust the process - the value compounds over time
-- Watch for context confirmation at the start of sessions
-- Use the status indicators to confirm Memory Bank is active
-
-### Documentation Flow
-
-- `brief.md` is your foundation
-- `context.md` changes most frequently
-- All files collectively maintain project intelligence
-- Update after significant milestones or changes in direction
-
-### Optimizing Memory Bank Performance
-
-- Keep memory bank files concise and focused
-- Use additional files for detailed documentation
-- Update regularly but not excessively
-- Use specific update commands when focusing on particular aspects
-
-## Remember
-
-The Memory Bank is Kilo Code's only link to previous work. Its effectiveness depends entirely on maintaining clear, accurate documentation and confirming context preservation in every interaction. When you see `[Memory Bank: Active]` at the beginning of a response, you can be confident that Kilo Code has a comprehensive understanding of your project.

+ 8 - 0
apps/kilocode-docs/pages/customize/custom-modes.md

@@ -18,6 +18,10 @@ Each mode—including custom ones—features **Sticky Models**. This means Kilo
 - **Experimentation:** Safely experiment with different prompts and configurations without affecting other modes
 - **Team Collaboration:** Share custom modes with your team to standardize workflows
 
+{% callout type="tip" %}
+**Keep custom modes on track:** Limit the types of files that they're allowed to edit using the `fileRegex` option in the `groups` configuration. This prevents modes from accidentally modifying files outside their intended scope.
+{% /callout %}
+
 {% image src="/docs/img/custom-modes/custom-modes.png" alt="Overview of custom modes interface" width="600" caption="Overview of custom modes interface" /%}
 
 _Kilo Code's interface for creating and managing custom modes._
@@ -94,6 +98,10 @@ Create a new mode called "Documentation Writer". It should only be able to read
 
 Kilo Code will guide you through the process, prompting for necessary information and creating the mode using the preferred YAML format.
 
+{% callout type="tip" %}
+**Create modes from job postings:** If there's a real world job posting for something you want a custom mode to do, try asking Code mode to `Create a custom mode based on the job posting at @[url]`. This can help you quickly create specialized modes with realistic role definitions.
+{% /callout %}
+
 ### 2. Using the Prompts Tab
 
 1. **Open Prompts Tab:** Click the <Codicon name="notebook" /> icon in the Kilo Code top menu bar

+ 1 - 3
apps/kilocode-docs/pages/customize/index.md

@@ -26,14 +26,13 @@ Configure how Kilo Code behaves and responds:
 Help Kilo understand your codebase better:
 
 - [**Codebase Indexing**](/docs/customize/context/codebase-indexing) — Build a semantic index of your code for better context awareness
-- [**Memory Bank**](/docs/customize/context/memory-bank) — Store project context, decisions, and important information
 - [**Large Projects**](/docs/customize/context/large-projects) — Best practices for working with monorepos and large codebases
 
 ## Getting Started
 
 New to customization? Here's where to start:
 
-1. **Start with Custom Instructions** — Add a simple `.kilocode/instructions.md` file to your project
+1. **Start with Custom Instructions** — Set up instructions in the [Custom Instructions](/docs/customize/custom-instructions) section to guide Kilo Code's behavior
 2. **Explore Custom Modes** — Try the built-in modes first, then create your own
 3. **Enable Codebase Indexing** — Help Kilo understand your project structure
 
@@ -42,7 +41,6 @@ New to customization? Here's where to start:
 - Keep custom instructions concise and actionable
 - Use custom modes for repetitive tasks
 - Combine rules with modes for powerful workflows
-- Regularly update your memory bank with important decisions
 
 ## Next Steps
 

+ 50 - 0
apps/kilocode-docs/pages/getting-started/byok.md

@@ -0,0 +1,50 @@
+---
+title: "Bring Your Own Key (BYOK)"
+description: "Use your own API keys with Kilo Gateway while retaining platform features"
+---
+
+# Bring Your Own Key (BYOK)
+
+Bring Your Own Key (BYOK) lets you use your own API keys when using the Kilo Gateway, while retaining Kilo platform features like Code Reviews and Cloud Agents.
+
+A user or organization may want to use BYOK to:
+
+- Utilize new models quickly, Kilo Gateway supports most new models in minutes
+- Use subscriptions with third-party AI providers, for example [Z.AI](https://z.ai/subscribe) or [Minimax](https://platform.minimax.io/subscribe/coding-plan)
+- Attribute usage against existing provider commitments or agreements
+- Use existing credits with a provider
+
+## Supported BYOK providers
+
+Kilo Gateway currently supports BYOK keys for these providers:
+
+- Anthropic
+- OpenAI
+- Google AI Studio
+- Minimax
+- Mistral AI
+- xAI
+- Z.AI
+
+## Add a BYOK key
+
+1. Log into the Kilo platform and select the account or organization you want to add the BYOK key to.
+2. Navigate to the [Bring Your Own Key (BYOK) page](https://app.kilo.ai/byok), available in the sidebar under `Account`.
+3. Click `Add Your First Key`, select the provider, and paste your API key.
+4. Save.
+
+## How Bring Your Own Key works
+
+- When you use the **Kilo Gateway** provider, Kilo checks if there's a BYOK key for the selected model's provider.
+- If a matching BYOK key exists, the request is routed using your key.
+- If the key is invalid, the request fails. It does not fall back to using Kilo's keys.
+
+## Using BYOK in the Extensions and CLI
+
+- BYOK works with the Kilo Gateway provider. Users should ensure that is set as the active [provider](/docs/ai-providers).
+- Select a model from a provider configured for BYOK, for example Claude Sonnet 4.5 if you configured BYOK for Anthropic.
+- (Optional) Validate with the provider that traffic is being served by that key.
+
+## Limitations
+
+- BYOK is not fully supported by Agent Manager. See [Agent Manager](/docs/automate/agent-manager) for details.

+ 4 - 0
apps/kilocode-docs/pages/getting-started/quickstart.md

@@ -79,3 +79,7 @@ Ready for more? Here are some next steps:
 - **[Autocomplete](/docs/code-with-ai/features/autocomplete)** — Get inline code suggestions as you type
 - **[Modes](/docs/code-with-ai/agents/using-modes)** — Explore different modes for different tasks
 - **[Git commit generation](/docs/code-with-ai/features/git-commit-generation)** — Automatically generate commit messages
+
+{% callout type="tip" %}
+**Accelerate development:** Check out multiple copies of your repository and run Kilo Code on all of them in parallel (using git to resolve any conflicts, same as with human devs). This can dramatically speed up development on large projects.
+{% /callout %}

+ 51 - 0
apps/kilocode-docs/pages/getting-started/rate-limits-and-costs.md

@@ -0,0 +1,51 @@
+# Rate Limits and Costs
+
+Understanding and managing API usage is crucial for a smooth and cost-effective experience with Kilo Code. This section explains how to track your token usage, costs, and how to configure rate limits.
+
+## Token Usage
+
+Kilo Code interacts with AI models using tokens. Tokens are essentially pieces of words. The number of tokens used in a request and response affects both the processing time and the cost.
+
+- **Input Tokens:** These are the tokens in your prompt, including the system prompt, your instructions, and any context provided (e.g., file contents).
+- **Output Tokens:** These are the tokens generated by the AI model in its response.
+
+You can see the number of input and output tokens used for each interaction in the chat history.
+
+## Cost Calculation
+
+Most AI providers charge based on the number of tokens used. Pricing varies depending on the provider and the specific model.
+
+Kilo Code automatically calculates the estimated cost of each API request based on the configured model's pricing. This cost is displayed in the chat history, next to the token usage.
+
+**Note:**
+
+- The cost calculation is an _estimate_. The actual cost may vary slightly depending on the provider's billing practices.
+- Some providers may offer free tiers or credits. Check your provider's documentation for details.
+- Some providers offer prompt caching which greatly lowers cost.
+
+## Configuring Rate Limits
+
+To prevent accidental overuse of the API and to help you manage costs, Kilo Code allows you to set a rate limit. The rate limit specifies the minimum time (in seconds) between API requests.
+
+**How to configure:**
+
+1.  Open the Kilo Code settings ({% codicon name="gear" /%} icon in the top right corner).
+2.  Go to the "Advanced Settings" section.
+3.  Find the "Rate Limit (seconds)" setting.
+4.  Enter the desired delay in seconds. A value of 0 disables rate limiting.
+
+**Example:**
+
+If you set the rate limit to 10 seconds, Kilo Code will wait at least 10 seconds after one API request completes before sending the next one.
+
+## Tips for Optimizing Token Usage
+
+- **Be Concise:** Use clear and concise language in your prompts. Avoid unnecessary words or details.
+- **Provide Only Relevant Context:** Use context mentions (`@file.ts`, `@folder/`) selectively. Only include the files that are directly relevant to the task.
+- **Break Down Tasks:** Divide large tasks into smaller, more focused sub-tasks.
+- **Use Custom Instructions:** Provide custom instructions to guide Kilo Code's behavior and reduce the need for lengthy explanations in each prompt.
+- **Choose the Right Model:** Some models are more cost-effective than others. Consider using a smaller, faster model for tasks that don't require the full power of a larger model.
+- **Use Modes:** Different modes can access different tools, for example `Architect` can't modify code, which makes it a safe choice when analyzing a complex codebase, without worrying about accidentally allowing expensive operations.
+- **Disable MCP If Not Used:** If you're not using MCP (Model Context Protocol) features, consider [disabling it in Settings > Agent Behaviour > MCP Servers](/automate/mcp/overview) to significantly reduce the size of the system prompt and save tokens.
+
+By understanding and managing your API usage, you can use Kilo Code effectively and efficiently.

+ 345 - 0
apps/kilocode-docs/pages/getting-started/settings/auto-approving-actions.md

@@ -0,0 +1,345 @@
+---
+title: "Auto-Approving Actions"
+description: "Configure automatic approval settings for Kilo Code operations"
+---
+
+# Auto-Approving Actions
+
+{% callout type="danger" %}
+**Security Warning:** Auto-approve settings bypass confirmation prompts, giving Kilo Code direct access to your system. This can result in data loss, file corruption, or worse. Command line access is particularly dangerous, as it can potentially execute harmful operations that could damage your system or compromise security. Only enable auto-approval for actions you fully trust.
+{% /callout %}
+
+Auto-approve settings speed up your workflow by eliminating repetitive confirmation prompts, but they significantly increase security risks.
+
+## Quick Start Guide
+
+1. Click the Auto-Approve Toolbar above the chat input
+2. Select which actions Kilo Code can perform without asking permission
+3. Use the master toggle (leftmost checkbox) to quickly enable/disable all permissions
+
+[![KiloCode Task Timeline](https://img.youtube.com/vi/NBccFnYDQ-k/maxresdefault.jpg)](https://youtube.com/shorts/NBccFnYDQ-k?feature=shared)
+
+## Auto-Approve Toolbar
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions.png" alt="Auto-approve toolbar collapsed state" width="800" caption="Prompt box and Auto-Approve Toolbar showing enabled permissions" /%}
+
+Click the toolbar to expand it and configure individual permissions:
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-1.png" alt="Auto-approve toolbar expanded state" width="800" caption="Expanded toolbar with all options" /%}
+
+### Available Permissions
+
+| Permission                     | What it does                                     | Risk level  |
+| ------------------------------ | ------------------------------------------------ | ----------- |
+| **Read files and directories** | Lets Kilo Code access files without asking       | Medium      |
+| **Edit files**                 | Lets Kilo Code modify files without asking       | **High**    |
+| **Execute approved commands**  | Runs whitelisted terminal commands automatically | **High**    |
+| **Use the browser**            | Allows headless browser interaction              | Medium      |
+| **Use MCP servers**            | Lets Kilo Code use configured MCP services       | Medium-High |
+| **Switch modes**               | Changes between Kilo Code modes automatically    | Low         |
+| **Create & complete subtasks** | Manages subtasks without confirmation            | Low         |
+| **Retry failed requests**      | Automatically retries failed API requests        | Low         |
+| **Answer follow-up questions** | Selects default answer for follow-up questions   | Low         |
+| **Update todo list**           | Automatically updates task progress              | Low         |
+
+## Master Toggle for Quick Control
+
+The leftmost checkbox works as a master toggle:
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-14.png" alt="Master toggle in Auto-approve toolbar" width="800" caption="Master toggle controls all auto-approve permissions at once" /%}
+
+Use the master toggle when:
+
+- Working in sensitive code (turn off)
+- Doing rapid development (turn on)
+- Switching between exploration and editing tasks
+
+## Advanced Settings Panel
+
+The settings panel provides detailed control with important security context. To access these settings:
+
+1. Click {% codicon name="gear" /%} in the top-right corner
+2. Navigate to Auto-Approve Settings
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-4.png" alt="Settings panel auto-approve options" width="800" caption="Complete settings panel view" /%}
+
+{% callout type="info" %}
+Allow Kilo Code to automatically perform operations without requiring approval. Enable these settings only if you fully trust the AI and understand the associated security risks.
+{% /callout %}
+
+### Read Operations
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-6.png" alt="Read-only operations setting" width="800" caption="Read operations settings" /%}
+
+**Setting:** "Always approve read-only operations"
+
+**Description:** When enabled, Kilo Code will automatically view directory contents and read files without requiring you to click the Approve button.
+
+**Risk level:** Medium
+
+While this setting only allows reading files (not modifying them), it could potentially expose sensitive data. Still recommended as a starting point for most users, but be mindful of what files Kilo Code can access.
+
+#### Read Outside Workspace
+
+**Setting:** "Allow reading files outside the workspace"
+
+**Description:** When enabled, Kilo Code can read files outside the current workspace directory without asking for approval.
+
+**Risk level:** Medium-High
+
+This setting extends read permissions beyond your project folder. Consider the security implications:
+
+- Kilo Code could access sensitive files in your home directory
+- Configuration files, SSH keys, or credentials could be read
+- Only enable if you trust the AI and need it to access external files
+
+**Recommendation:** Keep disabled unless you specifically need Kilo Code to read files outside your project.
+
+### Write Operations
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-7.png" alt="Write operations setting with delay slider" width="800" caption="Write operations settings with diagnostic delay slider" /%}
+
+**Setting:** "Always approve write operations"
+
+**Description:** Automatically create and edit files without requiring approval
+
+**Delay slider:** "Delay after writes to allow diagnostics to detect potential problems" (Default: 1000ms)
+
+**Risk level:** High
+
+This setting allows Kilo Code to modify your files without confirmation. The delay timer is crucial:
+
+- Higher values (2000ms+): Recommended for complex projects where diagnostics take longer
+- Default (1000ms): Suitable for most projects
+- Lower values: Use only when speed is critical and you're in a controlled environment
+- Zero: No delay for diagnostics (not recommended for critical code)
+
+#### Write Outside Workspace
+
+**Setting:** "Allow writing files outside the workspace"
+
+**Description:** When enabled, Kilo Code can create or modify files outside the current workspace directory without asking for approval.
+
+**Risk level:** Very High
+
+Use with caution and in controlled environments. It allows Kilo Code to:
+
+- Modify your shell configuration files
+- Change system configurations
+- Write to any location your user has access to
+
+**Recommendation:** Keep disabled unless absolutely necessary. Even experienced users should avoid this setting.
+
+#### Write to Protected Files
+
+**Setting:** "Allow writing to protected files"
+
+**Description:** When enabled, Kilo Code can overwrite or modify files that are normally protected by the [`.kilocodeignore`](/docs/customize/custom-rules) file.
+
+**Risk level:** Very High
+
+Protected files are intentionally shielded from modification. Enable only if you understand the consequences.
+
+### Delete Operations
+
+{% callout type="danger" %}
+**Delete Operations**
+
+**Setting:** "Always approve delete operations"
+
+**Description:** Automatically delete files and directories without requiring approval
+
+**Risk level:** Very High
+
+This setting allows Kilo Code to permanently remove files without confirmation.
+
+**Safeguards:**
+
+- Kilo Code still respects `.kilocodeignore` rules
+- Protected files cannot be deleted
+- The delete tool shows what will be removed before execution
+
+**Recommendation:** Enable only in isolated environments or when working with temporary/generated files. Always ensure you have backups, checkpoints, or version control.
+{% /callout %}
+
+### Browser Actions
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-8.png" alt="Browser actions setting" width="800" caption="Browser actions settings" /%}
+
+**Setting:** "Always approve browser actions"
+
+**Description:** Automatically perform browser actions without requiring approval
+
+**Note:** Only applies when the model supports computer use
+
+**Risk level:** Medium
+
+Allows Kilo Code to control a headless browser without confirmation. This can include:
+
+- Opening websites
+- Navigating pages
+- Interacting with web elements
+
+Consider the security implications of allowing automated browser access.
+
+### API Requests
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-9.png" alt="API requests retry setting with delay slider" width="800" caption="API request retry settings" /%}
+
+**Setting:** "Always retry failed API requests"
+
+**Description:** Automatically retry failed API requests when server returns an error response
+
+**Risk level:** Low
+
+This setting automatically retries API calls when they fail.
+
+The delay controls how long Kilo Code waits before trying again:
+
+- Longer delays are gentler on API rate limits
+- Shorter delays give faster recovery from transient errors
+
+### MCP Tools
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-10.png" alt="MCP tools setting" width="800" caption="MCP tools auto-approval settings" /%}
+
+**Setting:** "Always approve MCP tools"
+
+**Description:** Enable auto-approval of individual MCP tools in the Agent Behaviour > MCP Servers view (requires both this setting and the tool's individual 'Always allow' checkbox)
+
+**Risk level:** Medium-High (depends on configured MCP tools)
+
+This setting works in conjunction with individual tool permissions in the Agent Behaviour > MCP Servers view. Both this global setting and the tool-specific permission must be enabled for auto-approval.
+
+### Mode Switching
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-11.png" alt="Mode switching setting" width="800" caption="Mode switching settings" /%}
+
+**Setting:** "Always approve mode switching"
+
+**Description:** Automatically switch between different modes without requiring approval
+
+**Risk level:** Low
+
+Allows Kilo Code to change between different modes (Code, Architect, etc.) without asking for permission. This primarily affects the AI's behavior rather than system access.
+
+### Subtasks
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-12.png" alt="Subtasks setting" width="800" caption="Subtasks auto-approval settings" /%}
+
+**Setting:** "Always approve creation & completion of subtasks"
+
+**Description:** Allow creation and completion of subtasks without requiring approval
+
+**Risk level:** Low
+
+Enables Kilo Code to create and complete subtasks automatically. This relates to workflow organization rather than system access.
+
+### Command Execution
+
+{% image src="/docs/img/auto-approving-actions/auto-approving-actions-13.png" alt="Command execution setting with whitelist interface" width="800" caption="Command execution settings with allowlist and denylist" /%}
+
+**Setting:** "Always approve allowed execute operations"
+
+**Description:** Automatically execute allowed terminal commands without requiring approval
+
+**Risk level:** High
+
+This setting allows terminal command execution with controls. While risky, the allowlist and denylist features limit what commands can run.
+
+- Allowlist specific command prefixes (recommended)
+- Never use `*` wildcard in production or with sensitive data
+- Consider security implications of each allowed command
+- Consider including potentially dangerous common commands in the deny list
+- Always verify commands that interact with external systems
+
+#### Allowed Commands
+
+**Setting:** "Command prefixes that can be auto-executed"
+
+Add command prefixes (e.g., `git`, `npm`, `ls`) that Kilo Code can run without asking. Use `*` to allow all commands (use with caution).
+
+**Interface elements:**
+
+- Text field to enter command prefixes (e.g., 'git')
+- "Add" button to add new prefixes
+- Clickable command buttons with X to remove them
+
+#### Denied Commands
+
+**Setting:** "Command prefixes that are always blocked"
+
+Commands in this list will never run, even if `*` is in the allowed list. Use this to create exceptions for potentially dangerous commands.
+
+### Follow-Up Questions
+
+**Setting:** "Always default answer for follow-up questions"
+
+**Description:** Automatically selects the first AI-suggested answer for a follow-up question after a configurable timeout. This speeds up your workflow by letting Kilo Code proceed without manual intervention.
+
+**Visual countdown:** When enabled, a countdown timer appears on the first suggestion button in the chat interface, showing the remaining time before auto-selection. The timer displays seconds remaining (e.g., "3s") and counts down in real-time.
+
+**Timeout slider:** Use the slider to set the wait time (Range: 1-300 seconds, Default: 60s).
+
+**Override options:** You can cancel the auto-selection at any time by:
+
+- Clicking a different suggestion
+- Editing any suggestion
+- Typing your own response
+- Clicking the timer to pause it
+
+**Risk level:** Low
+
+**Use cases:**
+
+- Overnight runs where you want Kilo Code to continue working
+- Repetitive tasks where the default suggestions are usually correct
+- Testing workflows where interaction isn't critical
+
+### Update Todo List
+
+**Setting:** "Always approve todo list updates"
+
+**Description:** Automatically update the to-do list without requiring approval
+
+**Risk level:** Low
+
+This setting allows Kilo Code to automatically update task progress and todo lists during work sessions. This includes:
+
+- Marking tasks as completed
+- Adding new discovered tasks
+- Updating task status (pending, in progress, completed)
+- Reorganizing task priorities
+
+**Use cases:**
+
+- Long-running development sessions
+- Multi-step refactoring projects
+- Complex debugging workflows
+- Feature implementation with many subtasks
+
+This is particularly useful when combined with the Subtasks permission, as it allows Kilo Code to maintain a complete picture of project progress without constant approval requests.
+
+## YOLO Mode
+
+{% callout type="danger" %}
+**YOLO Mode (Risk: Maximum)**
+
+**"You Only Live Once"** mode enables _all_ auto-approve permissions at once using the master toggle. This gives Kilo Code complete autonomy to read files, write code, execute commands, and perform any operation without asking for permission.
+
+You can optionally enable an AI Safety Gatekeeper, which reviews every intended change in YOLO mode and intelligently approves or blocks actions before they execute. We suggest using a small, fast model such as OpenAI gpt-oss-safeguard-20b. When enabled, AI Safety Gatekeeper will incur additional costs, as well as additional latency.
+
+**When to use:**
+
+- Rapid prototyping in isolated environments
+- Trusted, low-stakes projects
+- When you want maximum AI autonomy
+
+**When NOT to use:**
+
+- Production code or sensitive projects
+- Working with important data
+- Any situation where mistakes could be costly
+
+This is the fastest way to work with Kilo Code, but also the riskiest. Use it only when you fully trust the AI and are prepared for the consequences.
+{% /callout %}

+ 275 - 0
apps/kilocode-docs/pages/getting-started/settings/auto-cleanup.md

@@ -0,0 +1,275 @@
+# Auto Cleanup
+
+Auto Cleanup automatically manages your task history by removing old tasks to free up disk space and improve performance. Tasks are intelligently classified and retained based on their type and age, ensuring important work is preserved while temporary or experimental tasks are cleaned up.
+
+{% callout type="warning" %}
+Task deletion is permanent and cannot be undone. Deleted tasks are completely removed from disk, including all conversation history, checkpoints, and associated files.
+{% /callout %}
+
+## Overview
+
+As you work with Kilo Code, each task creates files containing conversation history, checkpoints, and other data. Over time, this accumulates and can consume significant disk space. Auto-Cleanup solves this by:
+
+- **Automatically removing old tasks** based on configurable retention periods
+- **Preserving important tasks** by classifying them into different types
+- **Protecting favorited tasks** from deletion
+- **Managing disk usage** without manual intervention
+
+{% callout type="info" title="Key Benefits" %}
+
+- **Free up disk space**: Automatically remove old task data
+- **Improve performance**: Reduce the size of task history
+- **Flexible control**: Configure different retention periods for different task types
+- **Safety first**: Favorited tasks can be protected from deletion
+- **Manual override**: Run cleanup manually whenever needed
+  {% /callout %}
+
+## How Auto-Cleanup Works
+
+Auto-Cleanup uses an intelligent classification system to determine how long each task should be retained:
+
+### Task Classification
+
+Every task is automatically classified into one of these categories:
+
+| Task Type      | Description                               | Default Retention                        |
+| -------------- | ----------------------------------------- | ---------------------------------------- |
+| **Favorited**  | Tasks you've marked as favorites          | Never deleted (or 90 days if configured) |
+| **Completed**  | Tasks that successfully finished          | 30 days                                  |
+| **Incomplete** | Tasks that were started but not completed | 7 days                                   |
+| **Regular**    | Default classification for other tasks    | 30 days                                  |
+
+#### Understanding Task Completion
+
+A task is considered "completed" when Kilo Code uses the [`attempt_completion`](/automate/tools/attempt-completion) tool to formally mark it as finished. Tasks without this completion marker are classified as incomplete, even if you consider them done. This distinction helps clean up abandoned or experimental tasks more aggressively.
+
+### Cleanup Process
+
+When Auto-Cleanup runs, it:
+
+1. **Scans all tasks** in your task history
+2. **Classifies each task** based on its properties and completion status
+3. **Checks retention periods** to determine eligibility for deletion
+4. **Protects active tasks** currently in use
+5. **Deletes eligible tasks** and their associated files
+6. **Reports results** including disk space freed
+
+## Configuration
+
+Access Auto-Cleanup settings through the Kilo Code settings panel:
+
+1. Click the gear icon ({% codicon name="gear" /%}) in Kilo Code
+2. Navigate to the **Auto-Cleanup** section (under Checkpoints)
+
+### Enable Auto-Cleanup
+
+{% image src="/docs/img/auto-cleanup/settings.png" alt="Auto-Cleanup settings panel" width="800" caption="Auto-Cleanup settings panel" /%}
+
+Check the **"Enable automatic task cleanup"** option to activate the feature. When enabled, tasks will be automatically removed based on your retention settings.
+
+### Retention Period Settings
+
+Configure how long different types of tasks are kept before cleanup:
+
+#### Default Retention Period
+
+```
+Default: 30 days
+Minimum: 1 day
+```
+
+Sets the base retention period for regular tasks that don't fall into other categories.
+
+#### Favorited Tasks
+
+**Never delete favorited tasks** (recommended)
+
+When enabled, favorited tasks are preserved indefinitely regardless of age. This is the safest option to prevent accidental deletion of important work.
+
+If disabled, you can set a custom retention period:
+
+```
+Default: 90 days
+Minimum: 1 day
+```
+
+To favorite a task, use the star icon in the task history panel.
+
+#### Completed Tasks
+
+```
+Default: 30 days
+Minimum: 1 day
+```
+
+Tasks successfully completed via the [`attempt_completion`](/automate/tools/attempt-completion) tool are retained for this period. These tasks typically represent finished work that may still be useful for reference.
+
+#### Incomplete Tasks
+
+```
+Default: 7 days
+Minimum: 1 day
+```
+
+Tasks without completion status are retained for a shorter period. This helps clean up experimental or abandoned tasks more quickly while still giving you time to review them.
+
+### Last Cleanup Display
+
+The settings show when the last cleanup operation ran, helping you understand the cleanup schedule.
+
+### Manual Cleanup
+
+Click the **"Run Cleanup Now"** button to immediately trigger a cleanup operation using your current settings. This is useful when:
+
+- You need to free up disk space urgently
+- You've changed retention settings and want them applied immediately
+- You want to preview what would be cleaned up (check the output)
+
+## Best Practices
+
+### Recommended Retention Periods
+
+**For Individual Developers:**
+
+- Default retention: 30 days
+- Completed tasks: 30 days
+- Incomplete tasks: 7 days
+- Favorited tasks: Never delete
+
+**For Experimentation:**
+
+- Default retention: 14 days
+- Completed tasks: 14 days
+- Incomplete tasks: 3 days
+- Favorited tasks: Never delete
+
+**For Limited Disk Space:**
+
+- Default retention: 14 days
+- Completed tasks: 14 days
+- Incomplete tasks: 3 days
+- Favorited tasks: 60 days
+
+### Protecting Important Work
+
+To ensure important tasks are never deleted:
+
+1. **Mark tasks as favorites** using the star icon in task history
+2. **Enable "Never delete favorited tasks"** in settings
+3. **Review cleanup results** periodically to ensure retention periods are appropriate
+
+### Balancing Disk Space and History
+
+Consider these factors when setting retention periods:
+
+- **Available disk space**: Shorter retention if space is limited
+- **Task frequency**: More tasks = shorter retention needed
+- **Reference needs**: Keep completed tasks longer if you often refer back
+- **Experimentation**: Shorter incomplete task retention for heavy experimentation
+
+## Troubleshooting
+
+### Tasks Not Being Cleaned Up
+
+**Issue**: Old tasks remain after cleanup runs
+
+**Solutions**:
+
+1. Verify Auto-Cleanup is enabled in settings
+2. Check retention periods - they may be too long
+3. Verify tasks are older than the retention period
+4. Check if tasks are favorited (they won't be deleted if "Never delete" is enabled)
+
+### Important Task Was Deleted
+
+**Issue**: A task you needed was removed
+
+**Prevention**:
+
+1. Always favorite important tasks before they age out
+2. Set longer retention periods for task types you reference frequently
+3. Consider enabling "Never delete favorited tasks"
+4. Export or backup critical task data before it ages out
+
+{% callout type="warning" %}
+Deleted tasks cannot be recovered. Always favorite important tasks or adjust retention periods to prevent accidental deletion.
+{% /callout %}
+
+### Cleanup Using Too Much Disk I/O
+
+**Issue**: Cleanup operation impacts system performance
+
+**Solutions**:
+
+1. Check the "Operation duration" in cleanup results
+2. If slow, consider reducing retention periods to clean fewer tasks at once
+3. Run manual cleanup during non-working hours
+4. Ensure adequate system resources during cleanup
+
+### Active Task Protection
+
+Auto-Cleanup automatically protects your currently active task from deletion, even if it meets the age criteria. This ensures you never lose work in progress during a cleanup operation.
+
+## Technical Details
+
+### What Gets Deleted
+
+When a task is deleted, the following are permanently removed:
+
+- Task directory and all contents
+- Conversation history and messages
+- Checkpoints (if enabled)
+- API request logs
+- Task metadata
+- Associated temporary files
+
+### Storage Location
+
+Task data is stored in your VS Code global storage location:
+
+- **macOS**: `~/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code/`
+- **Windows**: `%APPDATA%\Code\User\globalStorage\kilocode.kilo-code\`
+- **Linux**: `~/.config/Code/User/globalStorage/kilocode.kilo-code/`
+
+## Privacy & Data Handling
+
+- **Local Operation**: All cleanup happens locally on your machine
+- **No Cloud Backup**: Deleted tasks are not backed up automatically
+- **Telemetry**: Anonymous usage statistics (tasks cleaned, disk space freed) are collected if telemetry is enabled
+- **No Content Sharing**: Task content, code, or personal information is never transmitted
+
+## Related Features
+
+- [**Checkpoints**](/code-with-ai/features/checkpoints): Version control for tasks that can be restored
+- [**Settings Management**](/getting-started/settings): Export/import settings including cleanup configuration
+- [**Task History**](/code-with-ai/agents/chat-interface): Managing and organizing your task history
+
+## Frequently Asked Questions
+
+### Does Auto-Cleanup run automatically?
+
+Yes, when enabled, Auto-Cleanup runs automatically based on the configured schedule. You can also trigger it manually using the "Run Cleanup Now" button.
+
+### Can I recover deleted tasks?
+
+No, task deletion is permanent. Always favorite important tasks or adjust retention periods to prevent accidental deletion.
+
+### Does cleanup affect my current task?
+
+No, the active task you're currently working on is automatically protected from deletion.
+
+### What happens to checkpoints when a task is deleted?
+
+All checkpoints associated with a deleted task are permanently removed along with the task data.
+
+### Can I temporarily disable cleanup?
+
+Yes, simply uncheck the "Enable automatic task cleanup" option in settings. Your configuration is preserved for when you enable it again.
+
+### Why are some old tasks not being deleted?
+
+Check if they are:
+
+1. Favorited with "Never delete favorited tasks" enabled
+2. Recently modified (even viewing a task may update its timestamp)
+3. Protected by a longer retention period based on their type

+ 18 - 3
apps/kilocode-docs/pages/getting-started/settings.md → apps/kilocode-docs/pages/getting-started/settings/index.md

@@ -7,10 +7,9 @@ description: "Configure Kilo Code settings and preferences"
 
 Kilo Code allows you to manage your configuration settings effectively through export, import, and reset options. These features are useful for backing up your setup, sharing configurations with others, or restoring default settings if needed.
 
-You can find these options at the bottom of the Kilo Code settings page, accessible via the gear icon (<i class="codicon codicon-gear"></i>) in the Kilo Code chat view.
+You can find these options at the bottom of the Kilo Code settings page, accessible via the gear icon ({% codicon name="gear" /%}) in the Kilo Code chat view.
 
-<img src="/docs/img/settings-management/settings-management.png" alt="Export, Import, and Reset buttons in Kilo Code settings" width="400" />
-*Image: Export, Import, and Reset buttons.*
+{% image src="/docs/img/settings-management/settings-management.png" alt="Export, Import, and Reset buttons in Kilo Code settings" width="800" caption="Export, Import, and Reset buttons" /%}
 
 ## Export Settings
 
@@ -93,3 +92,19 @@ When enabled, Kilo Code will remind the model about the details of its current m
 **Default:** Disabled
 
 Learn more about [Custom Modes](/docs/customize/custom-modes) and how Power Steering can improve mode behavior.
+
+### File Read Auto-Truncate Threshold
+
+This setting controls the number of lines read from a file in one batch. To manage large files and reduce context/resource usage, adjust the `File read auto-truncate threshold` setting.
+
+**When to adjust:**
+
+- Working with very large files that consume too much context
+- Need to improve performance when reading large files
+- Want to reduce token usage for file operations
+
+**Trade-off:** Lower values can improve performance when working with very large files, but may require more read operations to access the full file content.
+
+**Default:** Set in Advanced Settings
+
+You can find this setting in the Kilo Code settings under 'Advanced Settings'.

+ 253 - 0
apps/kilocode-docs/pages/getting-started/settings/system-notifications.md

@@ -0,0 +1,253 @@
+---
+title: "System Notifications"
+description: "Configure native OS notifications for Kilo Code"
+---
+
+# System Notifications
+
+System notifications are native operating system notifications that appear in your system's notification center or tray. Unlike VSCode's built-in notifications that only appear within the editor, system notifications are visible even when:
+
+- VSCode is minimized or in the background
+- You're working in other applications
+- Your screen is locked (depending on OS settings)
+- You're away from your computer
+
+Kilo Code uses system notifications to inform you about:
+
+- Task completion status
+- Important errors or warnings
+- Long-running operation updates
+- Critical system events
+
+## Supported Operating Systems
+
+Kilo Code's system notifications work on all major operating systems with different underlying technologies:
+
+| Operating System | Technology                      | Requirements                                 |
+| ---------------- | ------------------------------- | -------------------------------------------- |
+| **macOS**        | AppleScript + terminal-notifier | Built-in support, optional enhanced features |
+| **Windows**      | PowerShell + Windows Runtime    | PowerShell execution policy configuration    |
+| **Linux**        | notify-send                     | libnotify package installation               |
+
+## Platform-Specific Setup
+
+### macOS Setup
+
+macOS has the best built-in support for system notifications with two available methods:
+
+#### Method 1: Built-in AppleScript (Fallback)
+
+No additional setup required. Kilo Code uses macOS's built-in command to display notifications.
+
+#### Method 2: Enhanced with terminal-notifier (Recommended)
+
+For enhanced notifications with custom icons, install terminal-notifier:
+
+```bash
+# Install via Homebrew
+brew install terminal-notifier
+
+# Or install via npm
+npm install -g terminal-notifier
+```
+
+**How it works:** Kilo Code first attempts to use `terminal-notifier` and automatically falls back to AppleScript if it's not installed.
+
+### Windows Setup
+
+Windows notifications require PowerShell execution policy configuration to work properly.
+
+#### Step 1: Configure PowerShell Execution Policy
+
+Open PowerShell as Administrator and run:
+
+```powershell
+# Check current execution policy
+Get-ExecutionPolicy
+
+# Set execution policy to allow local scripts
+Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
+```
+
+#### Step 2: Verify Windows Runtime Access
+
+Windows notifications use the `Windows.UI.Notifications` API through PowerShell. This is available on:
+
+- ✅ Windows 10 (all versions)
+- ✅ Windows 11 (all versions)
+- ✅ Windows Server 2016 and later
+- ❌ Windows 8.1 and earlier (limited support)
+
+#### Execution Policy Options
+
+| Policy         | Description                                | Security Level | Recommended             |
+| -------------- | ------------------------------------------ | -------------- | ----------------------- |
+| `Restricted`   | No scripts allowed (default)               | Highest        | ❌ Blocks notifications |
+| `RemoteSigned` | Local scripts run, downloaded need signing | High           | ✅ **Recommended**      |
+| `Unrestricted` | All scripts run with warnings              | Medium         | ⚠️ Use with caution     |
+| `AllSigned`    | All scripts must be signed                 | Highest        | ❌ Too restrictive      |
+
+### Linux Setup
+
+Linux notifications require the `libnotify` package and `notify-send` command.
+
+#### Ubuntu/Debian Installation
+
+```bash
+# Install libnotify
+sudo apt update
+sudo apt install libnotify-bin
+
+# Verify installation
+which notify-send
+```
+
+#### Red Hat/CentOS/Fedora Installation
+
+```bash
+# RHEL/CentOS
+sudo yum install libnotify
+
+# Fedora
+sudo dnf install libnotify
+
+# Verify installation
+which notify-send
+```
+
+#### Arch Linux Installation
+
+```bash
+# Install libnotify
+sudo pacman -S libnotify
+
+# Verify installation
+which notify-send
+```
+
+#### Desktop Environment Requirements
+
+System notifications work best with these desktop environments:
+
+| Desktop Environment | Support Level   | Notes                                     |
+| ------------------- | --------------- | ----------------------------------------- |
+| **GNOME**           | ✅ Full support | Native notification center                |
+| **KDE Plasma**      | ✅ Full support | Native notification system                |
+| **XFCE**            | ✅ Good support | Requires notification daemon              |
+| **Unity**           | ✅ Full support | Ubuntu's notification system              |
+| **i3/Sway**         | ⚠️ Limited      | Requires manual notification daemon setup |
+| **Headless**        | ❌ No support   | No display server available               |
+
+#### Notification Daemon Setup (Advanced)
+
+For minimal window managers, you may need to start a notification daemon:
+
+```bash
+# Install and start dunst (lightweight notification daemon)
+sudo apt install dunst  # Ubuntu/Debian
+sudo pacman -S dunst    # Arch Linux
+
+# Start dunst manually
+dunst &
+
+# Or add to your window manager startup script
+echo "dunst &" >> ~/.xinitrc
+```
+
+## Verifying System Notifications
+
+### Test Commands by Platform
+
+#### macOS Test
+
+```bash
+# Test AppleScript method
+osascript -e 'display notification "Test message" with title "Test Title" sound name "Tink"'
+
+# Test terminal-notifier (if installed)
+terminal-notifier -message "Test message" -title "Test Title" -sound Tink
+```
+
+#### Windows Test
+
+```powershell
+# Test PowerShell notification
+$template = @"
+<toast>
+    <visual>
+        <binding template="ToastText02">
+            <text id="1">Test Title</text>
+            <text id="2">Test message</text>
+        </binding>
+    </visual>
+</toast>
+"@
+
+[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
+[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
+$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
+$xml.LoadXml($template)
+$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)
+[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Test App").Show($toast)
+```
+
+#### Linux Test
+
+```bash
+# Test notify-send
+notify-send "Test Title" "Test message"
+
+# Test with icon (optional)
+notify-send -i dialog-information "Test Title" "Test message"
+```
+
+## Troubleshooting
+
+### Common Issues and Solutions
+
+#### macOS Issues
+
+**Problem:** Notifications not appearing
+
+- **Solution 1:** Check System Preferences → Notifications → Terminal (or VSCode) → Allow notifications
+- **Solution 2:** Verify Do Not Disturb is disabled
+- **Solution 3:** Test with the manual commands above
+- **Solution 4:** Ensure terminal-notifier is properly installed: `brew install terminal-notifier`
+
+#### Windows Issues
+
+**Problem:** "Execution of scripts is disabled" error
+
+- **Solution:** Configure PowerShell execution policy as described in setup
+- **Command:** `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`
+
+**Problem:** Notifications not appearing in Windows 11
+
+- **Solution 1:** Check Settings → System → Notifications → Allow notifications
+- **Solution 2:** Ensure Focus Assist is not blocking notifications
+- **Solution 3:** Verify Windows notification service is running
+
+**Problem:** PowerShell script errors
+
+- **Solution:** Update PowerShell to version 5.1 or later
+- **Check version:** `$PSVersionTable.PSVersion`
+
+#### Linux Issues
+
+**Problem:** `notify-send: command not found`
+
+- **Solution:** Install libnotify package for your distribution
+- **Ubuntu/Debian:** `sudo apt install libnotify-bin`
+- **RHEL/CentOS:** `sudo yum install libnotify`
+- **Arch:** `sudo pacman -S libnotify`
+
+**Problem:** Notifications not appearing in minimal window managers
+
+- **Solution:** Install and configure a notification daemon like dunst
+- **Install:** `sudo apt install dunst` (Ubuntu/Debian)
+- **Start:** `dunst &`
+
+**Problem:** Permission denied errors
+
+- **Solution:** Ensure your user has access to the display server
+- **Check:** `echo $DISPLAY` should return something like `:0`

+ 104 - 0
apps/kilocode-docs/pages/getting-started/using-kilo-for-free.md

@@ -0,0 +1,104 @@
+---
+title: "Using Kilo for Free"
+description: "Learn how to use Kilo Code without spending money by configuring free models for agentic tasks, autocomplete, and CLI background tasks"
+---
+
+# Using Kilo for Free
+
+Kilo Code can be used completely free of charge, but you need to understand where Kilo uses AI models and configure each one appropriately.
+
+## When Kilo Uses Model Inference
+
+Kilo uses AI model inference in three places:
+
+1. **Agentic interactions** - Coding assistant conversations in IDE extensions (VS Code, JetBrains), CLI, and cloud services like App Builder and Code Reviewer
+2. **Autocomplete** - In-editor code completions as you type (IDE extensions only)
+3. **CLI Background tasks** - Automatic session titles and context summarization (CLI only)
+
+Each of these can consume credits by default. **For a completely free Kilo experience, you must configure all three to use free models.**
+
+## Free Agentic Usage
+
+Kilo Code provides access to [free models](/docs/code-with-ai/agents/free-and-budget-models) for your coding tasks through the Kilo Gateway and partner providers.
+
+### Finding Free Models
+
+Free models are clearly labeled in the model picker across all Kilo platforms. To find and use them:
+
+**In the IDE Extensions (VS Code, JetBrains):**
+
+1. Click on the current model below the chat window
+2. Browse the model list—free models are labeled as "(free)"
+3. Select your preferred free model
+
+**In the CLI:**
+
+1. Open the CLI by running `kilo`
+2. Use the `/models` command to browse available models
+3. Free models are labeled as "free"
+4. Select a free model for your tasks
+
+### Free Models for Cloud Tasks
+
+Kilo's cloud services—including App Builder, Code Reviewer, and other cloud-based features—also support free models. When configuring a cloud task:
+
+1. Look for the model selection dropdown
+2. Free models are labeled as "(free)" in the dropdown
+3. Select any free model to avoid using credits
+
+{% callout type="tip" %}
+The available free models change over time as Kilo partners with different AI inference providers. Check our [free and budget models guide](/docs/code-with-ai/agents/free-and-budget-models) for the latest options, and subscribe to our blog or join our Discord for updates.
+{% /callout %}
+
+## Free Autocomplete
+
+Kilo Code's autocomplete feature provides AI-powered code completions as you type in the IDE extensions.
+
+### Default Behavior
+
+By default, autocomplete is routed through the Kilo Code provider and uses credits from your account.
+
+### If You Don't Have Credits
+
+If you run out of credits and haven't configured a free alternative, autocomplete will stop working. Your main coding workflow won't be affected -- you just won't get AI-powered completions.
+
+### How to Get It Free
+
+Configure Mistral directly as your autocomplete provider. Mistral offers free access to their Codestral model, which is optimized for code completions. When you configure Mistral directly, it takes precedence over the default Kilo Code routing.
+
+For step-by-step instructions with screenshots, see our [Mistral Setup Guide](/docs/code-with-ai/features/autocomplete/mistral-setup).
+
+## Free CLI Background Tasks
+
+The Kilo CLI uses AI in the background for quality-of-life features that enhance your experience like context compression and titling sessions.
+
+### Default Behavior
+
+By default, CLI background tasks use `gpt-5-nano`, which consumes credits.
+
+### If You Don't Have Credits
+
+Background tasks degrade gracefully when you don't have credits:
+
+- **Session titles** fall back to truncating your first message instead of generating a smart summary
+- **Context management** uses simple truncation instead of intelligent summarization
+- **Your main workflow continues uninterrupted** - these are convenience features, not requirements
+
+### How to Get It Free
+
+Configure the `small_model` parameter in `~/.kilocode/config.json` to use a free model:
+
+```json
+{
+	"small_model": "your-preferred-free-model"
+}
+```
+
+Replace `your-preferred-free-model` with any free model available in the model picker.
+
+## Related Resources
+
+- [Free and Budget Models](/docs/code-with-ai/agents/free-and-budget-models) - Complete guide to free and budget-friendly model options
+- [Mistral Setup Guide](/docs/code-with-ai/features/autocomplete/mistral-setup) - Step-by-step free autocomplete setup
+- [Autocomplete](/docs/code-with-ai/features/autocomplete) - Full autocomplete documentation
+- [CLI Documentation](/docs/code-with-ai/platforms/cli) - Complete CLI reference

+ 1 - 1
apps/kilocode-docs/pages/index.tsx

@@ -307,7 +307,7 @@ export default function HomePage() {
 						<span className="footer-icon">💬</span>
 						<div>
 							<strong>Need help?</strong>
-							<Link href="https://discord.gg/kilocode" className="footer-link">
+							<Link href="https://kilo.ai/discord" className="footer-link">
 								Join our Discord
 							</Link>
 						</div>

+ 41 - 10
apps/kilocode-docs/previous-docs-redirects.js

@@ -1,7 +1,31 @@
 module.exports = [
+	{
+		source: "/docs/features/system-notifications",
+		destination: "/docs/getting-started/settings/system-notifications",
+		basePath: false,
+		permanent: true,
+	},
+	{
+		source: "/docs/features/auto-approving-actions",
+		destination: "/docs/getting-started/settings/auto-approving-actions",
+		basePath: false,
+		permanent: true,
+	},
+	{
+		source: "/docs/features/suggested-responses",
+		destination: "/docs/code-with-ai/agents/chat-interface#suggested-responses",
+		basePath: false,
+		permanent: true,
+	},
 	// ============================================
 	// GET STARTED
 	// ============================================
+	{
+		source: "/docs/basic-usage/byok",
+		destination: "/docs/getting-started/byok",
+		basePath: false,
+		permanent: true,
+	},
 	{
 		source: "/docs/getting-started/setting-up",
 		destination: "/docs/getting-started/setup-authentication",
@@ -192,12 +216,6 @@ module.exports = [
 		basePath: false,
 		permanent: true,
 	},
-	{
-		source: "/docs/advanced-usage/memory-bank",
-		destination: "/docs/customize/context/memory-bank",
-		basePath: false,
-		permanent: true,
-	},
 	{
 		source: "/docs/advanced-usage/large-projects",
 		destination: "/docs/customize/context/large-projects",
@@ -212,14 +230,27 @@ module.exports = [
 		permanent: true,
 	},
 	{
-		source: "/docs/code-with-ai/context/memory-bank",
-		destination: "/docs/customize/context/memory-bank",
+		source: "/docs/code-with-ai/context/large-projects",
+		destination: "/docs/customize/context/large-projects",
 		basePath: false,
 		permanent: true,
 	},
+	// Removed memory bank page redirects to Agents.md
 	{
-		source: "/docs/code-with-ai/context/large-projects",
-		destination: "/docs/customize/context/large-projects",
+		source: "/docs/advanced-usage/memory-bank",
+		destination: "/docs/customize/agents-md",
+		basePath: false,
+		permanent: true,
+	},
+	{
+		source: "/docs/customize/context/memory-bank",
+		destination: "/docs/customize/agents-md",
+		basePath: false,
+		permanent: true,
+	},
+	{
+		source: "/docs/code-with-ai/context/memory-bank",
+		destination: "/docs/customize/agents-md",
 		basePath: false,
 		permanent: true,
 	},

BIN
apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-1.png


BIN
apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-13.png


BIN
apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-14.png


BIN
apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-4.png


BIN
apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions-9.png


BIN
apps/kilocode-docs/public/img/auto-approving-actions/auto-approving-actions.png


BIN
apps/kilocode-docs/public/img/auto-cleanup/settings.png


BIN
apps/kilocode-docs/public/img/browser-use/browser-use.png


BIN
apps/kilocode-docs/public/img/checkpoints/checkpoints.png


BIN
apps/kilocode-docs/public/img/context-mentions/context-mentions-6.png


BIN
apps/kilocode-docs/public/img/custom-instructions/custom-instructions.png


BIN
apps/kilocode-docs/public/img/fast-edits/fast-edits-5.png


BIN
apps/kilocode-docs/public/img/git-commit-generation/git-commit-1.png


BIN
apps/kilocode-docs/public/img/git-commit-generation/git-commit-2.png


BIN
apps/kilocode-docs/public/img/memory-bank/at-work.png


BIN
apps/kilocode-docs/public/img/move-to-secondary.png


BIN
apps/kilocode-docs/public/img/suggested-responses/suggested-responses-1.png


BIN
apps/kilocode-docs/public/img/suggested-responses/suggested-responses.png


BIN
apps/kilocode-docs/public/img/the-chat-interface/the-chat-interface-1.png


+ 2 - 2
apps/web-roo-code/src/app/pricing/page.tsx

@@ -239,8 +239,8 @@ export default function PricingPage() {
 							<div className="text-sm text-muted-foreground">
 								<p className="">
 									On any plan, you can use your own LLM provider API key or use the built-in Roo Code
-									Router – curated models to work with Roo with no markup, including the
-									latest Gemini, GPT and Claude. Paid with credits.
+									Router – curated models to work with Roo with no markup, including the latest
+									Gemini, GPT and Claude. Paid with credits.
 									<Link href="/provider" className="underline hover:no-underline ml-1">
 										See per model pricing.
 									</Link>

+ 2 - 2
cli/src/commands/checkpoint.ts

@@ -222,8 +222,8 @@ function getCheckpointsPath(): string {
 }
 
 /**
-	* Handle /checkpoint disable
-	*/
+ * Handle /checkpoint disable
+ */
 async function handleDisable(context: CommandContext): Promise<void> {
 	const { addMessage, sendWebviewMessage } = context
 

+ 1 - 1
cli/src/constants/providers/models.ts

@@ -77,7 +77,7 @@ export interface ModelInfo {
 	supportsComputerUse?: boolean
 	supportsPromptCache: boolean
 	promptCacheRetention?: "in_memory" | "24h"
-	supportsVerbosity?: boolean
+	supportsVerbosity?: boolean | ("low" | "medium" | "high" | "max")[] // kilocode_change
 	supportsReasoningBudget?: boolean
 	supportsReasoningBinary?: boolean
 	supportsTemperature?: boolean

+ 24 - 4
cli/src/services/__tests__/autocomplete.detectInputState.test.ts

@@ -67,8 +67,18 @@ describe("detectInputState", () => {
 						{
 							condition: (context) => context.getArgument("subcommand") === "select",
 							provider: async () => [
-								{ value: "personal", description: "Personal account", matchScore: 1, highlightedValue: "personal" },
-								{ value: "kilo-code", description: "Kilo Code team", matchScore: 1, highlightedValue: "kilo-code" },
+								{
+									value: "personal",
+									description: "Personal account",
+									matchScore: 1,
+									highlightedValue: "personal",
+								},
+								{
+									value: "kilo-code",
+									description: "Kilo Code team",
+									matchScore: 1,
+									highlightedValue: "kilo-code",
+								},
 							],
 						},
 					],
@@ -108,7 +118,12 @@ describe("detectInputState", () => {
 							},
 							provider: async () => [
 								{ value: "gpt-4", description: "GPT-4", matchScore: 1, highlightedValue: "gpt-4" },
-								{ value: "claude-sonnet", description: "Claude Sonnet", matchScore: 1, highlightedValue: "claude-sonnet" },
+								{
+									value: "claude-sonnet",
+									description: "Claude Sonnet",
+									matchScore: 1,
+									highlightedValue: "claude-sonnet",
+								},
 							],
 						},
 					],
@@ -132,7 +147,12 @@ describe("detectInputState", () => {
 					required: true,
 					provider: async () => [
 						{ value: "code", description: "Code mode", matchScore: 1, highlightedValue: "code" },
-						{ value: "architect", description: "Architect mode", matchScore: 1, highlightedValue: "architect" },
+						{
+							value: "architect",
+							description: "Architect mode",
+							matchScore: 1,
+							highlightedValue: "architect",
+						},
 					],
 				},
 			],

+ 0 - 1
cli/src/state/hooks/__tests__/useSessionCost.test.ts

@@ -125,7 +125,6 @@ describe("useSessionCost", () => {
 			expect(result.hasCostData).toBe(true)
 		})
 
-
 		it("should handle messages with empty text", () => {
 			const messages: ExtensionChatMessage[] = [
 				{

+ 3 - 1
package.json

@@ -85,7 +85,9 @@
 			"@types/react-dom": "^18.3.5",
 			"qs": "^6.14.1",
 			"body-parser": "^2.2.2",
-			"preact": "^10.28.2"
+			"preact": "^10.28.2",
+			"zod": "3.25.76",
+			"@sap-ai-sdk/prompt-registry>zod": "^4.0.0"
 		}
 	}
 }

+ 3 - 0
packages/core-schemas/src/agent-manager/types.ts

@@ -47,6 +47,7 @@ export const agentSessionSchema = z.object({
 	gitUrl: z.string().optional(),
 	model: z.string().optional(), // Model ID used for this session
 	mode: z.string().optional(), // Mode slug used for this session (e.g., "code", "architect")
+	yoloMode: z.boolean().optional(), // True if session was started with auto-approval enabled
 })
 
 /**
@@ -58,6 +59,7 @@ export const pendingSessionSchema = z.object({
 	startTime: z.number(),
 	parallelMode: z.boolean().optional(),
 	gitUrl: z.string().optional(),
+	yoloMode: z.boolean().optional(), // True if session will be started with auto-approval enabled
 })
 
 /**
@@ -84,6 +86,7 @@ export const startSessionMessageSchema = z.object({
 	versions: z.number().optional(), // Number of versions for multi-version mode
 	labels: z.array(z.string()).optional(), // Labels for multi-version sessions
 	images: z.array(z.string()).optional(), // Image data URLs to include with the prompt
+	yoloMode: z.boolean().optional(), // True to enable auto-approval (default: true)
 })
 
 export const agentManagerMessageSchema = z.discriminatedUnion("type", [

+ 1 - 1
packages/types/package.json

@@ -23,7 +23,7 @@
 		"clean": "rimraf dist .turbo"
 	},
 	"dependencies": {
-		"zod": "^3.25.61"
+		"zod": "3.25.76"
 	},
 	"devDependencies": {
 		"@roo-code/config-eslint": "workspace:^",

+ 1 - 0
packages/types/src/global-settings.ts

@@ -241,6 +241,7 @@ export const globalSettingsSchema = z.object({
 	enterBehavior: z.enum(["send", "newline"]).optional(),
 	profileThresholds: z.record(z.string(), z.number()).optional(),
 	hasOpenedModeSelector: z.boolean().optional(),
+	hasCompletedOnboarding: z.boolean().optional(), // kilocode_change: Track if user has completed onboarding flow
 	lastModeExportPath: z.string().optional(),
 	lastModeImportPath: z.string().optional(),
 	appendSystemPrompt: z.string().optional(), // kilocode_change: Custom text to append to system prompt (CLI only)

+ 1 - 1
packages/types/src/kilocode/kiloLanguages.ts

@@ -1 +1 @@
-export const kiloLanguages = ["ar", "cs", "th", "uk"] as const
+export const kiloLanguages = ["ar", "cs", "sk", "th", "uk"] as const

+ 3 - 2
packages/types/src/model.ts

@@ -39,7 +39,7 @@ export const reasoningEffortSettingSchema = z.enum(reasoningEffortSettingValues)
  * Verbosity
  */
 
-export const verbosityLevels = ["low", "medium", "high"] as const
+export const verbosityLevels = ["low", "medium", "high", "max"] as const // kilocode_change
 
 export const verbosityLevelsSchema = z.enum(verbosityLevels)
 
@@ -81,8 +81,9 @@ export const modelInfoSchema = z.object({
 	// or set to "in_memory", the default in‑memory cache is used.
 	promptCacheRetention: z.enum(["in_memory", "24h"]).optional(),
 	// Capability flag to indicate whether the model supports an output verbosity parameter
-	supportsVerbosity: z.boolean().optional(),
+	supportsVerbosity: z.union([z.boolean(), z.array(z.enum(verbosityLevels))]).optional(), // kilocode_change
 	supportsReasoningBudget: z.boolean().optional(),
+	supportsAdaptiveThinking: z.boolean().optional(), // kilocode_change
 	// Capability flag to indicate whether the model supports simple on/off binary reasoning
 	supportsReasoningBinary: z.boolean().optional(),
 	// Capability flag to indicate whether the model supports temperature parameter

+ 16 - 0
packages/types/src/providers/anthropic.ts

@@ -6,6 +6,22 @@ export type AnthropicModelId = keyof typeof anthropicModels
 export const anthropicDefaultModelId: AnthropicModelId = "claude-sonnet-4-5"
 
 export const anthropicModels = {
+	// kilocode_change start
+	"claude-opus-4-6": {
+		maxTokens: 128_000,
+		contextWindow: 200_000,
+		supportsImages: true,
+		supportsPromptCache: true,
+		supportsNativeTools: true,
+		defaultToolProtocol: "native",
+		inputPrice: 5.0,
+		outputPrice: 25.0,
+		cacheWritesPrice: 6.25,
+		cacheReadsPrice: 0.5,
+		supportsAdaptiveThinking: true,
+		supportsVerbosity: ["low", "medium", "high", "max"],
+	},
+	// kilocode_change end
 	"claude-sonnet-4-5": {
 		maxTokens: 64_000, // Overridden to 8k if `enableReasoningEffort` is false.
 		contextWindow: 200_000, // Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'

+ 10 - 0
packages/types/src/providers/mistral.ts

@@ -46,6 +46,16 @@ export const mistralModels = {
 		inputPrice: 0.3,
 		outputPrice: 0.9,
 	},
+	"devstral-2512": {
+		maxTokens: 8192,
+		contextWindow: 256_000,
+		supportsImages: true,
+		supportsPromptCache: false,
+		supportsNativeTools: true,
+		defaultToolProtocol: "native",
+		inputPrice: 0.4,
+		outputPrice: 2.0,
+	},
 	"mistral-large-latest": {
 		maxTokens: 8192,
 		contextWindow: 131_000,

+ 13 - 20
packages/types/src/providers/moonshot.ts

@@ -6,26 +6,6 @@ export type MoonshotModelId = keyof typeof moonshotModels
 export const moonshotDefaultModelId: MoonshotModelId = "kimi-k2-thinking"
 
 export const moonshotModels = {
-	// kilocode_change start
-	"kimi-k2.5": {
-		maxTokens: 32_000,
-		contextWindow: 262_144, // 256K
-		supportsImages: true, // Native multimodal
-		supportsPromptCache: true,
-		supportsNativeTools: true,
-		defaultToolProtocol: "native",
-		supportsTemperature: false, // Based on API specs
-		defaultTemperature: 1.0, // Default for thinking mode
-		supportsReasoningBudget: true,
-		supportsReasoningEffort: true,
-		preserveReasoning: true,
-		inputPrice: 0.6, // $0.60 per million (cache miss)
-		outputPrice: 3.0, // $3.00 per million
-		cacheWritesPrice: 0,
-		cacheReadsPrice: 0.1, // $0.10 per million (cache hit)
-		description: `Kimi K2.5 is Kimi's most versatile multimodal model with native vision support. Supports both thinking mode (default, temp=1.0) and instant mode (thinking disabled, temp=0.6). Features 256K context, vision understanding, and agent capabilities.`,
-	},
-	// kilocode_change end
 	"kimi-for-coding": {
 		maxTokens: 32_000,
 		contextWindow: 131_072,
@@ -111,6 +91,19 @@ export const moonshotModels = {
 		defaultTemperature: 1.0,
 		description: `The kimi-k2-thinking model is a general-purpose agentic reasoning model developed by Moonshot AI. Thanks to its strength in deep reasoning and multi-turn tool use, it can solve even the hardest problems.`,
 	},
+	"kimi-k2.5": {
+		maxTokens: 16_384,
+		contextWindow: 262_144,
+		supportsImages: false,
+		supportsPromptCache: true,
+		inputPrice: 0.6, // $0.60 per million tokens (cache miss)
+		outputPrice: 3.0, // $3.00 per million tokens
+		cacheReadsPrice: 0.1, // $0.10 per million tokens (cache hit)
+		supportsTemperature: true,
+		defaultTemperature: 1.0,
+		description:
+			"Kimi K2.5 is the latest generation of Moonshot AI's Kimi series, featuring improved reasoning capabilities and enhanced performance across diverse tasks.",
+	},
 } as const satisfies Record<string, ModelInfo>
 
 export const MOONSHOT_DEFAULT_TEMPERATURE = 0.6

+ 17 - 1
packages/types/src/providers/openai-codex.ts

@@ -16,7 +16,7 @@ import type { ModelInfo } from "../model.js"
 
 export type OpenAiCodexModelId = keyof typeof openAiCodexModels
 
-export const openAiCodexDefaultModelId: OpenAiCodexModelId = "gpt-5.2-codex"
+export const openAiCodexDefaultModelId: OpenAiCodexModelId = "gpt-5.3-codex"
 
 /**
  * Models available through the Codex OAuth flow.
@@ -58,6 +58,22 @@ export const openAiCodexModels = {
 		supportsTemperature: false,
 		description: "GPT-5.1 Codex: GPT-5.1 optimized for agentic coding via ChatGPT subscription",
 	},
+	"gpt-5.3-codex": {
+		maxTokens: 128000,
+		contextWindow: 400000,
+		supportsNativeTools: true,
+		defaultToolProtocol: "native",
+		includedTools: ["apply_patch"],
+		excludedTools: ["apply_diff", "write_to_file"],
+		supportsImages: true,
+		supportsPromptCache: true,
+		supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
+		reasoningEffort: "medium",
+		inputPrice: 0,
+		outputPrice: 0,
+		supportsTemperature: false,
+		description: "GPT-5.3 Codex: OpenAI's flagship coding model via ChatGPT subscription",
+	},
 	"gpt-5.2-codex": {
 		maxTokens: 128000,
 		contextWindow: 400000,

+ 16 - 0
packages/types/src/providers/vertex.ts

@@ -6,6 +6,22 @@ export type VertexModelId = keyof typeof vertexModels
 export const vertexDefaultModelId: VertexModelId = "claude-sonnet-4-5@20250929"
 
 export const vertexModels = {
+	// kilocode_change start
+	"claude-opus-4-6@default": {
+		maxTokens: 128_000,
+		contextWindow: 200_000,
+		supportsImages: true,
+		supportsPromptCache: true,
+		supportsNativeTools: true,
+		defaultToolProtocol: "native",
+		inputPrice: 5.0,
+		outputPrice: 25.0,
+		cacheWritesPrice: 6.25,
+		cacheReadsPrice: 0.5,
+		supportsAdaptiveThinking: true,
+		supportsVerbosity: ["low", "medium", "high", "max"],
+	},
+	// kilocode_change end
 	"gemini-3-pro-preview": {
 		maxTokens: 65_536,
 		contextWindow: 1_048_576,

+ 36 - 0
packages/types/src/providers/zai.ts

@@ -154,7 +154,25 @@ export const internationalZAiModels = {
 		cacheReadsPrice: 0.11,
 		description:
 			"GLM-4.7 is Zhipu's latest model with built-in thinking capabilities enabled by default. It provides enhanced reasoning for complex tasks while maintaining fast response times.",
+		preferredIndex: 1,
 	},
+	// kilocode_change start
+	"glm-4.7-flash": {
+		maxTokens: 16_384,
+		contextWindow: 200_000,
+		supportsImages: false,
+		supportsPromptCache: true,
+		supportsNativeTools: true,
+		defaultToolProtocol: "native",
+		inputPrice: 0,
+		outputPrice: 0,
+		cacheWritesPrice: 0,
+		cacheReadsPrice: 0,
+		description:
+			"GLM-4.7-Flash is a free, high-speed model with built-in thinking capabilities, excellent for reasoning, coding, and agentic tasks.",
+		preferredIndex: 2,
+	},
+	// kilocode_change end
 	"glm-4-32b-0414-128k": {
 		maxTokens: 16_384,
 		contextWindow: 131_072,
@@ -285,7 +303,25 @@ export const mainlandZAiModels = {
 		cacheReadsPrice: 0.057,
 		description:
 			"GLM-4.7 is Zhipu's latest model with built-in thinking capabilities enabled by default. It provides enhanced reasoning for complex tasks while maintaining fast response times.",
+		preferredIndex: 1,
 	},
+	// kilocode_change start
+	"glm-4.7-flash": {
+		maxTokens: 16_384,
+		contextWindow: 204_800,
+		supportsImages: false,
+		supportsPromptCache: true,
+		supportsNativeTools: true,
+		defaultToolProtocol: "native",
+		inputPrice: 0,
+		outputPrice: 0,
+		cacheWritesPrice: 0,
+		cacheReadsPrice: 0,
+		description:
+			"GLM-4.7-Flash is a free, high-speed model with built-in thinking capabilities, excellent for reasoning, coding, and agentic tasks.",
+		preferredIndex: 2,
+	},
+	// kilocode_change end
 } as const satisfies Record<string, ModelInfo>
 
 export const ZAI_DEFAULT_TEMPERATURE = 0.6

+ 5 - 0
packages/types/src/vscode-extension-host.ts

@@ -194,6 +194,7 @@ export interface ExtensionMessage {
 		| "stt:statusResponse" // kilocode_change: Response to stt:checkAvailability request
 		| "stt:devices" // kilocode_change: Microphone devices list
 		| "stt:deviceSelected" // kilocode_change: Device selection confirmation
+		| "settingsImported" // kilocode_change
 		| "setHistoryPreviewCollapsed"
 		| "commandExecutionStatus"
 		| "mcpExecutionStatus"
@@ -639,6 +640,7 @@ export type ExtensionState = Pick<
 	marketplaceInstalledMetadata?: { project: Record<string, any>; global: Record<string, any> }
 	profileThresholds: Record<string, number>
 	hasOpenedModeSelector: boolean
+	hasCompletedOnboarding?: boolean // kilocode_change: Track if user has completed onboarding flow
 	openRouterImageApiKey?: string
 	kiloCodeImageApiKey?: string
 	openRouterUseMiddleOutTransform?: boolean
@@ -843,6 +845,7 @@ export interface WebviewMessage {
 		| "searchFiles"
 		| "toggleApiConfigPin"
 		| "hasOpenedModeSelector"
+		| "hasCompletedOnboarding" // kilocode_change: Mark onboarding as completed
 		| "clearCloudAuthSkipModel"
 		| "cloudButtonClicked"
 		| "rooCloudSignIn"
@@ -1020,6 +1023,7 @@ export interface WebviewMessage {
 	source?: "global" | "project"
 	requestId?: string
 	ids?: string[]
+	excludeFavorites?: boolean // kilocode_change: For batch delete to exclude favorited tasks
 	hasSystemPromptOverride?: boolean
 	terminalOperation?: "continue" | "abort"
 	messageTs?: number
@@ -1151,6 +1155,7 @@ export interface TaskHistoryResponsePayload {
 	historyItems: HistoryItem[]
 	pageIndex: number
 	pageCount: number
+	totalItems: number
 }
 // kilocode_change end
 

+ 1 - 0
packages/types/src/vscode.ts

@@ -88,6 +88,7 @@ export const languages = [
 	"pl",
 	"pt-BR",
 	"ru",
+	"sk",
 	"tr",
 	"vi",
 	"zh-CN",

Plik diff jest za duży
+ 249 - 156
pnpm-lock.yaml


+ 8 - 0
src/api/providers/__tests__/kilocode-openrouter.spec.ts

@@ -22,6 +22,7 @@ import {
 	X_KILOCODE_ORGANIZATIONID,
 	X_KILOCODE_PROJECTID,
 	X_KILOCODE_EDITORNAME,
+	X_KILOCODE_MODE,
 } from "../../../shared/kilocode/headers"
 import { streamSse } from "../../../services/continuedev/core/fetch/stream"
 
@@ -81,6 +82,7 @@ describe("KilocodeOpenrouterHandler", () => {
 
 			expect(result).toEqual({
 				headers: {
+					[X_KILOCODE_MODE]: "code",
 					[X_KILOCODE_TASKID]: "test-task-id",
 					[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
 				},
@@ -96,6 +98,7 @@ describe("KilocodeOpenrouterHandler", () => {
 
 			expect(result).toEqual({
 				headers: {
+					[X_KILOCODE_MODE]: "code",
 					[X_KILOCODE_TASKID]: "test-task-id",
 					[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
 					[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
@@ -116,6 +119,7 @@ describe("KilocodeOpenrouterHandler", () => {
 
 			expect(result).toEqual({
 				headers: {
+					[X_KILOCODE_MODE]: "code",
 					[X_KILOCODE_TASKID]: "test-task-id",
 					[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
 					[X_KILOCODE_PROJECTID]: "https://github.com/user/repo.git",
@@ -137,6 +141,7 @@ describe("KilocodeOpenrouterHandler", () => {
 
 			expect(result).toEqual({
 				headers: {
+					[X_KILOCODE_MODE]: "code",
 					[X_KILOCODE_TASKID]: "test-task-id",
 					[X_KILOCODE_PROJECTID]: "https://github.com/user/repo.git",
 					[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
@@ -154,6 +159,7 @@ describe("KilocodeOpenrouterHandler", () => {
 
 			expect(result).toEqual({
 				headers: {
+					[X_KILOCODE_MODE]: "code",
 					[X_KILOCODE_TASKID]: "test-task-id",
 					[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
 					[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
@@ -172,6 +178,7 @@ describe("KilocodeOpenrouterHandler", () => {
 
 			expect(result).toEqual({
 				headers: {
+					[X_KILOCODE_MODE]: "code",
 					[X_KILOCODE_TASKID]: "test-task-id",
 					[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
 				},
@@ -229,6 +236,7 @@ describe("KilocodeOpenrouterHandler", () => {
 				// kilocode_change start
 				expect.objectContaining({
 					headers: expect.objectContaining({
+						[X_KILOCODE_MODE]: "code",
 						[X_KILOCODE_TASKID]: "test-task-id",
 						[X_KILOCODE_PROJECTID]: "https://github.com/user/repo.git",
 						[X_KILOCODE_ORGANIZATIONID]: "test-org-id",

+ 244 - 129
src/api/providers/__tests__/moonshot.spec.ts

@@ -1,67 +1,28 @@
-// Mocks must come first, before imports
-const mockCreate = vi.fn()
-vi.mock("openai", () => {
+// Use vi.hoisted to define mock functions that can be referenced in hoisted vi.mock() calls
+const { mockStreamText, mockGenerateText } = vi.hoisted(() => ({
+	mockStreamText: vi.fn(),
+	mockGenerateText: vi.fn(),
+}))
+
+vi.mock("ai", async (importOriginal) => {
+	const actual = await importOriginal<typeof import("ai")>()
 	return {
-		__esModule: true,
-		default: vi.fn().mockImplementation(() => ({
-			chat: {
-				completions: {
-					create: mockCreate.mockImplementation(async (options) => {
-						if (!options.stream) {
-							return {
-								id: "test-completion",
-								choices: [
-									{
-										message: { role: "assistant", content: "Test response", refusal: null },
-										finish_reason: "stop",
-										index: 0,
-									},
-								],
-								usage: {
-									prompt_tokens: 10,
-									completion_tokens: 5,
-									total_tokens: 15,
-									cached_tokens: 2,
-								},
-							}
-						}
-
-						// Return async iterator for streaming
-						return {
-							[Symbol.asyncIterator]: async function* () {
-								yield {
-									choices: [
-										{
-											delta: { content: "Test response" },
-											index: 0,
-										},
-									],
-									usage: null,
-								}
-								yield {
-									choices: [
-										{
-											delta: {},
-											index: 0,
-										},
-									],
-									usage: {
-										prompt_tokens: 10,
-										completion_tokens: 5,
-										total_tokens: 15,
-										cached_tokens: 2,
-									},
-								}
-							},
-						}
-					}),
-				},
-			},
-		})),
+		...actual,
+		streamText: mockStreamText,
+		generateText: mockGenerateText,
 	}
 })
 
-import OpenAI from "openai"
+vi.mock("@ai-sdk/openai-compatible", () => ({
+	createOpenAICompatible: vi.fn(() => {
+		// Return a function that returns a mock language model
+		return vi.fn(() => ({
+			modelId: "moonshot-chat",
+			provider: "moonshot",
+		}))
+	}),
+}))
+
 import type { Anthropic } from "@anthropic-ai/sdk"
 
 import { moonshotDefaultModelId } from "@roo-code/types"
@@ -90,15 +51,6 @@ describe("MoonshotHandler", () => {
 			expect(handler.getModel().id).toBe(mockOptions.apiModelId)
 		})
 
-		it.skip("should throw error if API key is missing", () => {
-			expect(() => {
-				new MoonshotHandler({
-					...mockOptions,
-					moonshotApiKey: undefined,
-				})
-			}).toThrow("Moonshot API key is required")
-		})
-
 		it("should use default model ID if not provided", () => {
 			const handlerWithoutModel = new MoonshotHandler({
 				...mockOptions,
@@ -113,12 +65,6 @@ describe("MoonshotHandler", () => {
 				moonshotBaseUrl: undefined,
 			})
 			expect(handlerWithoutBaseUrl).toBeInstanceOf(MoonshotHandler)
-			// The base URL is passed to OpenAI client internally
-			expect(OpenAI).toHaveBeenCalledWith(
-				expect.objectContaining({
-					baseURL: "https://api.moonshot.ai/v1",
-				}),
-			)
 		})
 
 		it("should use chinese base URL if provided", () => {
@@ -128,18 +74,6 @@ describe("MoonshotHandler", () => {
 				moonshotBaseUrl: customBaseUrl,
 			})
 			expect(handlerWithCustomUrl).toBeInstanceOf(MoonshotHandler)
-			// The custom base URL is passed to OpenAI client
-			expect(OpenAI).toHaveBeenCalledWith(
-				expect.objectContaining({
-					baseURL: customBaseUrl,
-				}),
-			)
-		})
-
-		it("should set includeMaxTokens to true", () => {
-			// Create a new handler and verify OpenAI client was called with includeMaxTokens
-			const _handler = new MoonshotHandler(mockOptions)
-			expect(OpenAI).toHaveBeenCalledWith(expect.objectContaining({ apiKey: mockOptions.moonshotApiKey }))
 		})
 	})
 
@@ -151,7 +85,7 @@ describe("MoonshotHandler", () => {
 			expect(model.info.maxTokens).toBe(16000)
 			expect(model.info.contextWindow).toBe(262144)
 			expect(model.info.supportsImages).toBe(false)
-			expect(model.info.supportsPromptCache).toBe(true) // Should be true now
+			expect(model.info.supportsPromptCache).toBe(true)
 		})
 
 		it("should return provided model ID with default model info if model does not exist", () => {
@@ -162,11 +96,8 @@ describe("MoonshotHandler", () => {
 			const model = handlerWithInvalidModel.getModel()
 			expect(model.id).toBe("invalid-model") // Returns provided ID
 			expect(model.info).toBeDefined()
-			// With the current implementation, it's the same object reference when using default model info
-			expect(model.info).toBe(handler.getModel().info)
-			// Should have the same base properties
+			// Should have the same base properties as default model
 			expect(model.info.contextWindow).toBe(handler.getModel().info.contextWindow)
-			// And should have supportsPromptCache set to true
 			expect(model.info.supportsPromptCache).toBe(true)
 		})
 
@@ -203,6 +134,24 @@ describe("MoonshotHandler", () => {
 		]
 
 		it("should handle streaming responses", async () => {
+			// Mock the fullStream async generator
+			async function* mockFullStream() {
+				yield { type: "text-delta", text: "Test response" }
+			}
+
+			// Mock usage promise
+			const mockUsage = Promise.resolve({
+				inputTokens: 10,
+				outputTokens: 5,
+				details: { cachedInputTokens: undefined },
+				raw: { cached_tokens: 2 },
+			})
+
+			mockStreamText.mockReturnValue({
+				fullStream: mockFullStream(),
+				usage: mockUsage,
+			})
+
 			const stream = handler.createMessage(systemPrompt, messages)
 			const chunks: any[] = []
 			for await (const chunk of stream) {
@@ -216,6 +165,22 @@ describe("MoonshotHandler", () => {
 		})
 
 		it("should include usage information", async () => {
+			async function* mockFullStream() {
+				yield { type: "text-delta", text: "Test response" }
+			}
+
+			const mockUsage = Promise.resolve({
+				inputTokens: 10,
+				outputTokens: 5,
+				details: {},
+				raw: { cached_tokens: 2 },
+			})
+
+			mockStreamText.mockReturnValue({
+				fullStream: mockFullStream(),
+				usage: mockUsage,
+			})
+
 			const stream = handler.createMessage(systemPrompt, messages)
 			const chunks: any[] = []
 			for await (const chunk of stream) {
@@ -229,6 +194,22 @@ describe("MoonshotHandler", () => {
 		})
 
 		it("should include cache metrics in usage information", async () => {
+			async function* mockFullStream() {
+				yield { type: "text-delta", text: "Test response" }
+			}
+
+			const mockUsage = Promise.resolve({
+				inputTokens: 10,
+				outputTokens: 5,
+				details: {},
+				raw: { cached_tokens: 2 },
+			})
+
+			mockStreamText.mockReturnValue({
+				fullStream: mockFullStream(),
+				usage: mockUsage,
+			})
+
 			const stream = handler.createMessage(systemPrompt, messages)
 			const chunks: any[] = []
 			for await (const chunk of stream) {
@@ -242,6 +223,23 @@ describe("MoonshotHandler", () => {
 		})
 	})
 
+	describe("completePrompt", () => {
+		it("should complete a prompt using generateText", async () => {
+			mockGenerateText.mockResolvedValue({
+				text: "Test completion",
+			})
+
+			const result = await handler.completePrompt("Test prompt")
+
+			expect(result).toBe("Test completion")
+			expect(mockGenerateText).toHaveBeenCalledWith(
+				expect.objectContaining({
+					prompt: "Test prompt",
+				}),
+			)
+		})
+	})
+
 	describe("processUsageMetrics", () => {
 		it("should correctly process usage metrics including cache information", () => {
 			// We need to access the protected method, so we'll create a test subclass
@@ -254,10 +252,12 @@ describe("MoonshotHandler", () => {
 			const testHandler = new TestMoonshotHandler(mockOptions)
 
 			const usage = {
-				prompt_tokens: 100,
-				completion_tokens: 50,
-				total_tokens: 150,
-				cached_tokens: 20,
+				inputTokens: 100,
+				outputTokens: 50,
+				details: {},
+				raw: {
+					cached_tokens: 20,
+				},
 			}
 
 			const result = testHandler.testProcessUsageMetrics(usage)
@@ -279,10 +279,10 @@ describe("MoonshotHandler", () => {
 			const testHandler = new TestMoonshotHandler(mockOptions)
 
 			const usage = {
-				prompt_tokens: 100,
-				completion_tokens: 50,
-				total_tokens: 150,
-				// No cached_tokens
+				inputTokens: 100,
+				outputTokens: 50,
+				details: {},
+				raw: {},
 			}
 
 			const result = testHandler.testProcessUsageMetrics(usage)
@@ -295,31 +295,25 @@ describe("MoonshotHandler", () => {
 		})
 	})
 
-	describe("addMaxTokensIfNeeded", () => {
-		it("should always add max_tokens regardless of includeMaxTokens option", () => {
-			// Create a test subclass to access the protected method
+	describe("getMaxOutputTokens", () => {
+		it("should return maxTokens from model info", () => {
 			class TestMoonshotHandler extends MoonshotHandler {
-				public testAddMaxTokensIfNeeded(requestOptions: any, modelInfo: any) {
-					this.addMaxTokensIfNeeded(requestOptions, modelInfo)
+				public testGetMaxOutputTokens() {
+					return this.getMaxOutputTokens()
 				}
 			}
 
 			const testHandler = new TestMoonshotHandler(mockOptions)
-			const requestOptions: any = {}
-			const modelInfo = {
-				maxTokens: 32_000,
-			}
-
-			// Test with includeMaxTokens set to false - should still add max tokens
-			testHandler.testAddMaxTokensIfNeeded(requestOptions, modelInfo)
+			const result = testHandler.testGetMaxOutputTokens()
 
-			expect(requestOptions.max_tokens).toBe(32_000)
+			// Default model maxTokens is 16000 (kimi-k2-thinking)
+			expect(result).toBe(16000)
 		})
 
 		it("should use modelMaxTokens when provided", () => {
 			class TestMoonshotHandler extends MoonshotHandler {
-				public testAddMaxTokensIfNeeded(requestOptions: any, modelInfo: any) {
-					this.addMaxTokensIfNeeded(requestOptions, modelInfo)
+				public testGetMaxOutputTokens() {
+					return this.getMaxOutputTokens()
 				}
 			}
 
@@ -328,32 +322,153 @@ describe("MoonshotHandler", () => {
 				...mockOptions,
 				modelMaxTokens: customMaxTokens,
 			})
-			const requestOptions: any = {}
-			const modelInfo = {
-				maxTokens: 32_000,
-			}
 
-			testHandler.testAddMaxTokensIfNeeded(requestOptions, modelInfo)
-
-			expect(requestOptions.max_tokens).toBe(customMaxTokens)
+			const result = testHandler.testGetMaxOutputTokens()
+			expect(result).toBe(customMaxTokens)
 		})
 
 		it("should fall back to modelInfo.maxTokens when modelMaxTokens is not provided", () => {
 			class TestMoonshotHandler extends MoonshotHandler {
-				public testAddMaxTokensIfNeeded(requestOptions: any, modelInfo: any) {
-					this.addMaxTokensIfNeeded(requestOptions, modelInfo)
+				public testGetMaxOutputTokens() {
+					return this.getMaxOutputTokens()
 				}
 			}
 
 			const testHandler = new TestMoonshotHandler(mockOptions)
-			const requestOptions: any = {}
-			const modelInfo = {
-				maxTokens: 16_000,
+			const result = testHandler.testGetMaxOutputTokens()
+
+			// moonshot-chat is not present in moonshotModels and falls back to default model info (maxTokens 16000)
+			expect(result).toBe(16000)
+		})
+	})
+
+	describe("tool handling", () => {
+		const systemPrompt = "You are a helpful assistant."
+		const messages: Anthropic.Messages.MessageParam[] = [
+			{
+				role: "user",
+				content: [{ type: "text" as const, text: "Hello!" }],
+			},
+		]
+
+		it("should handle tool calls in streaming", async () => {
+			async function* mockFullStream() {
+				yield {
+					type: "tool-input-start",
+					id: "tool-call-1",
+					toolName: "read_file",
+				}
+				yield {
+					type: "tool-input-delta",
+					id: "tool-call-1",
+					delta: '{"path":"test.ts"}',
+				}
+				yield {
+					type: "tool-input-end",
+					id: "tool-call-1",
+				}
 			}
 
-			testHandler.testAddMaxTokensIfNeeded(requestOptions, modelInfo)
+			const mockUsage = Promise.resolve({
+				inputTokens: 10,
+				outputTokens: 5,
+				details: {},
+				raw: {},
+			})
+
+			mockStreamText.mockReturnValue({
+				fullStream: mockFullStream(),
+				usage: mockUsage,
+			})
+
+			const stream = handler.createMessage(systemPrompt, messages, {
+				taskId: "test-task",
+				tools: [
+					{
+						type: "function",
+						function: {
+							name: "read_file",
+							description: "Read a file",
+							parameters: {
+								type: "object",
+								properties: { path: { type: "string" } },
+								required: ["path"],
+							},
+						},
+					},
+				],
+			})
+
+			const chunks: any[] = []
+			for await (const chunk of stream) {
+				chunks.push(chunk)
+			}
+
+			const toolCallStartChunks = chunks.filter((c) => c.type === "tool_call_start")
+			const toolCallDeltaChunks = chunks.filter((c) => c.type === "tool_call_delta")
+			const toolCallEndChunks = chunks.filter((c) => c.type === "tool_call_end")
+
+			expect(toolCallStartChunks.length).toBe(1)
+			expect(toolCallStartChunks[0].id).toBe("tool-call-1")
+			expect(toolCallStartChunks[0].name).toBe("read_file")
+
+			expect(toolCallDeltaChunks.length).toBe(1)
+			expect(toolCallDeltaChunks[0].delta).toBe('{"path":"test.ts"}')
+
+			expect(toolCallEndChunks.length).toBe(1)
+			expect(toolCallEndChunks[0].id).toBe("tool-call-1")
+		})
+
+		it("should handle complete tool calls", async () => {
+			async function* mockFullStream() {
+				yield {
+					type: "tool-call",
+					toolCallId: "tool-call-1",
+					toolName: "read_file",
+					input: { path: "test.ts" },
+				}
+			}
+
+			const mockUsage = Promise.resolve({
+				inputTokens: 10,
+				outputTokens: 5,
+				details: {},
+				raw: {},
+			})
+
+			mockStreamText.mockReturnValue({
+				fullStream: mockFullStream(),
+				usage: mockUsage,
+			})
+
+			const stream = handler.createMessage(systemPrompt, messages, {
+				taskId: "test-task",
+				tools: [
+					{
+						type: "function",
+						function: {
+							name: "read_file",
+							description: "Read a file",
+							parameters: {
+								type: "object",
+								properties: { path: { type: "string" } },
+								required: ["path"],
+							},
+						},
+					},
+				],
+			})
+
+			const chunks: any[] = []
+			for await (const chunk of stream) {
+				chunks.push(chunk)
+			}
 
-			expect(requestOptions.max_tokens).toBe(16_000)
+			const toolCallChunks = chunks.filter((c) => c.type === "tool_call")
+			expect(toolCallChunks.length).toBe(1)
+			expect(toolCallChunks[0].id).toBe("tool-call-1")
+			expect(toolCallChunks[0].name).toBe("read_file")
+			expect(toolCallChunks[0].arguments).toBe('{"path":"test.ts"}')
 		})
 	})
 })

+ 1 - 1
src/api/providers/__tests__/openai-codex.spec.ts

@@ -20,7 +20,7 @@ describe("OpenAiCodexHandler.getModel", () => {
 		const handler = new OpenAiCodexHandler({ apiModelId: "not-a-real-model" })
 		const model = handler.getModel()
 
-		expect(model.id).toBe("gpt-5.2-codex")
+		expect(model.id).toBe("gpt-5.3-codex")
 		expect(model.info).toBeDefined()
 	})
 })

+ 13 - 2
src/api/providers/anthropic-vertex.ts

@@ -113,7 +113,7 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
 			model: id,
 			max_tokens: maxTokens ?? ANTHROPIC_DEFAULT_MAX_TOKENS,
 			temperature,
-			thinking,
+			thinking: thinking as Anthropic.Messages.ThinkingConfigParam | undefined, // kilocode_change
 			// Cache the system prompt if caching is enabled.
 			system: supportsPromptCache
 				? [{ text: systemPrompt, type: "text" as const, cache_control: { type: "ephemeral" } }]
@@ -257,6 +257,17 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
 			betas.push("context-1m-2025-08-07")
 		}
 
+		// kilocode_change start
+		if (params.reasoning?.type === "adaptive") {
+			betas.push(
+				"adaptive-thinking-2026-01-28",
+				"interleaved-thinking-2025-05-14",
+				"effort-2025-11-24",
+				"max-effort-2026-01-24",
+			)
+		}
+		// kilocode_change end
+
 		// The `:thinking` suffix indicates that the model is a "Hybrid"
 		// reasoning model and that reasoning is required to be enabled.
 		// The actual model ID honored by Anthropic's API does not have this
@@ -283,7 +294,7 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
 				model: id,
 				max_tokens: maxTokens,
 				temperature,
-				thinking,
+				thinking: thinking as Anthropic.Messages.ThinkingConfigParam | undefined, // kilocode_change
 				messages: [
 					{
 						role: "user",

+ 11 - 2
src/api/providers/anthropic.ts

@@ -77,7 +77,14 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
 		}
 
 		// kilocode_change start
-		if (verbosity) {
+		if (thinking?.type === "adaptive") {
+			betas.push(
+				"adaptive-thinking-2026-01-28",
+				"interleaved-thinking-2025-05-14",
+				"effort-2025-11-24",
+				"max-effort-2026-01-24",
+			)
+		} else if (verbosity) {
 			betas.push("effort-2025-11-24")
 		}
 		// kilocode_change end
@@ -110,6 +117,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
 			: {}
 
 		switch (modelId) {
+			case "claude-opus-4-6": // kilocode_change
 			case "claude-sonnet-4-5":
 			case "claude-sonnet-4-20250514":
 			case "claude-opus-4-5-20251101":
@@ -145,7 +153,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
 							model: apiModelId, // kilocode_change
 							max_tokens: maxTokens ?? ANTHROPIC_DEFAULT_MAX_TOKENS,
 							temperature,
-							thinking,
+							thinking: thinking as Anthropic.Messages.ThinkingConfigParam | undefined, // kilocode_change
 							// Setting cache breakpoint for system prompt so new tasks can reuse it.
 							system: [{ text: systemPrompt, type: "text", cache_control: cacheControl }],
 							messages: sanitizedMessages.map((message, index) => {
@@ -183,6 +191,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
 
 							// Then check for models that support prompt caching
 							switch (modelId) {
+								case "claude-opus-4-6": // kilocode_change
 								case "claude-sonnet-4-5":
 								case "claude-sonnet-4-20250514":
 								case "claude-opus-4-5-20251101":

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików