You are Claude Code, Anthropic's official CLI for Claude.
You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Track props access and selectively rerun callbacks on rerender. | |
| export function track<Props extends object>( | |
| ...callbacks: ((props: Props) => void)[] | |
| ) { | |
| const tracked = callbacks.map((callback) => new TrackedCallback(callback)) | |
| let oldProps: Props | undefined | |
| return (props: Props) => { | |
| tracked.forEach((callback) => { | |
| if (!oldProps || callback.shouldUpdate(props, oldProps)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "workbench.editor.customLabels.patterns": { | |
| "**/src/**/*.astro": "${filename}", | |
| "**/src/**/*.svelte": "${filename}", | |
| "**/src/**/*.css": "${filename}", | |
| "**/src/stores/**/*.js": "${filename} (Store)", | |
| "**/src/routes/+page.svelte": "Home (Page)", | |
| "**/src/routes/**/+page.svelte": "${dirname} (Page)", | |
| "**/src/routes/**/+layout.svelte": "${dirname} (Layout)", | |
| "**/src/pages/**/*.astro": "${dirname}/${filename} (Page)", | |
| "**/src/layouts/**/*.astro": "${filename} (Layout)", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Event, events, EventTarget, on } from './framework.ts' | |
| // Extending a built-in class with type-safe events | |
| declare global { | |
| interface Worker { | |
| // Does not exist at runtime. No createEventType wrapper needed. | |
| $rmxEvents: { | |
| message: MessageEvent | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { RoutePattern } from '@remix-run/route-pattern' | |
| import { queryCache } from './query.ts' | |
| const userProfileRoute = new RoutePattern('/users/:id') | |
| type UserProfile = { | |
| name?: string | |
| email?: number | |
| biography?: string | |
| avatar?: string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { hydrated, type Remix } from "@remix-run/dom"; | |
| import { press } from "@remix-run/events/press"; | |
| import { | |
| QueryClient, | |
| QueriesObserver, | |
| type QueryObserverOptions, | |
| } from "@tanstack/query-core"; | |
| type Todo = { | |
| userId: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export async function BlueSkyPost() { | |
| const url = new URL('https://bsky.app/profile/danabra.mov/post/3la62zxt4rs2j'); | |
| const details = url.pathname.split('/').filter(Boolean).reduce((acc, part, index, pathParts) => { | |
| if (index % 2 === 0 && pathParts[index + 1]) { | |
| acc[part] = pathParts[index + 1]; | |
| } | |
| return acc; | |
| }, {} as Record<'post' | 'profile' | string, string>); | |
| const endpoint = new URL('https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread'); | |
| const params = new URLSearchParams(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| AppBskyEmbedVideo, | |
| AppBskyVideoDefs, | |
| AtpAgent, | |
| BlobRef, | |
| } from "npm:@atproto/api"; | |
| const userAgent = new AtpAgent({ | |
| service: prompt("Service URL (default: https://bsky.social):") || | |
| "https://bsky.social", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ContentView.Swift | |
| // KeyboardAttachedView | |
| // | |
| // Created by Gavin Nelson on 8/19/24. | |
| // | |
| import SwiftUI | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public extension View { | |
| func task<T: Equatable>( | |
| id: T, | |
| priority: TaskPriority = .userInitiated, | |
| @_inheritActorContext _ action: @Sendable @escaping (T, T) async -> Void | |
| ) -> some View { | |
| self.modifier(TaskViewModifier(id: id, priority: priority, action: action)) | |
| } | |
| } |
NewerOlder