← All Commands 📥 Capture

/note-snippet

Code Snippet

Two modes: reference a file with line range (src/auth.swift:10-25) or paste inline code. Language auto-detected from extension or syntax. Add annotations with " -- " separator for context. Max ~50 lines.

Quick Example

Claude Code
/note-snippet src/auth.swift:10-25

Reads lines 10-25, detects Swift, adds source citation.

Screenshot Placeholder

Result: Code Snippet sticky note (purple color) created from the command above

Key Features

📂

File Reference Mode

Point to file:lines (src/auth.swift:10-25) — reads the file and extracts exactly those lines with source citation.

💻

Inline Code Mode

Paste code directly — language detected from syntax patterns (imports, brackets, keywords).

🏷️

Smart Title

Analyzes code to generate a descriptive title (max 6 words) — "JWT Token Validation", "React Auth Hook".

💬

Annotations

Use " -- " separator to add context: /note-snippet src/auth.ts:5-20 -- JWT validation logic for reference.

Real-World Examples

From file

/note-snippet src/auth.swift:10-25

Reads lines 10-25, detects Swift, adds source citation.

Inline with note

/note-snippet const token = jwt.sign(payload, secret) -- JWT signing example

JavaScript detected, annotation added below code block.

Config reference

/note-snippet tsconfig.json:1-15 -- Base TypeScript config

JSON config with context annotation.

Two Modes

Mode 1: File Reference

Point to a file with optional line range:

/note-snippet src/auth.swift:10-25

This reads the file, extracts lines 10-25, detects the language from the file extension, and adds a source citation to the note.

Mode 2: Inline Code

Paste code directly:

/note-snippet const token = jwt.sign(payload, secret, { expiresIn: '1h' })

Language is detected from syntax patterns — imports, brackets, keywords, operators.

Annotations

Add context after the -- separator:

/note-snippet src/auth.ts:5-20 -- JWT validation logic for the middleware refactor

The annotation appears below the code block in the note, providing context for why you saved this snippet.

Language Detection

SourceDetection Method
File referenceFile extension (.ts, .py, .swift, etc.)
Inline codeSyntax analysis (imports, keywords, operators)

Smart Titles

AI generates a descriptive title (max 6 words) by analyzing the code:

  • JWT Token Validation for auth code
  • React Auth Hook for a custom hook
  • Docker Compose Config for infrastructure

Limits

  • Maximum ~50 lines per snippet
  • Longer snippets are truncated with a note indicating the full length
  • For larger code sections, consider saving to a file instead

Animated GIF Placeholder

Full demo: typing /note-snippet in the terminal, AI processing the input, and a purple sticky note appearing on screen with the formatted result

Try It Now

Download SlashNote and install the Claude Code plugin

Download on the App Store