New recipes every week

Turn Complexity Into
Cloud Recipes

Learn Kubernetes, AI, DevOps and DevSecOps the CloudChef way. Practical guides, real-world examples, no fluff.

Free forever No paywall Practical guides Real-world examples
50+Guides
WeeklyNew posts
K8s + AITop topics
FreeAlways
AI Cloud CloudChef Monday, June 8, 2026 ⏱ Calculating...

Your AI Should Remember You: Complete Qwen Setup with Local Privacy

CC
CloudChef
thecloudchef.io
Qwen Code setup with CloudChef four-layer cookbook: QWEN.md context, memory, skills, and subagents

Most AI setups still behave like a food truck with amnesia: you explain your stack, your tone, and your “please don’t run kubectl delete” rule—then the next session starts from zero. Again. Still hungry.

Qwen Code (the terminal AI coding tool from the Qwen team) can do better—if you prep the kitchen once. In this CloudChef cookbook you will set up four layers that map to real Qwen Code features: Context (QWEN.md), Memory (auto-memory + /remember), Skills (SKILL.md folders), and Subagents (specialists under /agents). Optional dessert: run models locally with Ollama via an OpenAI-compatible endpoint.

πŸ‘‰ Every command below is aligned with the official Qwen Code docs (May 2026). We use fictional project names where it helps—you swap in yours.


😀 The Problem

You are three chats deep into a Helm refactor. The model finally understands your label scheme. You close the terminal. Tomorrow it asks what Helm is.

  • Same instructions, new session, new sigh
  • “Write tests” turns into “here is a test file” with no connection to your repo layout
  • One generalist plays architect, SRE, tech writer, and security reviewer—badly
  • You paste secrets because the tool has no stable “house rules” file

πŸ‘‰ You do not need a smarter model first. You need mise en place—ingredients chopped before service.


πŸ” Root Cause

The failure mode is not “Qwen is weak.” It is unstructured setup:

  • No Context layer → Qwen never loads your standing orders (QWEN.md)
  • No Memory layer → preferences live only in chat scrollback
  • No Skills layer → repeatable workflows are re-prompted from memory
  • No Subagents layer → one chat plays every role in the kitchen

Qwen Code already ships the hooks for all four. Most people just… never wire them. (Guilty. We have all been there.)


πŸ“Š The CloudChef 4-Layer Map (Real Paths)

Layer What it is Where it lives
Context Standing instructions every session ~/.qwen/QWEN.md + ./QWEN.md
Memory Auto-notes + explicit remembers /memory, /remember, project auto-memory store
Skills Reusable playbooks the model can invoke ~/.qwen/skills/<name>/SKILL.md or .qwen/skills/
Subagents Specialists (tests, review, docs) ~/.qwen/agents/ or .qwen/agents/
flowchart TD You[You] --> QC[Qwen Code CLI] QC --> CTX[Context
QWEN.md] QC --> MEM[Memory
/remember + auto-memory] QC --> SK[Skills
SKILL.md] QC --> SA[Subagents
/agents] CTX --> Out[One clear ask
→ repeatable output] MEM --> Out SK --> Out SA --> Out

🍳 CloudChef Recipe: Setup Qwen Code Step by Step

Prerequisites: Node.js 20+, a terminal, and a project folder. For cloud models you need a Coding Plan or API key (Qwen OAuth was discontinued 15 April 2026—use /auth to pick a current method).

Step 1 — Install Qwen Code

Pick one install path. If the shell install script is not your jam, npm works fine.

# Option A — npm (Node 20+)
npm install -g @qwen-code/qwen-code@latest
qwen --version

# Option B — Homebrew (macOS / Linux)
brew install qwen-code
qwen --version

# Option C — official install script (macOS / Linux)
curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash

Restart the terminal if qwen is not found. Classic. The binary is shy until PATH catches up.

Step 2 — Authenticate

# Configure auth outside a session
qwen auth

# Or start a session and use the slash command
qwen
# then type: /auth

# Check what stuck
qwen auth status

