You can put attach statements in files that you load. \begin{verbatim} sage: load "file1.sage" sage: foo(5) foo 5 sage: bar(6) bar 6 \end{verbatim}