Code Story

Code Story Prologue

motivation, getting started, chapter index, references

0.0  Prologue

Code Track is a place to experiment — with language features, AI tools, multi-language project comparisons, and code-generation utilities. This story is a narrative guide through those experiments, ordered from the most hands-on (building a scratch arena with real measurement tools) through progressively more capable AI workflows: chat bots → CLI agents → API calls → tool-using agents → agentic pipelines → reusable skill libraries → spec-driven development.
Why study AI-assisted code development?
  1. AI tools shift the bottleneck from writing code to reviewing and guiding it. Understanding that shift makes you a more effective user of the tools.
  2. Knowing how LLMs work — message roles, context windows, tool use, prompt caching — lets you use them reliably instead of hoping they produce what you want.
  3. Agents with tool use can read your files, run your tests, and iterate without manual steps between each action.
  4. Spec-driven development inverts the usual workflow: you write what the code must do before the code exists, and the spec becomes the AI’s contract.
  5. Comparing the same project in Rust, C++, C#, and Python builds intuition about what language features actually cost in code size, complexity, and runtime performance.
The story uses two recurring example projects — TextFinder (search a directory tree for regex matches) and PageValidator (check HTML structural correctness) — alongside the AI/ folder demos to keep discussion grounded in real, runnable code.

0.1  Getting Started

Install these tools in order — each chapter builds on what came before.
  1. VS Code with language extensions:
    rust-analyzer (Rust), clangd (C++), C# Dev Kit (C#), Pylance (Python), Error Lens and GitLens (all languages).
  2. At least one language toolchain:
    Rust, a C++ compiler (MSVC, GCC, or Clang), .NET SDK for C#, or Python 3.
  3. Git and a GitHub account.
  4. An Anthropic API key (required for chapters 4–8):
    Create one at console.anthropic.com and set it as the environment variable ANTHROPIC_API_KEY.
  5. Python package: anthropic
    pip install anthropic

0.2  Story Content

The story is ordered so each chapter provides vocabulary and tools used in the next. Start at the beginning or jump to any chapter — each is written to be readable on its own.
  1. Prologue

    Motivation, getting started, chapter index, and references.
  2. Experimenting with Code

    Building a scratch arena with build chains, metrics tools, performance timers, and visualizers.
  3. Chat Bots

    Using Claude, ChatGPT, and Gemini through the browser to analyze, generate, and document code.
  4. Code AI CLI

    Claude Code and Gemini CLI as terminal-based coding partners — reading files, making changes, multi-step tasks, hooks.
  5. LLM API

    Calling Claude directly from Python: the messages API, structured output, streaming, and prompt caching.
  6. Agent AI

    Tool use, the agentic loop, a working file-reading agent, error handling, and safety constraints.
  7. Agentic AI

    Multi-step autonomous workflows: analyze → plan → generate → test, chaining agent calls, human-in-the-loop checkpoints.
  8. Skills AI

    Extending agents with a reusable tool library: anatomy of a skill, a code_metrics example, composing multiple tools in one session.
  9. Spec-Driven Development

    Using Constitution.md, Structure.md, and Spec.md to drive AI implementation; the full workflow from spec to code to validation.

0.3  References

Resource Description
Anthropic Docs Full API reference, model guides, and prompt engineering tips.
Claude Code Anthropic’s CLI tool — install, keyboard reference, and docs.
CodeBites Introduction Track page that maps the full CodeBites page sequence.
AI Links Curated links to AI tools, documentation, and research.