Kimi Code AAA Configuration
arifOS-ACT Embedding
Before using this skill on any mutating, irreversible, or high-blast-radius task:
- ART — Attune (what is the real task?), Recognize (what class of power?), Test (fit · authority · evidence · blast · reversible).
- Kernel — Route to arifOS for F1–F13 judgment if action class is Maker/Messenger/Mutator/Destroyer/Sovereign.
- ACT — Apply narrow, Constrain scope, Trace witness, STOP before corruption.
- Receipt — Leave evidence of what changed, why, and under whose authority.
When to Use
- Kimi Code CLI fails with LLM 404, MCP
source: not found, or missing federation tools
- Migrating from legacy
kimi-cli (uv, v1.47) to kimi-code (v0.18+)
- Onboarding Kimi as warga AAA (FI-008)
- Auditing
mcp.json, config.toml, or KIMI_CODE_HOME drift
When NOT to Use
- Do not use to rotate secrets in
kunci-root.env without 888_HOLD
- Do not enable
default_yolo = true for constitutional work
- Do not wire A-FORGE HTTP
:7071/mcp as primary ingress (single-session SDK limit)
Canonical Paths (af-forge VPS)
| Path |
Purpose |
/root/.kimi-code/bin/kimi |
kimi-code binary (v0.41.0 = upstream latest, verified 2026-09-07; npm @moonshot-ai/kimi-code) |
/usr/local/bin/kimi |
Federation wrapper (sets KIMI_CODE_HOME, unsets dead KIMI_API_KEY) |
/root/.kimi-code |
$KIMI_CODE_HOME — ONE-HOME 2026-08-24 (was .arifos/agents/kimi, now the identity archive: hooks/launchers/agents live there, referenced by absolute path) |
/root/.kimi-code/mcp.json |
User-global MCP — count = this file, do not hardcode (13 entries, 8 enabled / 5 disabled at 2026-09-07; legacy copy at .arifos/agents/kimi/mcp.json is archive) |
/root/.mcp.json |
Project-root MCP when cwd is /root |
/root/AAA/agents/kimi-code/WARGAAA_CARD.md |
Warga identity card |
Official Docs
Audit Checklist
- Binary:
which kimi → /usr/local/bin/kimi → exec ~/.kimi-code/bin/kimi
- Home:
echo $KIMI_CODE_HOME → /root/.kimi-code (ONE-HOME 2026-08-24)
- Doctor:
kimi doctor → OK config.toml
- Auth: OAuth via
/login — never use dead KIMI_API_KEY from kunci-root.env (causes 404)
- MCP launchers: All stdio servers use
mcp-launchers/*.sh (bash), not inline sh -lc with source
- A-FORGE: stdio via
aforge.sh — not HTTP for Kimi primary ingress
- Serena:
arifOS/.serena/project.yml and A-FORGE/.serena/project.yml exist
- Warga: identity carried by
$KIMI_CODE_HOME/SYSTEM.md (FI-008 preamble revived 2026-08-24) — [agent_identity] in config.toml is DEAD-v2 scaffolding, do not resurrect
Fix Patterns
LLM 404 resource_not_found_error
Root cause: stale KIMI_API_KEY in environment overrides OAuth.
unset KIMI_API_KEY
kimi login # or /login in TUI
kimi doctor
Wrapper at /usr/local/bin/kimi already unsets KIMI_API_KEY.
sh: 35: source: not found
Root cause: MCP stdio launchers invoked via sh with bash-only source.
Fix: use dedicated bash scripts in mcp-launchers/ with #!/usr/bin/env bash and . /root/.env (not source).
MCP 11/13 connected, meyhem/github still loading
Ensure disabled: true on legacy servers in mcp.json. Start fresh session: /new.
Health Verification
# De-hardcoded v1.0.1 — ports sourced from federation organ registry
PROBE_HOST="${FEDERATION_PROBE_HOST:-127.0.0.1}"
REGISTRY="${FEDERATION_REGISTRY:-/root/AAA/federation/organs.yaml}"
PORTS=$(python3 -c "
import yaml, sys
try:
with open('$REGISTRY') as f: r = yaml.safe_load(f)
print(' '.join(str(o.get('port','')) for o in r.get('organs',[]) if o.get('port')))
except Exception as e:
sys.stderr.write(f'registry read failed: {e}\n')
sys.exit(1)
" 2>/dev/null) || PORTS="8088 8081 18082 18083 7071 3001" # fallback to known-good if registry unreachable
for p in $PORTS; do
curl -sf "http://$PROBE_HOST:$p/health" >/dev/null && echo ":$p OK" || echo ":$p FAIL"
done
kimi doctor
Escalation
| Condition |
Action |
| OAuth revoked |
/login in Kimi TUI |
| A-FORGE stdio fails |
cd ${AFORGE_HOME:-/root/A-FORGE} && npm run build then retry |
| Cross-repo architecture change |
888_HOLD → Arif |
De-hardcoding Log (v1.0.1)
- Health Verification ports — sourced from
/root/AAA/federation/organs.yaml (organ registry), overridable via $FEDERATION_REGISTRY
- Probe host —
$FEDERATION_PROBE_HOST env, defaults to 127.0.0.1 (LOCALHOST_IS_PASSWORD doctrine)
- A-FORGE source path —
$AFORGE_HOME env, defaults to /root/A-FORGE (backward compatible)
- Fallback port list — kept inline as last-resort if registry read fails; mirrors known-good ports
- Canonical paths table (lines 83–90) — intentionally left as documentation, since these are reference material not executable code
DITEMPA BUKAN DIBERI.
1---2id: kimi-code-aaa3name: forge-kimi-code4autonomy_tier: T15version: 1.0.16description: Configure, audit, and align Kimi Code CLI as AAA warga FI-008 with arifOS7 kernel and A-FORGE stdio actuator.8owner: AAA9risk_tier: medium10knowledge_basis:11 language: true12 math: false13 physics: false14host_compatibility:15- kimi-code16- kimi17- claude-code18- codex19- opencode20dependencies:21 skills:22 - arifos-mcp-federation23 - agent-onboarding24 servers:25 - arifos26 - aforge27 - geox28 - wealth29 - well30 tools: []31examples:32- Audit Kimi Code MCP configuration against federation canonical paths33- 'Repair A-FORGE stdio launcher after `source: not found`'34tests:35- '`kimi doctor` reports OK config.toml'36- All federation organ health endpoints respond37version_lock:38 schema_version: '1'39 artifact_hash: pending40orthogonal_tags:41 trinitarian:42 - Ω43 - ΦΙ44 functional:45 - Interface46 layer: HEXAGON47 autonomy_tier: T1-T248floor_scope:49- F150- F251- F452- F853- F1154- F1355capability_tier: fed-long-context56ecology_state: WARM57---5859# Kimi Code AAA Configuration6061## arifOS-ACT Embedding6263Before using this skill on any mutating, irreversible, or high-blast-radius task:641. **ART** — Attune (what is the real task?), Recognize (what class of power?), Test (fit · authority · evidence · blast · reversible).652. **Kernel** — Route to arifOS for F1–F13 judgment if action class is Maker/Messenger/Mutator/Destroyer/Sovereign.663. **ACT** — Apply narrow, Constrain scope, Trace witness, STOP before corruption.674. **Receipt** — Leave evidence of what changed, why, and under whose authority.686970## When to Use7172- Kimi Code CLI fails with LLM 404, MCP `source: not found`, or missing federation tools73- Migrating from legacy `kimi-cli` (uv, v1.47) to `kimi-code` (v0.18+)74- Onboarding Kimi as warga AAA (FI-008)75- Auditing `mcp.json`, `config.toml`, or `KIMI_CODE_HOME` drift7677## When NOT to Use7879- Do not use to rotate secrets in `kunci-root.env` without 888_HOLD80- Do not enable `default_yolo = true` for constitutional work81- Do not wire A-FORGE HTTP `:7071/mcp` as primary ingress (single-session SDK limit)8283## Canonical Paths (af-forge VPS)8485| Path | Purpose |86|------|---------|87| `/root/.kimi-code/bin/kimi` | kimi-code binary (v0.41.0 = upstream latest, verified 2026-09-07; npm `@moonshot-ai/kimi-code`) |88| `/usr/local/bin/kimi` | Federation wrapper (sets `KIMI_CODE_HOME`, unsets dead `KIMI_API_KEY`) |89| `/root/.kimi-code` | `$KIMI_CODE_HOME` — ONE-HOME 2026-08-24 (was `.arifos/agents/kimi`, now the identity archive: hooks/launchers/agents live there, referenced by absolute path) |90| `/root/.kimi-code/mcp.json` | User-global MCP — count = this file, do not hardcode (13 entries, 8 enabled / 5 disabled at 2026-09-07; legacy copy at `.arifos/agents/kimi/mcp.json` is archive) |91| `/root/.mcp.json` | Project-root MCP when cwd is `/root` |92| `/root/AAA/agents/kimi-code/WARGAAA_CARD.md` | Warga identity card |9394## Official Docs9596- Install & first launch: https://platform.kimi.ai/docs/guide/kimi-cli-support97- Config files: https://www.kimi.com/code/docs/kimi-code-cli/configuration/config-files.html98- MCP: https://moonshotai.github.io/kimi-cli/en/customization/mcp.html99- Migrate: `kimi migrate` (interactive — config only recommended)100101## Audit Checklist1021031. **Binary:** `which kimi` → `/usr/local/bin/kimi` → exec `~/.kimi-code/bin/kimi`1042. **Home:** `echo $KIMI_CODE_HOME` → `/root/.kimi-code` (ONE-HOME 2026-08-24)1053. **Doctor:** `kimi doctor` → `OK config.toml`1064. **Auth:** OAuth via `/login` — **never** use dead `KIMI_API_KEY` from `kunci-root.env` (causes 404)1075. **MCP launchers:** All stdio servers use `mcp-launchers/*.sh` (bash), not inline `sh -lc` with `source`1086. **A-FORGE:** stdio via `aforge.sh` — not HTTP for Kimi primary ingress1097. **Serena:** `arifOS/.serena/project.yml` and `A-FORGE/.serena/project.yml` exist1108. **Warga:** identity carried by `$KIMI_CODE_HOME/SYSTEM.md` (FI-008 preamble revived 2026-08-24) — `[agent_identity]` in config.toml is DEAD-v2 scaffolding, do not resurrect111112## Fix Patterns113114### LLM 404 `resource_not_found_error`115116Root cause: stale `KIMI_API_KEY` in environment overrides OAuth.117118```bash119unset KIMI_API_KEY120kimi login # or /login in TUI121kimi doctor122```123124Wrapper at `/usr/local/bin/kimi` already unsets `KIMI_API_KEY`.125126### `sh: 35: source: not found`127128Root cause: MCP stdio launchers invoked via `sh` with bash-only `source`.129130Fix: use dedicated bash scripts in `mcp-launchers/` with `#!/usr/bin/env bash` and `. /root/.env` (not `source`).131132### MCP 11/13 connected, meyhem/github still loading133134Ensure `disabled: true` on legacy servers in `mcp.json`. Start fresh session: `/new`.135136## Health Verification137138```bash139# De-hardcoded v1.0.1 — ports sourced from federation organ registry140PROBE_HOST="${FEDERATION_PROBE_HOST:-127.0.0.1}"141REGISTRY="${FEDERATION_REGISTRY:-/root/AAA/federation/organs.yaml}"142PORTS=$(python3 -c "143import yaml, sys144try:145 with open('$REGISTRY') as f: r = yaml.safe_load(f)146 print(' '.join(str(o.get('port','')) for o in r.get('organs',[]) if o.get('port')))147except Exception as e:148 sys.stderr.write(f'registry read failed: {e}\n')149 sys.exit(1)150" 2>/dev/null) || PORTS="8088 8081 18082 18083 7071 3001" # fallback to known-good if registry unreachable151for p in $PORTS; do152 curl -sf "http://$PROBE_HOST:$p/health" >/dev/null && echo ":$p OK" || echo ":$p FAIL"153done154kimi doctor155```156157## Escalation158159| Condition | Action |160|-----------|--------|161| OAuth revoked | `/login` in Kimi TUI |162| A-FORGE stdio fails | `cd ${AFORGE_HOME:-/root/A-FORGE} && npm run build` then retry |163| Cross-repo architecture change | 888_HOLD → Arif |164165## De-hardcoding Log (v1.0.1)166167- **Health Verification ports** — sourced from `/root/AAA/federation/organs.yaml` (organ registry), overridable via `$FEDERATION_REGISTRY`168- **Probe host** — `$FEDERATION_PROBE_HOST` env, defaults to `127.0.0.1` (LOCALHOST_IS_PASSWORD doctrine)169- **A-FORGE source path** — `$AFORGE_HOME` env, defaults to `/root/A-FORGE` (backward compatible)170- **Fallback port list** — kept inline as last-resort if registry read fails; mirrors known-good ports171- **Canonical paths table** (lines 83–90) — intentionally left as documentation, since these are reference material not executable code172173DITEMPA BUKAN DIBERI.