That's great. However, there is one final issue I talked about before:
why doesn't this
```
\newcommand{\inputtikz}[1]{%
\tikzexternalenable%
\tikzset{external/watch/font size}%
\tikzsetnextfilename{#1}%
\input{#1}%
\tikzexternaldisable%
}
```
work as expected by externalizing only that sent to `\inputtikz` in the following
```
\documentclass{exam}
\usepackage{tikz}
\makeatletter
\def\tikz@external@watch@store@aux#1#2{%
\immediate\write\@mainaux{\string\expandafter\xdef\noexpand\csname pgfk@/tikz/external/watch/stored/#1\string\endcsname{#2}}}%
\def\tikz@external@watch@get@from@aux#1#2{%
\ifcsname pgfk@/tikz/external/watch/stored/#1\endcsname
\edef#2{\csname pgfk@/tikz/external/watch/stored/#1\endcsname}%
\else
\edef#2{0}%
\fi}
\tikzset{external/watch/.cd,store/.code 2 args={%
\tikz@external@watch@store@aux{#1}{#2}},
get/.code 2 args={\tikz@external@watch@get@from@aux{#1}{#2}},
font size/.code={\tikzset{external/watch/get={font size}{\pgfutil@tempa},
external/watch/store={font size}{\f@size}}%
\unless\ifnum\pgfutil@tempa=\f@size
\tikzset{/tikz/external/force remake}%
\fi
}}
\makeatother
\usetikzlibrary{external}
\newcommand{\inputtikz}[1]{%
\tikzexternalenable%
\tikzset{external/watch/font size}%
\tikzsetnextfilename{#1}%
\input{#1}%
\tikzexternaldisable%
}
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{arrows, shapes, calc, positioning, patterns, decorations, decorations.markings, quotes, fpu, patterns, decorations.pathmorphing}
\usepackage{xparse}
\usepackage[xparse,breakable,raster,skins]{tcolorbox}% xparse,breakable
\tcbuselibrary{fitting}
\tcbset{shield externalize}
\def\headerContents{%
\begin{tcboxedraster}[
raster columns=3, raster rows=1, valign=center,
raster height = 2cm, raster column skip = 0mm
]{blankest, nobeforeafter, baseline=\baselineskip, enlarge bottom finally by=-0.4pt}
\begin{tcolorbox}[left=0pt,right=0pt]
First line\\ Second Line
\end{tcolorbox}
\begin{tcolorbox}[halign=center]
Centered Text
\end{tcolorbox}
\begin{tcolorbox}[halign=right]
\includegraphics[height=2cm]{example-image-a}
\end{tcolorbox}
\end{tcboxedraster}%
}
\pagestyle{headandfoot}
\firstpageheader{}{\headerContents}{}
\usepackage[
includehead,
top = 0mm, % 0mm is just for test
headheight = 10em,
headheight = 2cm,
showframe % draw frames to show page layout
]{geometry}
\begin{document}
\begin{tikzpicture}
\draw (0,0) rectangle node{before} (4,4);
\end{tikzpicture}
\inputtikz{rect.tikz}
\begin{tikzpicture}
\draw (0,0) rectangle node{after} (4,4);
\end{tikzpicture}
\end{document}
```