The runtime/ directory contains project-local Claude configuration that the application loads at runtime through the Claude Agent SDK. This is separate from the development-time .claude/ configuration used by Claude Code during implementation.
runtime/
├── CLAUDE.md # Agent instructions loaded into context
└── .claude/
├── settings.json # Permission and tool restrictions
├── rules/
│ ├── agent-runtime.md # Behavioral constraints
│ ├── structured-output.md # JSON output formatting rules
│ └── newsletter-quality.md # Editorial quality standards
├── agents/
│ ├── relevance-scorer.md # Scoring agent definition
│ ├── article-summarizer.md # Summarization agent definition
│ └── newsletter-editor.md # Editor agent definition
├── skills/
│ ├── newsletter-editorial-policy/SKILL.md
│ └── rss-source-evaluation/SKILL.md
└── hooks/
└── block-dangerous-bash.py # Defense-in-depth safety hook
The SDK runner in src/personal_rss_newsletter_agent/sdk_runner.py sets:
ClaudeAgentOptions(
cwd=str(runtime_dir), # Points to runtime/
setting_sources=["project"], # Loads .claude/ from cwd only
allowed_tools=[], # No filesystem tools needed
permission_mode="bypassPermissions",
output_format={"type": "json_schema", "schema": ...},
)When setting_sources=["project"] is set with cwd pointing to runtime/:
runtime/CLAUDE.mdis loaded as project instructionsruntime/.claude/settings.jsondefines permissionsruntime/.claude/rules/*.mdprovide behavioral rulesruntime/.claude/agents/*.mddefine available subagentsruntime/.claude/skills/*/SKILL.mdprovide on-demand knowledge
Scores articles 0-10 based on user profile relevance. Receives article data in the prompt, returns RelevanceResponse JSON.
Produces 1-2 sentence summaries with "why it matters" explanations. Receives scored articles, returns SummaryResponse JSON.
Selects top items, assigns ranks, generates newsletter title. Receives summaries, returns EditorResponse JSON.
- No tools allowed:
allowed_tools=[]prevents agents from using Read, Write, Bash, or any filesystem tools. - Deny list:
settings.jsonexplicitly denies Bash, Write, Edit, WebFetch, and WebSearch. - Defense-in-depth hook:
block-dangerous-bash.pyblocks dangerous patterns even if tool restrictions are bypassed. - Data-in/data-out: Agents receive all data in the prompt and return structured JSON. No file access needed.
| Aspect | Development (.claude/) |
Runtime (runtime/.claude/) |
|---|---|---|
| Purpose | Guide Claude Code during implementation | Configure agents at application runtime |
| Loaded by | Claude Code CLI | Claude Agent SDK via query() |
| Contains | Dev rules, hooks, skills for code review | Agent definitions, quality rules |
| Location | Repository root .claude/ |
runtime/ subdirectory |
The runtime agents authenticate using whatever credentials are available:
- Claude Code login — Existing
claudeCLI authentication (local development) - ANTHROPIC_API_KEY — Environment variable (CI, containers, API-key based)
No secrets are stored in the runtime configuration directory.