Skip to main content

List Snippets

GET /api/projects/:projectId/snippets
Returns all context snippets for a project.
[
  {
    "id": 1,
    "projectId": 1,
    "name": "Code Style",
    "content": "Use TypeScript strict mode...",
    "enabled": true,
    "createdAt": "2025-01-15T10:00:00Z"
  }
]

Get Snippet

GET /api/projects/:projectId/snippets/:id

Create Snippet

POST /api/projects/:projectId/snippets
Content-Type: application/json
{
  "name": "Code Style",
  "content": "Use TypeScript strict mode.\nPrefer functional components.\nUse named exports.",
  "enabled": true
}
FieldRequiredDefaultDescription
nameYesDisplay name for the snippet
contentYesText injected into Claude’s prompt
enabledNotrueWhether to include in prompts

Update Snippet

PUT /api/projects/:projectId/snippets/:id
Content-Type: application/json
Accepts the same fields as Create. Only included fields are updated.
Toggle a snippet off by sending { "enabled": false } — this preserves the content while excluding it from future prompts.

Delete Snippet

DELETE /api/projects/:projectId/snippets/:id
Deleting a snippet is permanent. If you want to temporarily remove it from prompts, disable it instead.