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
}
| Field | Required | Default | Description |
|---|
name | Yes | — | Display name for the snippet |
content | Yes | — | Text injected into Claude’s prompt |
enabled | No | true | Whether 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.