"Six days you shall do your work" (Exodus 23:12). The Sabbath of Creation is mentioned here in connection with the seventh year, so that the weekly Sabbath of Creation should not be uprooted from its place [by the laws of the sabbatical year]. "So that your ox and your donkey may rest" (Exodus 23:12). Scripture added for the animal one form of rest, namely, to be able to tear food from the ground and eat. You say it comes for this; or does it come only [to teach] that one should shut the animal up inside his house? You have said: that is not rest but distress. Scripture teaches, "so that your ox may rest": Scripture added for it one form of rest, namely, to be able to tear food from the ground and eat.
Six Days You Shall Work and the Added Rest of Ox and Donkey
Yalkut Shimoni on Torah 354:3
(שמות כג יב) שֵׁשֶׁת יָמִים תַּעֲשֶׂה מַעֲשֶׂיךָ נֶאֱמַר כַּאן שַׁבָּת בְּרֵאשִׁית לְעִנְיָן שְׁבִיעִית, שֶׁלֹּא תִּסְתָּרֵס שַׁבָּת בְּרֵאשִׁית מִמְּקוֹמָהּ לְמַעַן יָנוּחַ שׁוֹרְךָ וַחֲמֹרֶךָ, הוֹסִיף לוֹ הַכָּתוּב נַיְחָא אֶחָד, לִהְיוֹת תּוֹלֵשׁ מִן הַקַּרְקַע וְאוֹכֵל. אַתָּה אוֹמֵר לְכָךְ בָּא, אוֹ לֹא בָּא אֶלָּא יַחְבְּשֶׁנּוּ בְּתוֹךְ בֵּיתוֹ אָמַרְתָּ, אֵין זֶה נְיַיח אֶלָּא צַעַר. תַּלְמוּד לוֹמַר לְמַעַן יָנוּחַ שׁוֹרְךָ, הוֹסִיף לוֹ הַכָּתוּב נְיַח אֶחָד, לִהְיוֹת תּוֹלֵשׁ מִן הַקַּרְקַע וְאוֹכֵל.