That's what the `-c` option of `grep` (to `c`ount) is for:
$ grep -ce '^>' -- *.fasta
cel.fasta:3
pas.fasta:1
test.fasta:2
Note that if there's only one matching file, the file name will not be printed. Some `grep` implementations have a `-H` option to force the file name to be printed always:
$ grep -Hce '^>' -- *.fasta
cel.fasta:3
To get your exact expected output, you just need to replace `.fasta:` with `,`:
$ grep -Hce '^>' -- *.fasta | sed 's/\.fasta:/,/'
cel,3
pas,1
test,2
(here assuming your file names don't contain other occurrences of `.fasta:` such as `my.fasta:foo.fasta`; of course newline or `,` or `"` characters and potentially whitespace characters in file names would also be a problem if the output is meant to be in CSV format)