# How the Claude-Certification Skill Manages Persistent State in CLAUDE-CERTIFICATION.md

> Discover how the claude-certification skill uses CLAUDE-CERTIFICATION.md as an append-only ledger. Manage persistent state, resume sessions, and get audit trails seamlessly.

- Repository: [Rohit Ghumare/ai-engineering-from-scratch](https://github.com/rohitg00/ai-engineering-from-scratch)
- Tags: internals
- Published: 2026-08-29

---

**The claude-certification skill uses a single markdown file, CLAUDE-CERTIFICATION.md, as an append-only ledger that tracks the learner's entire certification journey through structured tables, enabling seamless session resumption and complete audit trails.**

The claude-certification skill in the rohitg00/ai-engineering-from-scratch repository implements a robust persistent state management system that treats [`CLAUDE-CERTIFICATION.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/CLAUDE-CERTIFICATION.md) as the single source of truth for learner progress. Unlike volatile memory-based approaches, this skill writes every lesson completion, quiz score, and assessment attempt to a plain markdown file, ensuring no progress is lost between sessions.

## State File Lifecycle and Mode Detection

The skill determines its operating mode by checking for the existence of [`CLAUDE-CERTIFICATION.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/CLAUDE-CERTIFICATION.md) in the workspace root. According to lines 20-22 of [`.claude/skills/claude-certification/SKILL.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/.claude/skills/claude-certification/SKILL.md), if the file exists, the skill immediately enters **Lesson mode** to continue existing progress; otherwise, it initializes **Onboarding mode** to guide new learners through track selection.

### Initializing the State File

When a learner selects a certification track for the first time, the skill generates a fresh [`CLAUDE-CERTIFICATION.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/CLAUDE-CERTIFICATION.md) using a structured template defined at line 108 of the skill definition. The skill populates this template by reading domain weights and lesson sequences from `certifications/claude/tracks/*.json` and policy data from [`certifications/claude/program.json`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/certifications/claude/program.json):

```python
template = """# My Claude Certification Path

<!-- Managed by the claude-certification skill.
     Repo: https://github.com/rohitg00/ai-engineering-from-scratch -->

## Goal

{goal}

## Active track

- Exam code: {exam_code}
- Track file: certifications/claude/tracks/{exam_code_lower}.json
- Started: {date}
- Pace: {hours_per_week}
- Diagnostic: not taken

## Route

| # | Lesson path | Domains | Status | Quiz | Evidence |

|---|-------------|---------|--------|------|----------|
{route_rows}

## Domain readiness

| Domain | Blueprint weight | Latest practice | Status |
|--------|------------------|-----------------|--------|
{domain_rows}

## Review queue

| Domain | Lesson path | Reason | Status |
|--------|-------------|--------|--------|
{review_rows}

## Assessment attempts

| Date | Assessment | Raw score | Conditions | Weak domains |
|------|------------|-----------|------------|--------------|
{attempt_rows}
"""
with open("CLAUDE-CERTIFICATION.md", "w") as f:
    f.write(template.format(...))

```

This template creates six distinct sections: Goal declaration, Active track metadata, Route progress table, Domain readiness matrix, Review queue, and Assessment attempts log.

## Append-Only State Updates

The skill follows a strict append-only policy for all state modifications. As documented in lines 43-45 of [`SKILL.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/SKILL.md), the system never overwrites existing rows or deletes historical data, preserving a complete forensic record of the learning journey.

### Tracking Lesson Completion

After each lesson, the skill appends a new row to the Route table containing the lesson path, associated domains, completion status, quiz percentage, and evidence file path. This append operation uses Python file I/O to add lines without altering previous entries:

```python
def append_route(lesson_path, domains, status, quiz_score, evidence_path):
    line = f"| {next_id} | {lesson_path} | {domains} | {status} | {quiz_score}% | {evidence_path} |\n"
    with open("CLAUDE-CERTIFICATION.md", "a") as f:
        f.write(line)

```

### Recording Assessment History

Similarly, every assessment attempt generates a new entry in the Assessment attempts table (lines 63-65), capturing the date, raw score, testing conditions, and identified weak domains. This append-only approach maintains an immutable history of performance trends.

## State Archiving and Reset Workflow

When a learner explicitly requests to restart their certification journey, the skill does not delete the existing state. Instead, following lines 67-69 of the skill definition, it archives the current file by renaming it to `CLAUDE-CERTIFICATION-<exam-code>-<YYYY-MM-DD>.md`, preserving all historical progress for future reference while clearing the workspace for a fresh start.

```python
import datetime, shutil
archive_name = f"CLAUDE-CERTIFICATION-{exam_code}-{datetime.date.today()}.md"
shutil.move("CLAUDE-CERTIFICATION.md", archive_name)

```

## Resuming Sessions from Persistent State

On subsequent invocations, the skill parses the stored markdown tables to reconstruct the learner's context. By reading the Route table, the skill identifies the next incomplete lesson; by analyzing the Domain readiness section, it calculates knowledge gaps; and by checking the Review queue, it surfaces pending reinforcement items. This parsing enables seamless continuation of the tutoring flow without requiring the learner to repeat previous steps.

## Summary

- The claude-certification skill treats [`CLAUDE-CERTIFICATION.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/CLAUDE-CERTIFICATION.md) as the single source of truth for all learner progress.
- Mode detection relies on file existence checks at lines 20-22 of [`.claude/skills/claude-certification/SKILL.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/.claude/skills/claude-certification/SKILL.md).
- The skill employs an append-only update strategy that never deletes or modifies historical rows.
- State archiving preserves previous attempts via timestamped file renaming rather than deletion.
- Resume functionality parses markdown tables to restore exact session context and determine the next lesson.

## Frequently Asked Questions

### What triggers the creation of CLAUDE-CERTIFICATION.md?

The state file is created during the **Onboarding mode** workflow when a learner first selects a certification track. The skill populates the file using a template defined at line 108 of [`SKILL.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/SKILL.md), which structures the document with sections for goals, active track metadata, and empty tables for route progress and assessment attempts.

### Why does the skill use an append-only update strategy?

The append-only approach ensures forensic integrity of the learning journey. By never overwriting existing rows in the Route or Assessment tables (as specified in lines 43-45), the skill maintains a complete audit trail of every lesson attempt, quiz score, and performance metric, enabling longitudinal analysis of progress.

### How does the skill handle restarting a certification track?

Rather than deleting existing state, the skill archives the current [`CLAUDE-CERTIFICATION.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/CLAUDE-CERTIFICATION.md) by renaming it to include the exam code and current date (e.g., [`CLAUDE-CERTIFICATION-CLAUDE-101-2024-01-15.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/CLAUDE-CERTIFICATION-CLAUDE-101-2024-01-15.md)). This archiving mechanism, defined at lines 67-69, preserves historical attempts while allowing a fresh state file to be generated for the new attempt.

### What data structures are stored in the state file?

The markdown file contains five primary data structures: the **Route table** tracking lesson-by-lesson progress with quiz scores and evidence paths; the **Domain readiness matrix** mapping knowledge areas to current competency levels; the **Review queue** listing lessons requiring reinforcement; the **Assessment attempts log** recording exam scores and conditions; and metadata sections defining the active track and learner goals.