Working Efficiently and Reproducibly with Claude Code's Memory, Subagent, and Skills
llmClaude Code has several mechanisms for working efficiently and reproducibly without relying on repeated instructions or LLM judgment. Memory retains knowledge across sessions. Subagent delegates tasks to specialized agents and isolates context. Skills define reusable instruction sets. Hooks ensure deterministic execution of lifecycle events.
Memory
Memory is a set of files loaded at session start. It’s recommended to keep it concise and only include information that cannot be inferred from code. Place CLAUDE.md in the project root to share with your team. ~/.claude/CLAUDE.md applies to all projects as personal settings, while ./CLAUDE.local.md is for project-specific personal settings. Claude Code automatically adds CLAUDE.local.md to .gitignore. You can generate a template based on your project structure with /init.
# Project
Tech blog built with Hugo.
## Commands
- Build: `hugo`
- Dev server: `hugo server -D`
## Rules
- Create articles at `content/article/{number}/index.md`
- Always specify language in code blocks
.claude/rules/ can contain path-scoped rules.
<!-- .claude/rules/testing.md -->
---
paths:
- "tests/**/*.test.ts"
---
Use Jest. Maintain 80%+ coverage.
Subagent
Subagent executes tasks in its own context and returns only a summary. This isolates large outputs and saves the main context window. Built-in agents include Explore for codebase exploration running on Haiku, and Plan for investigation in plan mode.
<!-- .claude/agents/security-reviewer/SKILL.md -->
---
name: security-reviewer
description: Review code for security issues
tools: Read, Grep, Glob
model: sonnet
---
Check for SQL injection, XSS, and authentication issues.
Tools and permissions are inherited by default, but Skills and parent conversation history are not passed. Tools are built-in capabilities like Read, Write, and Bash that Claude Code uses for operations, extensible via MCP. Subagent invocation is also done through the Task tool.
Registering Tasks to Todoist via MCP - sambaiz-net
Skills
Skills define instruction sets. While Memory is always fully loaded, Skills only have their description in context, with full content loaded when invoked. You can also invoke them directly with /skill-name.
$ARGUMENTS is replaced with invocation arguments, and !command is replaced with execution results. It follows an open specification and is supported by other tools like Codex and Gemini CLI.
<!-- .claude/skills/deploy/SKILL.md -->
---
name: deploy
description: Deploy application
allowed-tools: Bash(npm *), Bash(git *)
---
Deploy to $ARGUMENTS environment.
Current branch: !`git branch --show-current`
1. Run tests
2. Build
3. Run deploy script
Vercel operates a service called skills.sh where you can install skills with npx skills add. Claude Code also has its own distribution format called Plugins, which bundles Skills, Agents, Hooks, and MCP servers for installation via /plugin install.