Computer Science

Vibe Code Engineering

How to vibe code effectively and scale
In my opinion, agentic coding AI is the future of software engineering. However, we still need a reliable way to control the AI, checking and validation.

Claude is a pioneer in agentic coding AI. It's the most stable and structured so far. I worked on parallel worktree feature with harness and it amazes me. While I like to use Antigravity for their speed, planning and browser debug. The speed of Antigravity is amazing, I can't multitask more than two projects.

Prompt Engineering Tips

The prompt must contain:

  • Clear hierarchy using Markdown
  • Give LLM a role, background, constraints (environments, version), task & goal and IO format
  • Let the model to ask for conformation when it's uncertain
  • Avoid ambiguity and conflicts
  • The cleaner the better

Prompt Examples

Template for a Vibe Coding a Project

I like to drive a few devdocs using markdowm. Each files should focus on one category and located on the top of the specific folder. Use AGENTS.md as the main file to guide the agent. For claude, CLAUDE.md is used.

## Goal

## Keep In Mind

- Write a summary of how each components works and the architecture of the system
- Write the history of method eliminations consideration, tradeoff and conclusion
- Keeps things in modular. Don't over-engineer one-time use component. Start with simple solution, when things starts to duplicate and grow, refactor earlier
- Add comments for non-obiouvs logic, do not remove comments or unrelated code unless specified
- Clean temporary files when the project ends.
- Make reusable scripts and backward compatibility
- Every script must have CLI for your execution

## Architecture Reference

Remember to refer these before doing any related action

- `devdocs/AGENTS.md` — Extended development guidelines. Always read this
- `devdocs/UTILSPEC.md` - Data model and util specs
- `devdocs/FLOWSPEC.md` — Pipeline detail
- `dev/EXPERIMENT_SPEC.md` - Experiment instructions

How to Start and Scale

Start with Prepare PRD (Product Requirements Document) or SDD (Spec-Driven Development). Spend most time and resource on planning. Use lighter model to implement. Start with Minimal Viable Product, the core (v1). Add single feature on each version, and verify before moving (v2).

  • Overview
  • Tech stack
  • Directory architecture
  • Code convention
  • API
  • Test
  • Dependency order and modularity

Prompt Philosophy

Human language is a bridge between human's embedding to AI's embedding. When you don't know the exact term to express, use multiple scenario to scope down the meaning. AI tends to mirror your ideas, being too agreeable. You may say speak like a ..., not just to purely critique you, but to give a "rational" perspective. Stop the AI when it's too agreeable, remind of it's contradictions to train the AI to your expectations.

Kiro

Nuxt

Kiro is an AI agent IDE that can communicate to explore requirements and understanding the specs. After requirements, design, tasks and tests method is confirmed, it will start implement.

Vibe Coding Engineering

Token Engineering

StrategyDescriptionEffect
Prompt TrimmingRemove redundant words, trim System PromptMedium
Context TrimmingKeep the most recent and important conversation records (model will be stupid after 40% of context)High
Summary ReplacementReplace full long conversation history with summary (save on md)High
Tool Result TruncationLimit the amount of data returned by the tool (limit listing)Medium
Model StratificationUse small models for simple tasks (plan) and large models for complex tasks (implement)High
Cache MechanismReuse the results of similar queriesDepends

API have a clever design: It's more expensive per token, this motivates the work to give short and precise input token.

Sub-Agent Engineering

Main goal is to control context, reducing context on main agent, create a abstraction for a specific task returning summary for main agent. Subagent should do the planning, implementation and validation.

  • Make a spec and plan in md files
  • Keep main context clean, reduce noise
  • Save progress in md files
  • One task every session
  • Clean state after a session completion
  • Handle clean info for others
  • Able to reproduce initialization and states
  • Use structured data like JSON to keep consistency
  • Create CLI tool for repeated task

Claude Code

Claude Code

Claude Code Architectual Structure

