/claude-pack:clade-data-handlingfrom claude-pack
Manages sensitive data when building with Claude — PII redaction, 200K token context window optimization, conversation trimming, and data retention policies.
Ships in claude-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Handle data responsibly when building with Claude — manage the 200K token context window efficiently, implement conversation trimming strategies, redact PII before sending to the API, and configure data retention settings.
Claude models have a 200K token context window. Managing it efficiently is critical.
// Count tokens before sending
const count = await client.messages.countTokens({
model: 'claude-sonnet-4-20250514',
messages,
system: systemPrompt,
});
// Budget: 200K total - max_tokens (output) = available input
const MAX_CONTEXT = 200_000;
const MAX_OUTPUT = 4096;
const inputBudget = MAX_CONTEXT - MAX_OUTPUT;
if (count.input_tokens > inputBudget) {
// Trim oldest messages, keep system prompt + recent context
messages = trimToFit(messages, inputBudget);
}
function trimConversation(messages: MessageParam[], maxTokens: number): MessageParam[] {
// Always keep the first message (often contains key context)
// Keep the most recent messages
// Drop middle turns first
if (messages.length <= 4) return messages;
const first = messages[0];
const recent = messages.slice(-6); // Last 3 turns
return [first, ...recent];
}
// Strip PII before sending to Claude (if not needed for the task)
function redactPII(text: string): string {
return text
.replace(/\b[\w._%+-]+@[\w.-]+\.\w{2,}\b/g, '[EMAIL]')
.replace(/\b\d{3}[-.]?\d{3}[-.]?\d{4}\b/g, '[PHONE]')
.replace(/\b\d{3}-\d{2}-\d{4}\b/g, '[SSN]')
.replace(/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g, '[CARD]');
}
| Error | Cause | Solution |
|---|---|---|
| API Error | Check error type and status code | See clade-common-errors |
See Context Window Management (token counting + budget), Conversation Trimming function, and PII Handling regex patterns above.
See clade-enterprise-rbac for organization and access management.
clade-install-authWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin claude-pack32 skills in this plugin
/clade-advanced-troubleshootingDebug complex Claude issues — inconsistent outputs, tool use failures,
Use when working with advanced-troubleshooting patterns.
streaming problems, and edge cases.
Trigger with "claude inconsistent", "anthropic advanced debug",
"claude tool use broken", "anthropic streaming issues".
/clade-architecture-variantsBuild different types of Claude-powered applications — chatbots, RAG systems,
Use when working with architecture-variants patterns.
agents, content pipelines, and code generation tools.
Trigger with "claude architecture", "anthropic rag", "build with claude",
"claude agent pattern", "anthropic app design".
/clade-Other plugins' skills for the same job