> ## Documentation Index
> Fetch the complete documentation index at: https://code.storage/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# repo.appendNote()

> Append content to an existing note (creates if it doesn't exist).

> [!WARNING]
>
> This page documents the earlier Code Storage SDKs: `@pierre/storage`, `pierre-storage`, and
> `code-storage-go`. New code uses the [Pierre SDK](https://code.storage/docs/sdks.md). To move code to the new SDK, use the
> [`pierre-migrate`
> skill](https://github.com/pierrecomputer/skills/tree/main/skills/pierre-migrate).

Git notes allow you to attach metadata to commits without modifying the commit itself. Notes are
written to `refs/notes/commits` by default. Pass `ref` to append on another notes ref.

See [Git Notes](https://code.storage/docs/repos/git-notes.md) for notes ref rules and write behavior.

```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
const result = await repo.appendNote({
  sha: 'abc123def456...',
  note: '\n---\nReviewed by @alice - LGTM',
  ref: 'reviews', // optional
  author: { name: 'Review Bot', email: 'review@example.com' },
});

console.log(`Note updated, new ref: ${result.newRefSha}`);
```

```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
result = await repo.append_note(
    sha="abc123def456...",
    note="\n---\nReviewed by @alice - LGTM",
    ref="reviews",  # optional
    author={"name": "Review Bot", "email": "review@example.com"},
)

print(f"Note updated, new ref: {result['new_ref_sha']}")
```

```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
// Append to a git note
result, err := repo.AppendNote(context.Background(), storage.AppendNoteOptions{
	SHA:  "abc123def456",
	Note: "\n---\nReviewed by @alice - LGTM",
	Ref:  "reviews", // optional
	Author: &storage.NoteAuthor{
		Name:  "Review Bot",
		Email: "review@example.com",
	},
})
fmt.Printf("Note updated, new ref: %s", result.NewRefSHA)
```

## Options

**sha** `string` *required*

Commit SHA to attach the note to

**note** `string` *required*

Note content to append

**ref** `string`

Notes ref to append on. Accepts short names like `reviews`, `notes/reviews`, or full refs like
`refs/notes/reviews`; all are normalized to a full `refs/notes/*` ref. Defaults to
`refs/notes/commits`. Go: `Ref`.

**author** `string`

Author signature (`name` and `email`)

**expectedRefSha** `string`

Expected SHA of the target notes ref for optimistic concurrency control

**ttl** `string`

Token TTL. Token TTL in seconds.

**refPolicies** `object[]`

Ordered ref policy rules (`{ pattern, ops? }`) in the JWT for this call. Code Storage checks the target notes ref. Python: `ref_policies`. Go: `RefPolicies` with type `storage.RefPolicyList`. See [Ref Policies](https://code.storage/docs/repos/ref-policies.md).

## Response

**sha** `string`

The commit SHA the note is attached to

**targetRef** `string`

The canonical notes ref that was updated

**baseCommit** `string`

Previous notes ref commit SHA

**newRefSha** `string`

New notes ref SHA after the operation

**result** `object`

Operation result with `success`, `status`, and optional `message`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.