On first login, Qwen creates a ~/.qwen/ workspace for settings and usage tracking. You will live in that folder—bookmark it mentally.

Step 3 — Context layer: QWEN.md

Context is your recipe book: voice, stack, and rules that load every session. Two scopes:

  • Personal: ~/.qwen/QWEN.md — applies everywhere
  • Project: ./QWEN.md in the repo — overrides / adds for this codebase

Fastest project starter—let Qwen read the repo and draft the file:

cd ~/projects/cloudchef-blog
qwen

Inside the session:

/init

/init analyzes the directory and creates (or suggests additions to) QWEN.md with build commands, tests, and conventions it finds. If you already have one, it will not stomp it—it has manners.

Edit personal context manually:

mkdir -p ~/.qwen
nano ~/.qwen/QWEN.md
# QWEN.md — CloudChef personal kitchen rules

## Who I am
- Platform engineer / technical educator (fictional persona: CloudChef)
- Domains: Kubernetes, DevOps, security

## How I work
- Plan before multi-file changes
- Ask if requirements are ambiguous
- Flag production and data-loss risks early

## Output preferences
- Short paragraphs, bullet lists for dense technical content
- Bash/YAML examples must be copy-paste ready

Verify what loaded:

/memory show
/memory refresh

Step 4 — Memory layer: stop repeating yourself

Qwen Code has auto-memory (background notes per project) and explicit commands. For things you always want honored, prefer QWEN.md; auto-memory is best-effort, not gospel.

/remember Prefer 2-space YAML indentation in this repo
/remember Never suggest kubectl delete without --dry-run=client first

/memory
/dream
  • /remember — save a durable preference
  • /memory — open the Memory Manager (toggle auto-memory, review notes)
  • /forget <text> — remove matching auto-memory entries
  • /dream — run consolidation / cleanup on saved memories

Auto-memory files live under ~/.qwen/projects/<project-hash>/memory/. You rarely edit these by hand—think of them as the walk-in fridge Qwen restocks while you sleep.

Step 5 — Skills layer: teach once, invoke forever

Skills are folders with a SKILL.md file (YAML frontmatter + instructions). The model can invoke them when your request matches the description—or you can run one explicitly.

mkdir -p ~/.qwen/skills/write-blog-post
nano ~/.qwen/skills/write-blog-post/SKILL.md
---
name: write-blog-post
description: Turn a topic into a structured CloudChef-style HTML blog post with SEO meta, Problem/Root Cause/Recipe sections. Use when the user asks for a blog post or article.
---

# Write Blog Post

## Inputs
- Topic or title
- Audience (default: DevOps / Kubernetes engineers)

## Process
1. Outline with H2/H3 (Problem, Root Cause, CloudChef Recipe, Pro Tip, Final Thoughts)
2. Include one Mermaid diagram if architecture is involved
3. Add fictional-data disclaimer before Final Thoughts
4. Meta description target: 150 characters

## Output
- HTML for Blogger (no markdown wrappers)
- Copy-friendly code blocks

List and run skills inside a session:

/skills
/skills write-blog-post

# Or ask naturally — the model may pick the skill itself:
"Use the blog skill on topic: rootless Podman on RHEL"

Team kitchen: commit project skills so everyone shares the same recipes:

mkdir -p .qwen/skills/eks-upgrade-checklist
# ... add SKILL.md ...
git add .qwen/skills/
git commit -m "Add Qwen skill for EKS upgrade checklist"

Step 6 — Subagents layer: hire specialists, not a circus

Subagents are delegated workers with their own prompt and tool limits. Create via wizard or by dropping a file in ~/.qwen/agents/ or .qwen/agents/.

/agents create
/agents manage

Example file—~/.qwen/agents/code-reviewer.md (illustrative):

---
name: code-reviewer
description: Reviews code for bugs, security, and style. Use when the user asks for a review or PR feedback without making edits.
approvalMode: plan
tools:
  - read_file
  - grep_search
  - glob
---

You are a senior reviewer for infrastructure code.
Report findings as numbered items: severity, file, issue, suggested fix.
Do not modify files.

Then ask in plain language:

