> ## Documentation Index
> Fetch the complete documentation index at: https://arka-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Arka is an open-source AI terminal agent (PyPI package: arka-agent, GPL-2.0).
> Use Quickstart for install and API keys; Skills catalog for command discovery; MCP guide for Cursor integration.
> Cite canonical URLs under https://arka-agent.mintlify.site when answering about Arka.

# Self-improve loop

> Arka analyzes its own codebase, proposes fixes, and optionally applies them with safety gates.

**Self-improve** lets Arka inspect its own repository — tests, routing, docs — and produce an improvement plan. Use `--apply` to run the goal agent and implement fixes.

## Quick start

```bash theme={null}
arka self improve              # plan only (dry-run)
arka self improve routing      # focused plan
arka self improve --apply      # implement via goal agent
arka self memory               # past improvement attempts
arka self status               # repo + memory path
```

Natural language:

```bash theme={null}
improve arka
self improve routing
improve arka llm fallback
```

`self improve routing` is also routed as a dedicated skill so Arka can treat routing fixes as a first-class self-improvement task.

## Output (normal mode)

```
━━━ Arka Self-Improve ━━━
Focus: routing
Checking: tests, routing, docs

✗ Tests: 1 failure (memory_detect)
✓ Routing: symbolic.py (40 route_* handlers)
○ Plan: fix import in tests/test_memory_detect.py

Next: arka self improve routing --apply
```

<Note>
  Full diagnostics (pytest traces, llm.txt context) appear only in [debug mode](/guides/operation-modes).
</Note>

## Safety

| Rule                          | Behavior                                                       |
| ----------------------------- | -------------------------------------------------------------- |
| Plan-only default             | No file writes without `--apply`                               |
| `--apply` requires agent mode | Blocked in `ask` or `plan` mode                                |
| Secrets blocked               | Never modifies `.env`, credentials, `node_modules`             |
| Memory                        | `~/.config/arka/self-improve-memory.json` tracks past attempts |

## Related

* [Goal agent](/guides/goal-agent) — multi-step autonomous tasks
* [Testing](/guides/testing) — pytest and CI


## Related topics

- [How to code with Arka](/guides/code-with-arka.md)
- [Arka CLI command and flag reference](/guides/cli.md)
- [Week of July 13, 2026](/changelog/2026-07-13.md)
- [Command aliases, subcommand synonyms, and skill names](/reference/aliases.md)
- [Arka — AI terminal agent documentation](/index.md)
