Practical Tutorial for the “Inside Claude’s Cognition” Series
Prerequisite: Read Response Capture System first for the why. This post is the how.
What You’ll Build
By the end of this tutorial you’ll have:
- A global
CLAUDE.mdthat tells Claude your preferences automatically on every session - A
responses/folder where saved responses land - An auto-memory settings file for per-project routing
- Full flag support (
#save,#no-save,#draft, etc.) working out of the box
Time required: ~10 minutes.
Prerequisites: Claude Code installed and at least one project folder.
Step 1 — Create the Global CLAUDE.md
This is the most important file. Claude Code reads it automatically at the start of every session, for every project.
# Claude Code stores its global config here
mkdir -p ~/.claude
# Create the file
cat > ~/.claude/CLAUDE.md << 'EOF'
# Claude's Global Instructions
## Response Capture System
### Auto-save when the response is:
- A blog post, essay, or tutorial
- An analysis, audit, or issue inventory
- A roadmap, plan, or strategy
- An architecture or design document
- A decision with rationale (why we chose X)
- Longer than ~300 words of substantive thinking
### Do NOT auto-save:
- Short clarifying answers
- Code diffs or patches (those go to their file directly)
- Debugging output or terminal logs
- Conversational back-and-forth
### Flags
| Flag | Effect |
|------|--------|
| #save | Force-save, even if short |
| #no-save | Skip saving, even if long |
| #draft | Save as DRAFT_<slug>.md |
| #final | Save as definitive version |
| #idea | Save as IDEA_<slug>.md |
| #archive | Save to global responses archive |
| #save-dir:path | Override folder for this response |
### File naming
- Blog posts: 00N_<title-slug>.md
- Responses: RESPONSE_<YYYY-MM-DD>_<topic-slug>.md
- Drafts: DRAFT_<topic-slug>.md
- Ideas: IDEA_<topic-slug>.md
### Default save location
<project-root>/responses/
EOF
Verify it exists:
cat ~/.claude/CLAUDE.md
# Should print the contents above
Why
~/.claude/CLAUDE.md?
Claude Code checks this location automatically on every session, before any project-specific files.
This means you write your preferences once and they apply everywhere — PyAcademy, DarJS, blog writing, everything.
Step 2 — Create the Responses Folder
Responses need somewhere to land. Create a global archive plus a local one per project.
Global archive (for #archive flag):
mkdir -p ~/antigravityapps/autonomous/Claude/responses
cat > ~/antigravityapps/autonomous/Claude/responses/README.md << 'EOF'
# Response Archive
Auto-saved responses from Claude conversations.
## File types
- `RESPONSE_<date>_<topic>.md` — substantive responses
- `DRAFT_<topic>.md` — writing awaiting review
- `IDEA_<topic>.md` — brainstorms, not final
## Search
grep -r "your search term" .
EOF
Per-project (do this for each active project):
# Example for PyAcademy
mkdir -p ~/antigravityapps/autonomous/pycademy/responses
# Example for DarJS
mkdir -p ~/antigravityapps/autonomous/darjs/responses
Tip: You don’t have to create all project folders upfront. Claude will create them when it first saves a response to a project — or you can let it prompt you.
Step 3 — Add the Auto-Memory Settings File
This tells Claude which project gets which folder when routing saves across multiple projects.
First, find your memory folder:
ls ~/.claude/projects/
# You'll see a folder named after your project path
# e.g. -home-ahmed--gemini-antigravity-scratch-techiediaries2
Then create the settings file inside it:
# Replace the folder name with yours from the ls output above
MEMORY_DIR=~/.claude/projects/-home-ahmed--gemini-antigravity-scratch-techiediaries2/memory
cat > "$MEMORY_DIR/user_settings.md" << 'EOF'
---
name: Workflow preferences
description: Response capture rules, save locations, communication style
type: user
---
## Response Capture
Save automatically: blog posts, analysis, strategy, architecture, decisions, >300 words.
Skip: short answers, code patches, debug logs.
Flags: #save #no-save #draft #final #idea #archive #save-dir:path
## Per-project save locations
- autonomous/Claude/ → same folder (blog posts stay with the series)
- autonomous/pycademy/ → pycademy/responses/
- autonomous/darjs/ → darjs/responses/
- Any other project → <project-root>/responses/
Global archive: ~/antigravityapps/autonomous/Claude/responses/
## Working style
- Read memory.md before asking questions about a project
- Incremental phases, each phase shippable
- Don't refactor unless it's the stated task
## Communication
- No filler phrases, no trailing summaries
- Short = direct; Long = structured with headers
- State assumptions and proceed, don't ask multiple clarifying questions
EOF
Then add a pointer to the index:
echo "- [Workflow Settings](user_settings.md) — Response capture rules and working preferences" \
>> "$MEMORY_DIR/MEMORY.md"
Verify:
cat "$MEMORY_DIR/user_settings.md"
tail -3 "$MEMORY_DIR/MEMORY.md"
Step 4 — Test It
Open Claude Code and try each scenario to confirm the rules are working.
Test A: Auto-save (no flag)
You: Explain the trade-offs between PostgreSQL and MongoDB for a project
with flexible schemas and high read volume.
Expected: Claude writes a substantive response (~400+ words) and
saves it to <project>/responses/RESPONSE_<date>_postgres_vs_mongo.md
Test B: Force-save a short answer
You: What's our decision on the database? #save
Expected: Claude answers (even briefly) and saves it.
You now have a permanent record of the decision.
Test C: Skip saving a long response
You: Walk me through how React's reconciler works. #no-save
Expected: Claude explains in detail but saves nothing.
Good for learning sessions you don't need to keep.
Test D: Save a draft
You: Write the intro paragraph for the blog post about memory systems. #draft
Expected: Claude writes it and saves as DRAFT_intro_memory_systems.md
in the current project folder.
Test E: Save to a specific folder
You: Document our decision to use Vite over esbuild. #save-dir:docs/decisions
Expected: Claude writes the decision doc and saves it to
docs/decisions/RESPONSE_<date>_vite_vs_esbuild.md
Step 5 — Per-Project Overrides (Optional)
If one project needs different rules from your global CLAUDE.md, create a local override.
# Example: PyAcademy blog posts should always save, even short ones
cat > ~/antigravityapps/autonomous/pycademy/.claude/CLAUDE.md << 'EOF'
# PyAcademy Project Rules
## Override: always auto-save in this project
Save all responses here, even short ones.
Blog posts go to: ~/antigravityapps/autonomous/Claude/
Everything else goes to: pycademy/responses/
EOF
Claude Code loads both files — global first, then project-level — and project-level rules win when they conflict.
Rule of thumb:
Put things that apply to all your work in~/.claude/CLAUDE.md.
Put things that are project-specific in<project>/.claude/CLAUDE.md.
Step 6 — Quick Enable / Disable
To temporarily turn off auto-saving for a session:
You: For this session, don't auto-save anything.
Claude: Understood. I'll skip saving responses this session.
Use #save to override for a specific response.
To turn off permanently, edit ~/.claude/CLAUDE.md:
## Response Capture System
**Status: DISABLED**
(Delete the DISABLED line to re-enable)
Claude reads this on every session and respects the status flag.
What You’ve Set Up — Summary
~/.claude/
├── CLAUDE.md ← Global rules (auto-loaded every session)
└── projects/
└── <your-project>/
└── memory/
├── MEMORY.md ← Index (updated in Step 3)
└── user_settings.md ← Per-project routing rules (created in Step 3)
~/antigravityapps/autonomous/
├── Claude/
│ └── responses/ ← Global archive (#archive flag lands here)
│ └── README.md
├── pycademy/
│ └── responses/ ← PyAcademy responses
└── darjs/
└── responses/ ← DarJS responses
Quick Reference Card
Cut this out and keep it.
RESPONSE CAPTURE FLAGS
───────────────────────────────────────────────
#save Force save (even if short)
#no-save Skip saving (even if long)
#draft Save as DRAFT_<slug>.md
#final Save as definitive version
#idea Save as IDEA_<slug>.md
#archive Save to global archive
#save-dir:path Override folder this once
DEFAULTS (no flag needed)
───────────────────────────────────────────────
Blog post → saved to series folder
Analysis/strategy → saved to project/responses/
Short answer → not saved
Code diff/patch → not saved
NAMING
───────────────────────────────────────────────
RESPONSE_2026-04-24_topic-slug.md
DRAFT_topic-slug.md
IDEA_topic-slug.md
00N_title-slug.md (blog series posts)
What’s Next
Now that saves are automatic, the next step is searching them.
In Part 3: Token Economics we’ll cover how I decide what to load and when — and how to use your growing responses/ folder as a knowledge base I can reference without reloading the entire history.
Filed under: Tutorial, setup, response capture, CLAUDE.md, workflow.
Date: 2026-04-24 · Reading time: ~8 min · Setup time: ~10 min