Skip to content

/init-context

Creates the three context files for a new project.

What It Creates

FileLocationPurpose
CLAUDE.mdProject rootEntry point (auto-loaded by Claude Code)
STATUS.mdcontext/Current state, Working Set, next actions
DECISIONS.mdcontext/Append-only decision log

When to Use

Use this command:

  • For new projects with no context files
  • After installing the AI Context System for the first time

Note:

  • Never overwrites existing files (reports them as "Already exists")

Usage

bash
/init-context

The command:

  1. Detects project information from package.json, README.md, etc.
  2. Creates CLAUDE.md at project root with Session Loop instructions
  3. Creates context/ directory with STATUS.md and DECISIONS.md
  4. Reports what was created

What Gets Created

CLAUDE.md (Project Root)

markdown
> **Session Loop**
> 1. Start → Read `context/STATUS.md`
> 2. End → Run `/save`

# [Project Name]

[Auto-detected or prompted description]

## Commands

Run: `[detected command]`
Test: `[detected command]`
Build: `[detected command]`

## Constraints

- Don't refactor unrelated code
- Keep PRs under 300 lines
- If you need to touch files outside Working Set, pause, propose, update Working Set, then proceed

## Context

- Status: `context/STATUS.md`
- Decisions: `context/DECISIONS.md`

context/STATUS.md

markdown
# Status

SchemaVersion: 1
LastUpdated: [today]
HeadCommit: [git SHA or N/A]
Objective: TBD

## Working Set

- TBD

## Next Actions

- TBD

## Blocked On

- (None)

context/DECISIONS.md

markdown
# Decisions

Append-only log.

---

[Empty - decisions will be added as they're made]

Auto-Detection

The command automatically detects:

SourceInformation
package.jsonProject name, description, npm scripts
Cargo.tomlRust project info
pyproject.tomlPython project info
go.modGo project info
README.mdProject description
GitRepository URL, current HEAD

Example Output

bash
/init-context

📦 Detected: my-app (Next.js + TypeScript)

 Created:
   CLAUDE.md (project root)
   context/STATUS.md
   context/DECISIONS.md

Next steps:
1. Review CLAUDE.md - customize if needed
2. Read context/STATUS.md
3. Start working
4. Run /save at end of session

If Context Already Exists

If context files already exist, the command reports them without overwriting:

bash
/init-context

Already exists: CLAUDE.md
Already exists: context/STATUS.md
Already exists: context/DECISIONS.md

No files created (all already exist).

To reset: Delete the files manually, then run /init-context again:

bash
rm CLAUDE.md && rm -rf context/
/init-context

After Initialization

  1. Review CLAUDE.md — Customize project description and commands
  2. Start the Session Loop:
    • Read context/STATUS.md to see current state
    • Work on your project
    • Run /save when done

Troubleshooting

Files not created

Check: Are you in the project root?

bash
pwd
# Should be /path/to/your-project (not a subdirectory)

Wrong project info detected

Solution: Edit the files manually after creation. The auto-detection is a starting point, not the final word.

Already have CLAUDE.md

Solution: The command won't overwrite it. Add the Session Loop blockquote manually at the top of your existing CLAUDE.md:

markdown
> **Session Loop**
> 1. Start → Read `context/STATUS.md`
> 2. End → Run `/save`

See Also