Review the Helm changes in charts/agent-platform for production safety.

Qwen delegates to code-reviewer when the task matches. You watch progress in the UI—like expediting tickets to the right station.

Step 7 (optional) — Local kitchen with Ollama

When code and prompts must stay on your machine, run a model in Ollama and point Qwen Code at its OpenAI-compatible API (http://localhost:11434/v1).

# Install & pull (example model tag — pick what fits your RAM)
brew install ollama
ollama pull qwen2.5:7b
ollama serve

# Quick sanity check
ollama run qwen2.5:7b "Say hello in one sentence"

Configure via environment variables (simplest) or ~/.qwen/settings.json:

export OPENAI_API_KEY="ollama"
export OPENAI_BASE_URL="http://localhost:11434/v1"
export OPENAI_MODEL="qwen2.5:7b"

cd ~/projects/cloudchef-blog
qwen

Inside session, confirm model if needed: /model. RAM guide (rough): 8GB → 7B quantized; 16GB+ → 7B–14B; do not pull a 32B model on a laptop and blame Ollama for the fan concert.


✅ Best Practices

  • Start small: one QWEN.md, one skill, one subagent—then expand
  • Project QWEN.md in git so the team shares context
  • Specific skill descriptions — “helps with documents” never triggers; “extract tables from PDF” does
  • Use approvalMode: plan for reviewers; auto-edit only when you trust the scope
  • /compress long sessions before token bills get spicy
  • Back up ~/.qwen/QWEN.md, settings.json, and .qwen/skills/

⚠️ Common Mistakes

  • Expecting qwen run-pipeline or qwen agent foo CLI flags—the real UI is slash commands and delegation
  • Storing API keys in blog posts or committed settings.json (use env vars)
  • One giant QWEN.md novel nobody maintains—split project vs personal
  • Relying only on auto-memory for safety rules—put hard rules in QWEN.md
  • Skills with vague description fields—the model never picks them
  • Skipping qwen auth status after “why is everything 401” meltdowns

🎯 Quick reference (copy to your notes)

# Install
npm install -g @qwen-code/qwen-code@latest

# Auth
qwen auth
qwen auth status

# Start
cd your-project
qwen

# Essential slash commands
# /init          → generate project QWEN.md
# /memory show   → see loaded context
# /remember ...  → save preference
# /skills        → list skills
# /skills name   → run skill
# /agents create → new subagent
# /auth /model /help /compress
~/.qwen/
├── settings.json
├── QWEN.md
├── skills/<skill-name>/SKILL.md
└── agents/<agent-name>.md

your-repo/
├── QWEN.md
├── .qwen/skills/
└── .qwen/agents/

πŸ”— Continue Your CloudChef Journey


πŸ“š References


Content disclaimer

Unless stated otherwise, examples use fictional or illustrative data (paths, project names, API keys). Always read, adapt, and test commands and configuration in a non-production environment first. In production, use change control, backups, and peer review so you do not cause data loss, secret exposure, misconfiguration, or outages. Qwen Code CLI flags and auth methods change—confirm against official documentation before you run anything.


πŸ”₯ CloudChef Pro Tip

Do not build the full Batcave on day one. Run /init in your noisiest repo, add one skill for the task you repeat weekly (incident summary, PR description, upgrade checklist), and create one subagent in plan mode for reviews. After ten real tasks, open /memory and delete the nonsense auto-memory saved when you were tired. Kitchens need curating too.


πŸš€ Final Thoughts

Setup Qwen Code the CloudChef way and you stop fighting amnesia. Context (QWEN.md) is your menu, memory is your pantry notes, skills are your prep techniques, and subagents are the line cooks who actually stay in their lane.

Four hours of re-prompting can become one clear instruction—if you invest once in the four layers. Then go cook something worth serving.

πŸ‘‰ Run /init tonight. Thank yourself at tomorrow’s standup.


πŸ”₯ Trending CloudChef Recipes

⭐ Popular CloudChef Recipes

No comments:

Post a Comment

πŸ’‘ Found this useful?

Share it with your Team or DevOps Friends πŸ‘‡