ComponentsFilesDescription
Context Managementclaude-progress.txt, feature_list.jsonsession (short term memory) and task list (long term memory)
System PromptCLAUDE.mdRole definition + constant rules (system prompt layer)
Lifecycle Hookssettings.json hooks configurationEvent-driven control layer
Sub-agent.claude/agents/ sub-agent role definition (.md files)Sub-agent role definition
Skills.claude/skills/ knowledge base injectionKnowledge base injection
Slash Commands.claude/commands/ SOP (Standard Operating Procedure)Controllable SOP for repetitive tasks
npm install -g @anthropic-ai/claude-code
claude login
claude logout

claude                    # Start a session in terminal
claude -w my-new-feature  # Create a isolated worktree to develop a feature in parallel

Worktree

A worktree is a lighther git clone on another folder to develop in parallel, symlinking shared heavy files. It inherite .gitignore. Add .worktreeinclude to include ignored files.

Session

When the context window is around 40%, Claude Code start to act less smart. So we need to control the context window by prompting.

  • Give a specific example
  • Point a good example
  • Do one thing at a time
  • Flywheel & Guardrail: incrementally tell what not to do

Session Command

CommandDesc
/clearClear context window
/compactSumamrize context window
/remote-controlEnable this session to be accessed by web (claude.ai/code/) or app remotely. Remember to keep the terminal alive
/web-setupAuthenticate with local GitHub credential to run a cloud instance at Anthropic cloud. No local setup required and code at (claude.ai/code/)

Configuring Command Permission

.claude/settings.json
{
  "defaultMode": "acceptEdits",
  "permissions": {
    "allow": [
      "Read(//opt/**)",
      "Bash(./venv/bin/python3 run.py)",
      "Bash(npm run *)",
      "Bash(git *)",
      "Bash(mkdir:*)",
      "Bash(ls:*)",
      "Bash(find:*)",
      "Bash(grep:*)",
      "Write(*)",
      "Read(*)",
      "Bash(tail)"
    ],
    "deny": [
      "Read(.env*)",
      "Bash(rm *)"
    ]
  },
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "echo "Run Test"
          }
        ]
      }
    ]
  }
}
Danger Zone: --dangerously-skip-permissions is "YOLO mode" CLI flag, bypasses all permission checks, allowing Claude Code to execute all operations without any prompts. bypassPermissions is the defaultMode value you set inside settings.json. It skips permission prompts, though writes to .git, .claude, .vscode, .idea, and .husky directories still prompt for confirmation to prevent accidental corruption.

Token

PlanDescription
Pro planReach limit very quick. Suitable for frequent light use.
APIA 2-hour session cost [[]{.katex-mathml}[[[]{.strut style="height:0.8889em;vertical-align:-0.1944em;"} 6perdeveloperperday,with90 ]{.base}]{.katex-html ariaHidden="true"}]{.katex} 12/day
Max 5x ($100/mo)Suitable for heavy user

Subagents

Subagent is child of agent. Parent is the center of orchestration, Claude code can spawn multiple subagent to target specific task, reducing context window.

Agent Teams

A new concept of a team of leads, a shared task list, and specialized teammates sharing messages with one another. This is really beneficial for parallel research and development. However, it might take 3~4x more tokens compared with developing sequentially. Enable it through settings.

settings.json
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

Harnness

Harness is an “architecture/frame” to follow iteratively. Enable the agent to adjust the harness. Allow other agents to specialize in judging. Make the planner and the judger agree before and after implementing

Stage 1 (2-Agent)

Initializer + Coding Agent. The result might not be working

Stage 2 (3-Agent)

Planner + Generator + Evaluator. Create a sprint contract to decide what success looks like

Stage 3

Remove sprint architecture, simplify the code, cleaning and removing debt

Harness concepts changes as AI model evolves

Philosophy of Using AI as a Software Engineer

Learning Tips

  • Let AI to teach you how to ask
  • Let AI asks you: “what background knowledge will help him answer better?”
  • Ask AI architectural reason > why do this > how to do > do it

The best way to learn a framework: Debug manually first, only ask for assistance when you're stuck for a long time.

Role as Software Engineer

  • Explain tech to other people
  • Find consensus in blurry requirements
  • AI don’t understand business
  • AI is tool not brain
  • When everything is important, what’s important? You only have 24 hours daily

Copyright © 2026 Nut17. All rights reserved.