files changedmanaged-agents/files
Nearest release: v2.1.238, published under an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+21added
Lines−19removed
From line
24
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits18to this page, all time
The whole hunk
from line 24, old and new numbered
/
from line 24
2424 ```
2525
2626 ```bash CLI
27 FILE_ID=$(ant beta:files upload \
27 FILE_ID=$(ant files upload \
2828 --file data.csv \
2929 --transform id --raw-output)
3030 ```
3131
3232 ```python Python
33 file = client.beta.files.upload(file=Path("data.csv"))
33 file = client.files.upload(file=Path("data.csv"))
3434 print(f"File ID: {file.id}")
3535 ```
3636
3737 ```typescript TypeScript
38 const file = await client.beta.files.upload({
38 const file = await client.files.upload({
3939 file: await toFile(readFile("data.csv"), "data.csv", { type: "text/csv" }),
4040 });
4141 console.log(`File ID: ${file.id}`);
from line 43
4343
4444 ```csharp C#
4545 await using var stream = File.OpenRead(csvPath);
46 var file = await client.Beta.Files.Upload(new() { File = stream });
46 var file = await client.Files.Upload(new() { File = stream });
4747 Console.WriteLine($"File ID: {file.ID}");
4848 ```
4949
from line 54
5454 }
5555 defer csvFile.Close()
5656
57 file, err := client.Beta.Files.Upload(ctx, anthropic.BetaFileUploadParams{
57 file, err := client.Files.Upload(ctx, anthropic.FileUploadParams{
5858 File: csvFile,
5959 })
6060 if err != nil {
from line 64
6464 ```
6565
6666 ```java Java
67 var file = client.beta().files().upload(
67 var file = client.files().upload(
6868 FileUploadParams.builder().file(dataCsv).build()
6969 );
7070 IO.println("File ID: " + file.id());
from line 78
7878 ```
7979
8080 ```ruby Ruby
81 file = client.beta.files.upload(file: Pathname(csv_path))
81 file = client.files.upload(file: Pathname(csv_path))
8282 puts "File ID: #{file.id}"
8383 ```
8484</CodeGroup>
from line 537
537537
538538## Listing and downloading session files
539539
540Use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to list files scoped to a session and download them.
540Use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to list files scoped to a session and download them. Filtering by `scope_id` requires the `managed-agents-2026-04-01` beta header, so the list examples use the `beta` files namespace and pass that header explicitly. Downloading a file doesn't require a beta header.
541541
542542<CodeGroup>
543543 ```bash cURL
from line 551
551551 curl -fsSL "https://api.anthropic.com/v1/files/$FILE_ID/content" \
552552 -H "x-api-key: $ANTHROPIC_API_KEY" \
553553 -H "anthropic-version: 2023-06-01" \
554 -H "anthropic-beta: managed-agents-2026-04-01" \
555554 -o output.txt
556555 ```
557556
from line 560
561560 --beta managed-agents-2026-04-01
562561
563562 # Download a file
564 ant beta:files download --file-id "$FILE_ID" --output output.txt
563 ant files download --file-id "$FILE_ID" --output output.txt
565564 ```
566565
567566 ```python Python
from line 573
574573 print(file.id, file.filename)
575574
576575 # Download a file
577 content = client.beta.files.download(files.data[0].id)
576 content = client.files.download(files.data[0].id)
578577 content.write_to_file("output.txt")
579578 ```
580579
581580 ```typescript TypeScript
581 import { writeFile } from "node:fs/promises";
582
582583 // List files associated with a session
583584 const files = await client.beta.files.list({
584585 scope_id: "sesn_abc123",
from line 590
589590 }
590591
591592 // Download a file
592 const content = await client.beta.files.download(files.data[0].id);
593 await content.writeToFile("output.txt");
593 const content = await client.files.download(files.data[0].id);
594 await writeFile("output.txt", new Uint8Array(await content.arrayBuffer()));
594595 ```
595596
596597 ```csharp C#
597598 // List files associated with a session
598 var files = await client.Beta.Files.List(new FileListParams
599 var files = await client.Beta.Files.List(new()
599600 {
600601 ScopeID = "sesn_abc123",
601602 Betas = ["managed-agents-2026-04-01"],
from line 603
602603 });
603604
604605 // Download a file
605 byte[] content = await client.Beta.Files.Download(files.Data[0].ID);
606 await File.WriteAllBytesAsync("output.txt", content);
606 using var content = await client.Files.Download(files.Items[0].ID);
607 await using var output = File.Create("output.txt");
608 await (await content.ReadAsStream()).CopyToAsync(output);
607609 ```
608610
609611 ```go Go
from line 619
617619 }
618620
619621 // Download a file
620 resp, err := client.Beta.Files.Download(ctx, files.Data[0].ID, anthropic.BetaFileDownloadParams{})
622 resp, err := client.Files.Download(ctx, files.Data[0].ID)
621623 if err != nil {
622624 panic(err)
623625 }
from line 642
640642 .build());
641643
642644 // Download a file
643 try (HttpResponse response = client.beta().files().download(files.data().get(0).id())) {
645 try (HttpResponse response = client.files().download(files.data().get(0).id())) {
644646 try (InputStream body = response.body()) {
645647 Files.copy(body, Path.of("output.txt"), StandardCopyOption.REPLACE_EXISTING);
646648 }
from line 669
667669 )
668670
669671 # Download a file
670 content = client.beta.files.download(files.data[0].id)
672 content = client.files.download(files.data[0].id)
671673 File.binwrite("output.txt", content.read)
672674 ```
673675</CodeGroup>
No line in this hunk matches that.